From 1cd5461a5375207602f2cbdfd9a50a9b751cb7c8 Mon Sep 17 00:00:00 2001 From: Trutz Behn Date: Wed, 3 Jun 2015 19:27:01 +0200 Subject: Use namespace-safe macro, param and variable names --- include/sys/select.h | 16 ++++++++-------- include/sys/socket.h | 36 ++++++++++++++++++------------------ 2 files changed, 26 insertions(+), 26 deletions(-) (limited to 'include/sys') diff --git a/include/sys/select.h b/include/sys/select.h index 0f1e1df..4623071 100644 --- a/include/sys/select.h +++ b/include/sys/select.h @@ -25,23 +25,23 @@ extern "C" { #endif static __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__)) -void __fortify_FD_CLR(int fd, fd_set *set) +void __fortify_FD_CLR(int __f, fd_set *__s) { - size_t bos = __builtin_object_size(set, 0); + size_t __b = __builtin_object_size(__s, 0); - if (fd < 0 || fd >= FD_SETSIZE || bos < sizeof(fd_set)) + if (__f < 0 || __f >= FD_SETSIZE || __b < sizeof(fd_set)) __builtin_trap(); - FD_CLR(fd, set); + FD_CLR(__f, __s); } static __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__)) -void __fortify_FD_SET(int fd, fd_set *set) +void __fortify_FD_SET(int __f, fd_set *__s) { - size_t bos = __builtin_object_size(set, 0); + size_t __b = __builtin_object_size(__s, 0); - if (fd < 0 || fd >= FD_SETSIZE || bos < sizeof(fd_set)) + if (__f < 0 || __f >= FD_SETSIZE || __b < sizeof(fd_set)) __builtin_trap(); - FD_SET(fd, set); + FD_SET(__f, __s); } #undef FD_CLR diff --git a/include/sys/socket.h b/include/sys/socket.h index c6e4c35..e68e21c 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -30,42 +30,42 @@ extern "C" { #undef send #undef sendto -fortify_fn(recv) ssize_t recv(int sockfd, void *buf, size_t n, int flags) +_FORTIFY_FN(recv) ssize_t recv(int __f, void *__s, size_t __n, int __fl) { - size_t bos = __builtin_object_size(buf, 0); + size_t __b = __builtin_object_size(__s, 0); - if (n > bos) + if (__n > __b) __builtin_trap(); - return __orig_recv(sockfd, buf, n, flags); + return __orig_recv(__f, __s, __n, __fl); } -fortify_fn(recvfrom) ssize_t recvfrom(int sockfd, void *buf, size_t n, int flags, - struct sockaddr *sa, socklen_t *salen) +_FORTIFY_FN(recvfrom) ssize_t recvfrom(int __f, void *__s, size_t __n, int __fl, + struct sockaddr *__a, socklen_t *__l) { - size_t bos = __builtin_object_size(buf, 0); + size_t __b = __builtin_object_size(__s, 0); - if (n > bos) + if (__n > __b) __builtin_trap(); - return __orig_recvfrom(sockfd, buf, n, flags, sa, salen); + return __orig_recvfrom(__f, __s, __n, __fl, __a, __l); } -fortify_fn(send) ssize_t send(int sockfd, const void *buf, size_t n, int flags) +_FORTIFY_FN(send) ssize_t send(int __f, const void *__s, size_t __n, int __fl) { - size_t bos = __builtin_object_size(buf, 0); + size_t __b = __builtin_object_size(__s, 0); - if (n > bos) + if (__n > __b) __builtin_trap(); - return __orig_send(sockfd, buf, n, flags); + return __orig_send(__f, __s, __n, __fl); } -fortify_fn(sendto) ssize_t sendto(int sockfd, const void *buf, size_t n, int flags, - const struct sockaddr *sa, socklen_t salen) +_FORTIFY_FN(sendto) ssize_t sendto(int __f, const void *__s, size_t __n, int __fl, + const struct sockaddr *__a, socklen_t __l) { - size_t bos = __builtin_object_size(buf, 0); + size_t __b = __builtin_object_size(__s, 0); - if (n > bos) + if (__n > __b) __builtin_trap(); - return __orig_sendto(sockfd, buf, n, flags, sa, salen); + return __orig_sendto(__f, __s, __n, __fl, __a, __l); } #ifdef __cplusplus -- cgit v1.3