diff options
| author | jvoisin | 2023-03-18 14:01:02 +0100 |
|---|---|---|
| committer | jvoisin | 2023-04-13 23:48:57 +0200 |
| commit | 3e6704d0be707487d7a9dccfdc75203c7261e11b (patch) | |
| tree | cd04ae414fa7ef646a31f767b9295946fd2c9987 /include/sys/select.h | |
| parent | e3fee64643279c144efd3d6856ed4e818c0d5ca2 (diff) | |
Make use of __builtin_dynamic_object_size
GCC and Clang provide __builtin_dynamic_object_size
(see documentation: https://gcc.gnu.org/onlinedocs/gcc/Object-Size-Checking.html),
so we should make use of it when its available.
Diffstat (limited to 'include/sys/select.h')
| -rw-r--r-- | include/sys/select.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/sys/select.h b/include/sys/select.h index bcee8be..1f19672 100644 --- a/include/sys/select.h +++ b/include/sys/select.h | |||
| @@ -30,7 +30,7 @@ extern "C" { | |||
| 30 | static __inline__ __attribute__((__always_inline__,__gnu_inline__,__artificial__)) | 30 | static __inline__ __attribute__((__always_inline__,__gnu_inline__,__artificial__)) |
| 31 | void __fortify_FD_CLR(int __f, fd_set *__s) | 31 | void __fortify_FD_CLR(int __f, fd_set *__s) |
| 32 | { | 32 | { |
| 33 | size_t __b = __builtin_object_size(__s, 0); | 33 | size_t __b = __bos(__s, 0); |
| 34 | 34 | ||
| 35 | if (__f < 0 || __f >= FD_SETSIZE || __b < sizeof(fd_set)) | 35 | if (__f < 0 || __f >= FD_SETSIZE || __b < sizeof(fd_set)) |
| 36 | __builtin_trap(); | 36 | __builtin_trap(); |
| @@ -40,7 +40,7 @@ void __fortify_FD_CLR(int __f, fd_set *__s) | |||
| 40 | static __inline__ __attribute__((__always_inline__,__gnu_inline__,__artificial__)) | 40 | static __inline__ __attribute__((__always_inline__,__gnu_inline__,__artificial__)) |
| 41 | void __fortify_FD_SET(int __f, fd_set *__s) | 41 | void __fortify_FD_SET(int __f, fd_set *__s) |
| 42 | { | 42 | { |
| 43 | size_t __b = __builtin_object_size(__s, 0); | 43 | size_t __b = __bos(__s, 0); |
| 44 | 44 | ||
| 45 | if (__f < 0 || __f >= FD_SETSIZE || __b < sizeof(fd_set)) | 45 | if (__f < 0 || __f >= FD_SETSIZE || __b < sizeof(fd_set)) |
| 46 | __builtin_trap(); | 46 | __builtin_trap(); |
