This source file includes following definitions.
- __FD_SET
- __FD_CLR
- __FD_ISSET
- __FD_ZERO
1 #ifndef _ALPHA_TYPES_H
2 #define _ALPHA_TYPES_H
3
4 #ifndef _SIZE_T
5 #define _SIZE_T
6 typedef unsigned long size_t;
7 #endif
8
9 #ifndef _SSIZE_T
10 #define _SSIZE_T
11 typedef long ssize_t;
12 #endif
13
14 #ifndef _PTRDIFF_T
15 #define _PTRDIFF_T
16 typedef long ptrdiff_t;
17 #endif
18
19 #ifndef _TIME_T
20 #define _TIME_T
21 typedef long time_t;
22 #endif
23
24 #ifndef _CLOCK_T
25 #define _CLOCK_T
26 typedef long clock_t;
27 #endif
28
29 typedef int pid_t;
30 typedef unsigned int uid_t;
31 typedef unsigned int gid_t;
32 typedef unsigned int dev_t;
33 typedef unsigned int ino_t;
34 typedef unsigned int mode_t;
35 typedef unsigned int umode_t;
36 typedef unsigned short nlink_t;
37 typedef int daddr_t;
38 typedef long off_t;
39
40
41
42
43
44
45 typedef __signed__ char __s8;
46 typedef unsigned char __u8;
47
48 typedef __signed__ short __s16;
49 typedef unsigned short __u16;
50
51 typedef __signed__ int __s32;
52 typedef unsigned int __u32;
53
54
55
56
57 #if ((~0UL) == 0xffffffff)
58
59 #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
60 typedef __signed__ long long __s64;
61 typedef unsigned long long __u64;
62 #endif
63
64 #else
65
66 typedef __signed__ long __s64;
67 typedef unsigned long __u64;
68
69 #endif
70
71
72
73
74 #ifdef __KERNEL__
75
76 typedef signed char s8;
77 typedef unsigned char u8;
78
79 typedef signed short s16;
80 typedef unsigned short u16;
81
82 typedef signed int s32;
83 typedef unsigned int u32;
84
85
86
87
88 #if ((~0UL) == 0xffffffff)
89
90 typedef signed long long s64;
91 typedef unsigned long long u64;
92
93 #else
94
95 typedef signed long s64;
96 typedef unsigned long u64;
97
98 #endif
99
100 #endif
101
102 #undef __FD_SET
103 static __inline__ void __FD_SET(unsigned long fd, fd_set *fdsetp)
104 {
105 unsigned long _tmp = fd / __NFDBITS;
106 unsigned long _rem = fd % __NFDBITS;
107 fdsetp->fds_bits[_tmp] |= (1UL<<_rem);
108 }
109
110 #undef __FD_CLR
111 static __inline__ void __FD_CLR(unsigned long fd, fd_set *fdsetp)
112 {
113 unsigned long _tmp = fd / __NFDBITS;
114 unsigned long _rem = fd % __NFDBITS;
115 fdsetp->fds_bits[_tmp] &= ~(1UL<<_rem);
116 }
117
118 #undef __FD_ISSET
119 static __inline__ int __FD_ISSET(unsigned long fd, fd_set *p)
120 {
121 unsigned long _tmp = fd / __NFDBITS;
122 unsigned long _rem = fd % __NFDBITS;
123 return (p->fds_bits[_tmp] & (1UL<<_rem)) != 0;
124 }
125
126
127
128
129
130 #undef __FD_ZERO
131 static __inline__ void __FD_ZERO(fd_set *p)
132 {
133 unsigned int *tmp = p->fds_bits;
134 int i;
135
136 if (__builtin_constant_p(__FDSET_INTS)) {
137 switch (__FDSET_INTS) {
138 case 8:
139 tmp[0] = 0; tmp[1] = 0; tmp[2] = 0; tmp[3] = 0;
140 tmp[4] = 0; tmp[5] = 0; tmp[6] = 0; tmp[7] = 0;
141 return;
142 }
143 }
144 i = __FDSET_INTS;
145 while (i) {
146 i--;
147 *tmp = 0;
148 tmp++;
149 }
150 }
151
152 #endif