This source file includes following definitions.
- __FD_SET
- __FD_CLR
- __FD_ISSET
- __FD_ZERO
1 #ifndef __ARCH_SPARC_POSIX_TYPES_H
2 #define __ARCH_SPARC_POSIX_TYPES_H
3
4
5
6
7
8
9
10
11 #ifdef __svr4__
12 typedef unsigned int __kernel_size_t;
13 #else
14 typedef long unsigned int __kernel_size_t;
15 #endif
16
17 typedef int __kernel_ssize_t;
18 typedef long int __kernel_ptrdiff_t;
19 typedef long __kernel_time_t;
20 typedef long __kernel_clock_t;
21 typedef int __kernel_pid_t;
22 typedef unsigned short __kernel_uid_t;
23 typedef unsigned short __kernel_gid_t;
24 typedef unsigned short __kernel_dev_t;
25 typedef unsigned long __kernel_ino_t;
26 typedef unsigned short __kernel_mode_t;
27 typedef unsigned short __kernel_umode_t;
28 typedef short __kernel_nlink_t;
29 typedef long __kernel_daddr_t;
30 typedef long __kernel_off_t;
31 typedef char * __kernel_caddr_t;
32
33 #ifdef __GNUC__
34 typedef long long __kernel_loff_t;
35 #endif
36
37 #undef __FD_SET
38 static __inline__ void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp)
39 {
40 unsigned long _tmp = fd / __NFDBITS;
41 unsigned long _rem = fd % __NFDBITS;
42 fdsetp->fds_bits[_tmp] |= (1UL<<_rem);
43 }
44
45 #undef __FD_CLR
46 static __inline__ void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp)
47 {
48 unsigned long _tmp = fd / __NFDBITS;
49 unsigned long _rem = fd % __NFDBITS;
50 fdsetp->fds_bits[_tmp] &= ~(1UL<<_rem);
51 }
52
53 #undef __FD_ISSET
54 static __inline__ int __FD_ISSET(unsigned long fd, __kernel_fd_set *p)
55 {
56 unsigned long _tmp = fd / __NFDBITS;
57 unsigned long _rem = fd % __NFDBITS;
58 return (p->fds_bits[_tmp] & (1UL<<_rem)) != 0;
59 }
60
61
62
63
64
65 #undef __FD_ZERO
66 static __inline__ void __FD_ZERO(__kernel_fd_set *p)
67 {
68 unsigned int *tmp = p->fds_bits;
69 int i;
70
71 if (__builtin_constant_p(__FDSET_INTS)) {
72 switch (__FDSET_INTS) {
73 case 8:
74 tmp[0] = 0; tmp[1] = 0; tmp[2] = 0; tmp[3] = 0;
75 tmp[4] = 0; tmp[5] = 0; tmp[6] = 0; tmp[7] = 0;
76 return;
77 case 4:
78 tmp[0] = 0; tmp[1] = 0; tmp[2] = 0; tmp[3] = 0;
79 return;
80 }
81 }
82 i = __FDSET_INTS;
83 while (i) {
84 i--;
85 *tmp = 0;
86 tmp++;
87 }
88 }
89
90 #endif