patch-2.1.9 linux/include/asm-sparc/posix_types.h
Next file: linux/include/asm-sparc/processor.h
Previous file: linux/include/asm-sparc/pgtsun4c.h
Back to the patch index
Back to the overall index
- Lines: 87
- Date:
Sat Nov 9 10:29:57 1996
- Orig file:
v2.1.8/linux/include/asm-sparc/posix_types.h
- Orig date:
Mon Jun 3 10:09:14 1996
diff -u --recursive --new-file v2.1.8/linux/include/asm-sparc/posix_types.h linux/include/asm-sparc/posix_types.h
@@ -8,17 +8,18 @@
*/
/* When cross-compilation is no longer an issue, fix this. */
-#ifdef __svr4__
-typedef unsigned int __kernel_size_t; /* solaris sucks */
+#if defined(__svr4__) || defined(__ELF__)
+typedef unsigned int __kernel_size_t;
#else
-typedef long unsigned int __kernel_size_t; /* sunos is much better */
-#endif /* !(__svr4__) */
+typedef long unsigned int __kernel_size_t;
+#endif /* !(__svr4__ || __ELF__) */
typedef int __kernel_ssize_t;
typedef long int __kernel_ptrdiff_t;
typedef long __kernel_time_t;
typedef long __kernel_clock_t;
typedef int __kernel_pid_t;
+typedef unsigned short __kernel_ipc_pid_t;
typedef unsigned short __kernel_uid_t;
typedef unsigned short __kernel_gid_t;
typedef unsigned short __kernel_dev_t;
@@ -55,7 +56,7 @@
}
#undef __FD_ISSET
-static __inline__ int __FD_ISSET(unsigned long fd, __kernel_fd_set *p)
+static __inline__ int __FD_ISSET(unsigned long fd, __const__ __kernel_fd_set *p)
{
unsigned long _tmp = fd / __NFDBITS;
unsigned long _rem = fd % __NFDBITS;
@@ -63,27 +64,43 @@
}
/*
- * This will unroll the loop for the normal constant cases (4 or 8 longs,
- * for 256 and 512-bit fd_sets respectively)
+ * This will unroll the loop for the normal constant cases (8 or 32 longs,
+ * for 256 and 1024-bit fd_sets respectively)
*/
#undef __FD_ZERO
static __inline__ void __FD_ZERO(__kernel_fd_set *p)
{
- unsigned int *tmp = p->fds_bits;
+ unsigned long *tmp = p->fds_bits;
int i;
- if (__builtin_constant_p(__FDSET_INTS)) {
- switch (__FDSET_INTS) {
+ if (__builtin_constant_p(__FDSET_LONGS)) {
+ switch (__FDSET_LONGS) {
+ case 32:
+ tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0;
+ tmp[ 4] = 0; tmp[ 5] = 0; tmp[ 6] = 0; tmp[ 7] = 0;
+ tmp[ 8] = 0; tmp[ 9] = 0; tmp[10] = 0; tmp[11] = 0;
+ tmp[12] = 0; tmp[13] = 0; tmp[14] = 0; tmp[15] = 0;
+ tmp[16] = 0; tmp[17] = 0; tmp[18] = 0; tmp[19] = 0;
+ tmp[20] = 0; tmp[21] = 0; tmp[22] = 0; tmp[23] = 0;
+ tmp[24] = 0; tmp[25] = 0; tmp[26] = 0; tmp[27] = 0;
+ tmp[28] = 0; tmp[29] = 0; tmp[30] = 0; tmp[31] = 0;
+ return;
+ case 16:
+ tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0;
+ tmp[ 4] = 0; tmp[ 5] = 0; tmp[ 6] = 0; tmp[ 7] = 0;
+ tmp[ 8] = 0; tmp[ 9] = 0; tmp[10] = 0; tmp[11] = 0;
+ tmp[12] = 0; tmp[13] = 0; tmp[14] = 0; tmp[15] = 0;
+ return;
case 8:
- tmp[0] = 0; tmp[1] = 0; tmp[2] = 0; tmp[3] = 0;
- tmp[4] = 0; tmp[5] = 0; tmp[6] = 0; tmp[7] = 0;
- return;
+ tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0;
+ tmp[ 4] = 0; tmp[ 5] = 0; tmp[ 6] = 0; tmp[ 7] = 0;
+ return;
case 4:
- tmp[0] = 0; tmp[1] = 0; tmp[2] = 0; tmp[3] = 0;
- return;
+ tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0;
+ return;
}
}
- i = __FDSET_INTS;
+ i = __FDSET_LONGS;
while (i) {
i--;
*tmp = 0;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov