summaryrefslogtreecommitdiff
path: root/include/sys
diff options
context:
space:
mode:
authorTrutz Behn2015-06-03 19:27:01 +0200
committersin2015-06-03 18:55:35 +0100
commit1cd5461a5375207602f2cbdfd9a50a9b751cb7c8 (patch)
treef83f8a0ccb05715aadef4d2bcc770c93ea0b97ec /include/sys
parenta9ee1d2743acb0b2903db87c0a241c0a569cfc4e (diff)
Use namespace-safe macro, param and variable names
Diffstat (limited to 'include/sys')
-rw-r--r--include/sys/select.h16
-rw-r--r--include/sys/socket.h36
2 files changed, 26 insertions, 26 deletions
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" {
25#endif 25#endif
26 26
27static __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__)) 27static __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__))
28void __fortify_FD_CLR(int fd, fd_set *set) 28void __fortify_FD_CLR(int __f, fd_set *__s)
29{ 29{
30 size_t bos = __builtin_object_size(set, 0); 30 size_t __b = __builtin_object_size(__s, 0);
31 31
32 if (fd < 0 || fd >= FD_SETSIZE || bos < sizeof(fd_set)) 32 if (__f < 0 || __f >= FD_SETSIZE || __b < sizeof(fd_set))
33 __builtin_trap(); 33 __builtin_trap();
34 FD_CLR(fd, set); 34 FD_CLR(__f, __s);
35} 35}
36 36
37static __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__)) 37static __inline __attribute__((__always_inline__,__gnu_inline__,__artificial__))
38void __fortify_FD_SET(int fd, fd_set *set) 38void __fortify_FD_SET(int __f, fd_set *__s)
39{ 39{
40 size_t bos = __builtin_object_size(set, 0); 40 size_t __b = __builtin_object_size(__s, 0);
41 41
42 if (fd < 0 || fd >= FD_SETSIZE || bos < sizeof(fd_set)) 42 if (__f < 0 || __f >= FD_SETSIZE || __b < sizeof(fd_set))
43 __builtin_trap(); 43 __builtin_trap();
44 FD_SET(fd, set); 44 FD_SET(__f, __s);
45} 45}
46 46
47#undef FD_CLR 47#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" {
30#undef send 30#undef send
31#undef sendto 31#undef sendto
32 32
33fortify_fn(recv) ssize_t recv(int sockfd, void *buf, size_t n, int flags) 33_FORTIFY_FN(recv) ssize_t recv(int __f, void *__s, size_t __n, int __fl)
34{ 34{
35 size_t bos = __builtin_object_size(buf, 0); 35 size_t __b = __builtin_object_size(__s, 0);
36 36
37 if (n > bos) 37 if (__n > __b)
38 __builtin_trap(); 38 __builtin_trap();
39 return __orig_recv(sockfd, buf, n, flags); 39 return __orig_recv(__f, __s, __n, __fl);
40} 40}
41 41
42fortify_fn(recvfrom) ssize_t recvfrom(int sockfd, void *buf, size_t n, int flags, 42_FORTIFY_FN(recvfrom) ssize_t recvfrom(int __f, void *__s, size_t __n, int __fl,
43 struct sockaddr *sa, socklen_t *salen) 43 struct sockaddr *__a, socklen_t *__l)
44{ 44{
45 size_t bos = __builtin_object_size(buf, 0); 45 size_t __b = __builtin_object_size(__s, 0);
46 46
47 if (n > bos) 47 if (__n > __b)
48 __builtin_trap(); 48 __builtin_trap();
49 return __orig_recvfrom(sockfd, buf, n, flags, sa, salen); 49 return __orig_recvfrom(__f, __s, __n, __fl, __a, __l);
50} 50}
51 51
52fortify_fn(send) ssize_t send(int sockfd, const void *buf, size_t n, int flags) 52_FORTIFY_FN(send) ssize_t send(int __f, const void *__s, size_t __n, int __fl)
53{ 53{
54 size_t bos = __builtin_object_size(buf, 0); 54 size_t __b = __builtin_object_size(__s, 0);
55 55
56 if (n > bos) 56 if (__n > __b)
57 __builtin_trap(); 57 __builtin_trap();
58 return __orig_send(sockfd, buf, n, flags); 58 return __orig_send(__f, __s, __n, __fl);
59} 59}
60 60
61fortify_fn(sendto) ssize_t sendto(int sockfd, const void *buf, size_t n, int flags, 61_FORTIFY_FN(sendto) ssize_t sendto(int __f, const void *__s, size_t __n, int __fl,
62 const struct sockaddr *sa, socklen_t salen) 62 const struct sockaddr *__a, socklen_t __l)
63{ 63{
64 size_t bos = __builtin_object_size(buf, 0); 64 size_t __b = __builtin_object_size(__s, 0);
65 65
66 if (n > bos) 66 if (__n > __b)
67 __builtin_trap(); 67 __builtin_trap();
68 return __orig_sendto(sockfd, buf, n, flags, sa, salen); 68 return __orig_sendto(__f, __s, __n, __fl, __a, __l);
69} 69}
70 70
71#ifdef __cplusplus 71#ifdef __cplusplus