about summary refs log tree commit diff
path: root/socket
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-03-19 21:04:10 +0000
committerJakub Jelinek <jakub@redhat.com>2005-03-19 21:04:10 +0000
commit8f8ebbc438fcb4b22fba8beb3ef3d1aa59d9d7bf (patch)
treeb7091affa76bbaf47e78a59dfc72b2102554eaf9 /socket
parentf5c3480e830e94e0e51a0bdb1053944daed8bc58 (diff)
downloadglibc-8f8ebbc438fcb4b22fba8beb3ef3d1aa59d9d7bf.tar.gz
glibc-8f8ebbc438fcb4b22fba8beb3ef3d1aa59d9d7bf.tar.xz
glibc-8f8ebbc438fcb4b22fba8beb3ef3d1aa59d9d7bf.zip
Updated to fedora-glibc-20050319T1907 cvs/fedora-glibc-2_3_4-15
Diffstat (limited to 'socket')
-rw-r--r--socket/bits/socket2.h39
1 files changed, 25 insertions, 14 deletions
diff --git a/socket/bits/socket2.h b/socket/bits/socket2.h
index c7ecac423f..6238163e8c 100644
--- a/socket/bits/socket2.h
+++ b/socket/bits/socket2.h
@@ -21,17 +21,28 @@
 # error "Never include <bits/socket2.h> directly; use <sys/socket.h> instead."
 #endif
 
-extern void __chk_fail (void) __attribute__((noreturn));
-#define recv(fd, buf, n, flags) \
-  (__extension__							      \
-    ({ size_t __n_val = (n);				  		      \
-       if (__bos0 (buf) != (size_t) -1 && __bos0 (buf) < __n_val)	      \
-         __chk_fail ();							      \
-       recv ((fd), (buf), __n_val, (flags)); }))
-
-#define recvfrom(fd, buf, n, flags, addr, addr_len) \
-  (__extension__							      \
-    ({ size_t __n_val = (n);				  		      \
-       if (__bos0 (buf) != (size_t) -1 && __bos0 (buf) < __n_val)	      \
-         __chk_fail ();							      \
-       recvfrom ((fd), (buf), __n_val, (flags), (addr), (addr_len)); }))
+extern void __chk_fail (void) __attribute__((__noreturn__));
+extern ssize_t __REDIRECT (__recv_alias, (int __fd, void *__buf, size_t __n,
+					  int __flags), recv);
+
+extern __always_inline ssize_t
+recv (int __fd, void *__buf, size_t __n, int __flags)
+{
+  if (__bos0 (__buf) != (size_t) -1 && __n > __bos0 (__buf))
+    __chk_fail ();
+  return __recv_alias (__fd, __buf, __n, __flags);
+}
+
+extern ssize_t __REDIRECT (__recvfrom_alias,
+			   (int __fd, void *__restrict __buf, size_t __n,
+			    int __flags, __SOCKADDR_ARG __addr,
+			    socklen_t *__restrict __addr_len), recvfrom);
+
+extern __always_inline ssize_t
+recvfrom (int __fd, void *__buf, size_t __n, int __flags,
+	  __SOCKADDR_ARG __addr, socklen_t *__restrict __addr_len)
+{
+  if (__bos0 (__buf) != (size_t) -1 && __n > __bos0 (__buf))
+    __chk_fail ();
+  return __recvfrom_alias (__fd, __buf, __n, __flags, __addr, __addr_len);
+}