about summary refs log tree commit diff
path: root/socket
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2008-12-03 04:23:18 +0000
committerUlrich Drepper <drepper@redhat.com>2008-12-03 04:23:18 +0000
commitf93fc0b75a50d3ba8d4d69313e3c84ac0b62905b (patch)
tree4199d6969f17f2e0c78e46383bd1fcfe7a2cf06f /socket
parent9744268c10e9ddea5972aa50ac9bf7f778bbf7e7 (diff)
downloadglibc-f93fc0b75a50d3ba8d4d69313e3c84ac0b62905b.tar.gz
glibc-f93fc0b75a50d3ba8d4d69313e3c84ac0b62905b.tar.xz
glibc-f93fc0b75a50d3ba8d4d69313e3c84ac0b62905b.zip
* socket/sys/socket.h: Declare accept4.
	* socket/accept4.c: New file.
	* sysdeps/unix/sysv/linux/accept4.c: New file.
	* sysdeps/unix/sysv/linux/i386/accept4.S: New file.
	* socket/Makefile (routines): Add accept4.
	* socket/Versions: Export accept4 with version GLIBC_2.10.
	* socket/paccept.c: Removed.
	* sysdeps/unix/sysv/linux/paccept.c: Removed.
	* sysdeps/unix/sysv/linux/i386/paccept.S: Removed.
	* Versions.def: Define GLIBC_2.10 for libc.
	* sysdeps/unix/sysv/linux/kernel-features.h: Define __ASSUME_ACCEPT4.

	* nscd/connections.c: Use accept4.

	* sysdeps/unix/sysv/linux/i386/socket.S: Fix comment.
Diffstat (limited to 'socket')
-rw-r--r--socket/Makefile2
-rw-r--r--socket/Versions3
-rw-r--r--socket/accept4.c (renamed from socket/paccept.c)11
-rw-r--r--socket/sys/socket.h9
4 files changed, 18 insertions, 7 deletions
diff --git a/socket/Makefile b/socket/Makefile
index 92a87079e3..0e242b579c 100644
--- a/socket/Makefile
+++ b/socket/Makefile
@@ -27,7 +27,7 @@ headers	:= sys/socket.h sys/un.h bits/sockaddr.h bits/socket.h \
 routines := accept bind connect getpeername getsockname getsockopt	\
 	    listen recv recvfrom recvmsg send sendmsg sendto		\
 	    setsockopt shutdown socket socketpair isfdtype opensock	\
-	    sockatmark
+	    sockatmark accept4
 
 aux	 := have_sock_cloexec
 
diff --git a/socket/Versions b/socket/Versions
index d282eff79e..7a96b1e934 100644
--- a/socket/Versions
+++ b/socket/Versions
@@ -31,4 +31,7 @@ libc {
     # Addition from P1003.1-200x
     sockatmark;
   }
+  GLIBC_2.10 {
+    accept4;
+  }
 }
diff --git a/socket/paccept.c b/socket/accept4.c
index 777dd8c300..40709d5704 100644
--- a/socket/paccept.c
+++ b/socket/accept4.c
@@ -23,21 +23,20 @@
    When a connection arrives, open a new socket to communicate with it,
    set *ADDR (which is *ADDR_LEN bytes long) to the address of the connecting
    peer and *ADDR_LEN to the address's actual length, and return the
-   new socket's descriptor, or -1 for errors.  SS is installed as
-   the thread's signal mask and FLAGS are additional flags.  */
+   new socket's descriptor, or -1 for errors.  The operation can be influenced
+   by the FLAGS parameter.  */
 int
-paccept (fd, addr, addr_len, ss, flags)
+accept4 (fd, addr, addr_len, flags)
      int fd;
      __SOCKADDR_ARG addr;
      socklen_t *addr_len;
-     const __sigset_t *ss;
      int flags;
 {
   __set_errno (ENOSYS);
   return -1;
 }
-libc_hidden_def (paccept)
+libc_hidden_def (accept4)
 
 
-stub_warning (paccept)
+stub_warning (accept4)
 #include <stub-tag.h>
diff --git a/socket/sys/socket.h b/socket/sys/socket.h
index e0a6a5216a..9b1f56f8b0 100644
--- a/socket/sys/socket.h
+++ b/socket/sys/socket.h
@@ -214,6 +214,15 @@ extern int listen (int __fd, int __n) __THROW;
 extern int accept (int __fd, __SOCKADDR_ARG __addr,
 		   socklen_t *__restrict __addr_len);
 
+#ifdef __USE_GNU
+/* Similar to 'accept' but takes an additional parameter to specify flags.
+
+   This function is a cancellation point and therefore not marked with
+   __THROW.  */
+extern int accept4 (int __fd, __SOCKADDR_ARG __addr,
+		    socklen_t *__restrict __addr_len, int __flags);
+#endif
+
 /* Shut down all or part of the connection open on socket FD.
    HOW determines what to shut down:
      SHUT_RD   = No more receptions;