summaryrefslogtreecommitdiff
path: root/include/sys/select.h
diff options
context:
space:
mode:
authorjvoisin2023-08-22 20:08:52 +0200
committerjvoisin2023-08-22 20:08:52 +0200
commit2c610a26730540ff917cf83dd9dc5387184001b2 (patch)
treec80a9fa0791645d98ef48d3d6a4bebfa3b89b4d4 /include/sys/select.h
parentf3ff539ee4d739d704415f3ff17d72a822bb3d9b (diff)
Clean up some includes
- Remove a superfluous `#if defined(__has_builtin)` since it's already accounted for in include/fortify-headers.h - Replace `_FORTIFY_FD_POS0` with the already existing `_FORTIFY_POS0` - Factorise some duplicate code into a macro
Diffstat (limited to 'include/sys/select.h')
-rw-r--r--include/sys/select.h15
1 files changed, 5 insertions, 10 deletions
diff --git a/include/sys/select.h b/include/sys/select.h
index 265c7e1..df32003 100644
--- a/include/sys/select.h
+++ b/include/sys/select.h
@@ -28,14 +28,10 @@ __extension__
28extern "C" { 28extern "C" {
29#endif 29#endif
30 30
31#ifdef __clang__ 31#define _STI static __inline__ \
32#define _FORTIFY_FD_POS0 const __attribute__((__pass_object_size__(0))) 32 __attribute__((__always_inline__,__gnu_inline__,__artificial__))
33#else
34#define _FORTIFY_FD_POS0
35#endif
36 33
37static __inline__ __attribute__((__always_inline__,__gnu_inline__,__artificial__)) 34_STI void __fortify_FD_CLR(int __f, fd_set * _FORTIFY_POS0 __s)
38void __fortify_FD_CLR(int __f, fd_set * _FORTIFY_FD_POS0 __s)
39{ 35{
40 size_t __b = __bos(__s, 0); 36 size_t __b = __bos(__s, 0);
41 37
@@ -44,8 +40,7 @@ void __fortify_FD_CLR(int __f, fd_set * _FORTIFY_FD_POS0 __s)
44 FD_CLR(__f, __s); 40 FD_CLR(__f, __s);
45} 41}
46 42
47static __inline__ __attribute__((__always_inline__,__gnu_inline__,__artificial__)) 43_STI void __fortify_FD_SET(int __f, fd_set * _FORTIFY_POS0 __s)
48void __fortify_FD_SET(int __f, fd_set * _FORTIFY_FD_POS0 __s)
49{ 44{
50 size_t __b = __bos(__s, 0); 45 size_t __b = __bos(__s, 0);
51 46
@@ -54,7 +49,7 @@ void __fortify_FD_SET(int __f, fd_set * _FORTIFY_FD_POS0 __s)
54 FD_SET(__f, __s); 49 FD_SET(__f, __s);
55} 50}
56 51
57#undef _FORTIFY_FD_POS0 52#undef _STI
58 53
59#undef FD_CLR 54#undef FD_CLR
60#define FD_CLR(fd, set) __fortify_FD_CLR(fd, set) 55#define FD_CLR(fd, set) __fortify_FD_CLR(fd, set)