diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/sys/select.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/sys/select.h b/include/sys/select.h index df32003..29819be 100644 --- a/include/sys/select.h +++ b/include/sys/select.h | |||
| @@ -49,12 +49,23 @@ _STI void __fortify_FD_SET(int __f, fd_set * _FORTIFY_POS0 __s) | |||
| 49 | FD_SET(__f, __s); | 49 | FD_SET(__f, __s); |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | _STI int __fortify_FD_ISSET(int __f, fd_set * _FORTIFY_POS0 __s) | ||
| 53 | { | ||
| 54 | size_t __b = __bos(__s, 0); | ||
| 55 | |||
| 56 | if (__f < 0 || __f >= FD_SETSIZE || __b < sizeof(fd_set)) | ||
| 57 | __builtin_trap(); | ||
| 58 | return FD_ISSET(__f, __s); | ||
| 59 | } | ||
| 60 | |||
| 52 | #undef _STI | 61 | #undef _STI |
| 53 | 62 | ||
| 54 | #undef FD_CLR | 63 | #undef FD_CLR |
| 55 | #define FD_CLR(fd, set) __fortify_FD_CLR(fd, set) | 64 | #define FD_CLR(fd, set) __fortify_FD_CLR(fd, set) |
| 56 | #undef FD_SET | 65 | #undef FD_SET |
| 57 | #define FD_SET(fd, set) __fortify_FD_SET(fd, set) | 66 | #define FD_SET(fd, set) __fortify_FD_SET(fd, set) |
| 67 | #undef FD_ISSET | ||
| 68 | #define FD_ISSET(fd, set) __fortify_FD_ISSET(fd, set) | ||
| 58 | 69 | ||
| 59 | #ifdef __cplusplus | 70 | #ifdef __cplusplus |
| 60 | } | 71 | } |
