summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorsin2015-02-28 16:01:26 +0000
committersin2015-02-28 16:01:26 +0000
commit7212959240ea8a73671d234c8b61ac81ca775b26 (patch)
tree6de1c424ece3055bc3dbf2378a1f5943284019f2 /include
parent4672406edd54ffe1466cdcb4b36c849e7245d603 (diff)
Use __typeof__(sizeof 0) trickery
We cannot pull stddef.h and since fortify already relies on GCC features we can use the above typeof trick to get a usable size_t.
Diffstat (limited to 'include')
-rw-r--r--include/poll.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/poll.h b/include/poll.h
index cbc78fd..83801bd 100644
--- a/include/poll.h
+++ b/include/poll.h
@@ -9,9 +9,9 @@ static inline __attribute__ ((always_inline))
9int 9int
10__fortify_poll(struct pollfd *fds, nfds_t nfds, int timeout) 10__fortify_poll(struct pollfd *fds, nfds_t nfds, int timeout)
11{ 11{
12 __typeof__(sizeof 0) bos = __builtin_object_size(fds, 0);
12 13
13 if (__builtin_object_size(fds, 0) != -1 && 14 if (bos != -1 && nfds > bos / sizeof(struct pollfd))
14 nfds > __builtin_object_size(fds, 0) / sizeof(struct pollfd))
15 __builtin_trap(); 15 __builtin_trap();
16 return poll(fds, nfds, timeout); 16 return poll(fds, nfds, timeout);
17} 17}