diff options
-rw-r--r-- | include/asm-s390/posix_types.h | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/include/asm-s390/posix_types.h b/include/asm-s390/posix_types.h index 61788de3c0c3..b94c98856e12 100644 --- a/include/asm-s390/posix_types.h +++ b/include/asm-s390/posix_types.h | |||
@@ -76,24 +76,36 @@ typedef struct { | |||
76 | } __kernel_fsid_t; | 76 | } __kernel_fsid_t; |
77 | 77 | ||
78 | 78 | ||
79 | #if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) | 79 | #ifdef __KERNEL__ |
80 | 80 | ||
81 | #ifndef _S390_BITOPS_H | 81 | #undef __FD_SET |
82 | #include <asm/bitops.h> | 82 | static inline void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp) |
83 | #endif | 83 | { |
84 | 84 | unsigned long _tmp = fd / __NFDBITS; | |
85 | #undef __FD_SET | 85 | unsigned long _rem = fd % __NFDBITS; |
86 | #define __FD_SET(fd,fdsetp) set_bit((fd),(fdsetp)->fds_bits) | 86 | fdsetp->fds_bits[_tmp] |= (1UL<<_rem); |
87 | 87 | } | |
88 | #undef __FD_CLR | 88 | |
89 | #define __FD_CLR(fd,fdsetp) clear_bit((fd),(fdsetp)->fds_bits) | 89 | #undef __FD_CLR |
90 | 90 | static inline void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp) | |
91 | #undef __FD_ISSET | 91 | { |
92 | #define __FD_ISSET(fd,fdsetp) test_bit((fd),(fdsetp)->fds_bits) | 92 | unsigned long _tmp = fd / __NFDBITS; |
93 | unsigned long _rem = fd % __NFDBITS; | ||
94 | fdsetp->fds_bits[_tmp] &= ~(1UL<<_rem); | ||
95 | } | ||
96 | |||
97 | #undef __FD_ISSET | ||
98 | static inline int __FD_ISSET(unsigned long fd, const __kernel_fd_set *fdsetp) | ||
99 | { | ||
100 | unsigned long _tmp = fd / __NFDBITS; | ||
101 | unsigned long _rem = fd % __NFDBITS; | ||
102 | return (fdsetp->fds_bits[_tmp] & (1UL<<_rem)) != 0; | ||
103 | } | ||
93 | 104 | ||
94 | #undef __FD_ZERO | 105 | #undef __FD_ZERO |
95 | #define __FD_ZERO(fdsetp) (memset ((fdsetp), 0, sizeof(*(fd_set *)(fdsetp)))) | 106 | #define __FD_ZERO(fdsetp) \ |
107 | ((void) memset ((__ptr_t) (fdsetp), 0, sizeof (__kernel_fd_set))) | ||
96 | 108 | ||
97 | #endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)*/ | 109 | #endif /* __KERNEL__ */ |
98 | 110 | ||
99 | #endif | 111 | #endif |