about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2005-02-22 22:51:17 +0000
committerRoland McGrath <roland@gnu.org>2005-02-22 22:51:17 +0000
commita2274a083886991627cab87ca323296a97f631be (patch)
tree5ff7c3b13238a5368260cf2277f2b33d322e7aca
parent61a4f6fb43e7c66d7785b290b9dfa93c1ad24e1d (diff)
downloadglibc-a2274a083886991627cab87ca323296a97f631be.tar.gz
glibc-a2274a083886991627cab87ca323296a97f631be.tar.xz
glibc-a2274a083886991627cab87ca323296a97f631be.zip
* include/sys/socket.h: Declare __recv.
	* sysdeps/generic/recv.c (recv): Rename to __recv, and add weak alias.
	* sysdeps/mach/hurd/recv.c: Likewise.

	* sysdeps/unix/sysv/linux/libc_fatal.c: Include <execinfo.h> for
	__backtrace_* decls.

	* sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
	(INTERNAL_SYSCALL_ERROR_P): Evalute VAL.  Parenthesize ERR.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h: Likewise.

	* include/signal.h: Include <string.h> for memset decl.
-rw-r--r--ChangeLog15
-rw-r--r--include/signal.h1
-rw-r--r--include/sys/socket.h8
-rw-r--r--sysdeps/generic/recv.c6
-rw-r--r--sysdeps/mach/hurd/recv.c6
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h4
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h6
7 files changed, 35 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index f96df0257b..da351f3479 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2005-02-22  Roland McGrath  <roland@redhat.com>
+
+	* include/sys/socket.h: Declare __recv.
+	* sysdeps/generic/recv.c (recv): Rename to __recv, and add weak alias.
+	* sysdeps/mach/hurd/recv.c: Likewise.
+
+	* sysdeps/unix/sysv/linux/libc_fatal.c: Include <execinfo.h> for
+	__backtrace_* decls.
+
+	* sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
+	(INTERNAL_SYSCALL_ERROR_P): Evalute VAL.  Parenthesize ERR.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h: Likewise.
+
+	* include/signal.h: Include <string.h> for memset decl.
+
 2005-02-22  Andreas Schwab  <schwab@suse.de>
 
 	* posix/execvp.c (execvp): Fix invalid free.
diff --git a/include/signal.h b/include/signal.h
index dc1e0a12e5..5f07844f6a 100644
--- a/include/signal.h
+++ b/include/signal.h
@@ -50,6 +50,7 @@ extern int __xpg_sigpause (int sig);
 
 /* Simplified sigemptyset() implementation without the parameter checking.  */
 #undef __sigemptyset
+#include <string.h>
 #define __sigemptyset(ss) (memset (ss, '\0', sizeof (sigset_t)), 0)
 
 
diff --git a/include/sys/socket.h b/include/sys/socket.h
index 937909a125..0a226726aa 100644
--- a/include/sys/socket.h
+++ b/include/sys/socket.h
@@ -59,6 +59,14 @@ extern int __connect (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len);
 extern int __connect_internal (int __fd, __CONST_SOCKADDR_ARG __addr,
 			       socklen_t __len) attribute_hidden;
 
+/* Read N bytes into BUF from socket FD.
+   Returns the number read or -1 for errors.
+
+   This function is a cancellation point and therefore not marked with
+   __THROW.  */
+extern ssize_t __recv (int __fd, void *__buf, size_t __n, int __flags)
+     attribute_hidden;
+
 /* Send N bytes of BUF on socket FD to peer at address ADDR (which is
    ADDR_LEN bytes long).  Returns the number sent, or -1 for errors.  */
 extern ssize_t __libc_sendto (int __fd, __const void *__buf, size_t __n,
diff --git a/sysdeps/generic/recv.c b/sysdeps/generic/recv.c
index 9c28b4b306..62af8fedf2 100644
--- a/sysdeps/generic/recv.c
+++ b/sysdeps/generic/recv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1995, 1996, 1997, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1995,1996,1997,2001,2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -22,7 +22,7 @@
 /* Read N bytes into BUF from socket FD.
    Returns the number read or -1 for errors.  */
 ssize_t
-recv (fd, buf, n, flags)
+__recv (fd, buf, n, flags)
      int fd;
      void *buf;
      size_t n;
@@ -31,7 +31,7 @@ recv (fd, buf, n, flags)
   __set_errno (ENOSYS);
   return -1;
 }
-
+weak_alias (__recv, recv)
 
 stub_warning (recv)
 #include <stub-tag.h>
diff --git a/sysdeps/mach/hurd/recv.c b/sysdeps/mach/hurd/recv.c
index a2b8fd5be5..b001729d18 100644
--- a/sysdeps/mach/hurd/recv.c
+++ b/sysdeps/mach/hurd/recv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994, 1997, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1994,1997,2001,2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -26,9 +26,8 @@
 /* Read N bytes into BUF from socket FD.
    Returns the number read or -1 for errors.  */
 
-/* XXX should be __recv ? */
 ssize_t
-recv (fd, buf, n, flags)
+__recv (fd, buf, n, flags)
      int fd;
      void *buf;
      size_t n;
@@ -62,3 +61,4 @@ recv (fd, buf, n, flags)
 
   return nread;
 }
+weak_alias (__recv, recv)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
index 2ee3e60229..81f37c5103 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992,1997-2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1992,1997-2003,2004,2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -109,7 +109,7 @@
 
 # undef INTERNAL_SYSCALL_ERROR_P
 # define INTERNAL_SYSCALL_ERROR_P(val, err) \
-  (__builtin_expect (err & (1 << 28), 0))
+  ((void) (val), __builtin_expect ((err) & (1 << 28), 0))
 
 # undef INTERNAL_SYSCALL_ERRNO
 # define INTERNAL_SYSCALL_ERRNO(val, err)     (val)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h
index 38a376fa90..17bfa9014f 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h
@@ -1,5 +1,5 @@
-/* Copyright (C) 1992, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
-   Free Software Foundation, Inc.
+/* Copyright (C) 1992,1997,1998,1999,2000,2001,2002,2003,2004,2005
+	Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -122,7 +122,7 @@
 
 #undef INTERNAL_SYSCALL_ERROR_P
 #define INTERNAL_SYSCALL_ERROR_P(val, err) \
-  (__builtin_expect (err & (1 << 28), 0))
+  ((void) (err), __builtin_expect ((err) & (1 << 28), 0))
 
 #undef INTERNAL_SYSCALL_ERRNO
 #define INTERNAL_SYSCALL_ERRNO(val, err)     (val)