From c7045198ca8f4ff5b97205340d51127f8503c2bd Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 28 Jul 2008 23:34:19 +0000 Subject: Updated to fedora-glibc-20080728T2320 --- socket/Makefile | 6 ++++-- socket/Versions | 3 +++ socket/have_sock_cloexec.c | 24 ++++++++++++++++++++++++ socket/paccept.c | 43 +++++++++++++++++++++++++++++++++++++++++++ socket/sys/socket.h | 18 +++++++++++++++++- 5 files changed, 91 insertions(+), 3 deletions(-) create mode 100644 socket/have_sock_cloexec.c create mode 100644 socket/paccept.c (limited to 'socket') diff --git a/socket/Makefile b/socket/Makefile index aa0776e5bf..e7fa589e65 100644 --- a/socket/Makefile +++ b/socket/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 1991,1995-2001,2005 Free Software Foundation, Inc. +# Copyright (C) 1991,1995-2001,2005,2008 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 @@ -27,7 +27,9 @@ 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 paccept + +aux := have_sock_cloexec distribute := ifreq.h diff --git a/socket/Versions b/socket/Versions index d282eff79e..9764227c36 100644 --- a/socket/Versions +++ b/socket/Versions @@ -31,4 +31,7 @@ libc { # Addition from P1003.1-200x sockatmark; } + GLIBC_2.9 { + paccept; + } } diff --git a/socket/have_sock_cloexec.c b/socket/have_sock_cloexec.c new file mode 100644 index 0000000000..22dccdf722 --- /dev/null +++ b/socket/have_sock_cloexec.c @@ -0,0 +1,24 @@ +/* Copyright (C) 2008 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 + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#include + +#if defined SOCK_CLOEXEC && !defined __ASSUME_SOCK_CLOEXEC +int __have_sock_cloexec; +#endif diff --git a/socket/paccept.c b/socket/paccept.c new file mode 100644 index 0000000000..777dd8c300 --- /dev/null +++ b/socket/paccept.c @@ -0,0 +1,43 @@ +/* Copyright (C) 2008 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 + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#include + +/* Await a connection on socket FD. + 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. */ +int +paccept (fd, addr, addr_len, ss, 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) + + +stub_warning (paccept) +#include diff --git a/socket/sys/socket.h b/socket/sys/socket.h index 6d9eab7f94..ea4123d287 100644 --- a/socket/sys/socket.h +++ b/socket/sys/socket.h @@ -1,5 +1,5 @@ /* Declarations of socket constants, types, and functions. - Copyright (C) 1991,92,1994-2001,2003,2005,2007 + Copyright (C) 1991,92,1994-2001,2003,2005,2007,2008 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -28,6 +28,10 @@ __BEGIN_DECLS #include #define __need_size_t #include +#ifdef __USE_GNU +/* Get the __sigset_t definition. */ +# include +#endif /* This operating system-specific header file defines the SOCK_*, PF_*, @@ -210,6 +214,18 @@ extern int listen (int __fd, int __n) __THROW; extern int accept (int __fd, __SOCKADDR_ARG __addr, socklen_t *__restrict __addr_len); +#ifdef __USE_GNU +/* Variant of the accept function which takes additional parameters. The + MASK parameter allows to change the thread signal mask for the duration + of the call. The FLAGS parameter allows to pass additional flags. + + This function is a cancellation point and therefore not marked with + __THROW. */ +extern int paccept (int __fd, __SOCKADDR_ARG __addr, + socklen_t *__restrict __addr_len, + __const __sigset_t *__restrict __ss, 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; -- cgit v1.2.3