diff options
| author | Ulrich Drepper <drepper@redhat.com> | 2004-12-22 20:10:10 +0000 |
|---|---|---|
| committer | Ulrich Drepper <drepper@redhat.com> | 2004-12-22 20:10:10 +0000 |
| commit | a334319f6530564d22e775935d9c91663623a1b4 (patch) | |
| tree | b5877475619e4c938e98757d518bb1e9cbead751 /socket | |
| parent | 0ecb606cb6cf65de1d9fc8a919bceb4be476c602 (diff) | |
| download | glibc-a334319f6530564d22e775935d9c91663623a1b4.tar.xz glibc-a334319f6530564d22e775935d9c91663623a1b4.zip | |
(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
Diffstat (limited to 'socket')
| -rw-r--r-- | socket/Makefile | 4 | ||||
| -rw-r--r-- | socket/accept.c | 40 | ||||
| -rw-r--r-- | socket/bind.c | 36 | ||||
| -rw-r--r-- | socket/bits/socket2.h | 56 | ||||
| -rw-r--r-- | socket/connect.c | 38 | ||||
| -rw-r--r-- | socket/getpeername.c | 36 | ||||
| -rw-r--r-- | socket/getsockname.c | 36 | ||||
| -rw-r--r-- | socket/getsockopt.c | 38 | ||||
| -rw-r--r-- | socket/isfdtype.c | 31 | ||||
| -rw-r--r-- | socket/listen.c | 37 | ||||
| -rw-r--r-- | socket/opensock.c | 71 | ||||
| -rw-r--r-- | socket/recv.c | 37 | ||||
| -rw-r--r-- | socket/recvfrom.c | 41 | ||||
| -rw-r--r-- | socket/recvmsg.c | 37 | ||||
| -rw-r--r-- | socket/send.c | 37 | ||||
| -rw-r--r-- | socket/sendmsg.c | 37 | ||||
| -rw-r--r-- | socket/sendto.c | 40 | ||||
| -rw-r--r-- | socket/setsockopt.c | 40 | ||||
| -rw-r--r-- | socket/shutdown.c | 39 | ||||
| -rw-r--r-- | socket/sockatmark.c | 33 | ||||
| -rw-r--r-- | socket/socket.c | 38 | ||||
| -rw-r--r-- | socket/socketpair.c | 39 | ||||
| -rw-r--r-- | socket/sys/socket.h | 8 |
23 files changed, 3 insertions, 846 deletions
diff --git a/socket/Makefile b/socket/Makefile index aa0776e5bf..594e609db5 100644 --- a/socket/Makefile +++ b/socket/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 1991,1995-2001,2005 Free Software Foundation, Inc. +# Copyright (C) 1991,95,96,97,98,99,2000,2001 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 @@ subdir := socket headers := sys/socket.h sys/un.h bits/sockaddr.h bits/socket.h \ - bits/socket2.h sys/socketvar.h net/if.h + sys/socketvar.h net/if.h routines := accept bind connect getpeername getsockname getsockopt \ listen recv recvfrom recvmsg send sendmsg sendto \ diff --git a/socket/accept.c b/socket/accept.c deleted file mode 100644 index dad34ceddd..0000000000 --- a/socket/accept.c +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright (C) 1991, 1995, 1996, 1997, 2002 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 <errno.h> -#include <sys/socket.h> - -/* 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. */ -int -accept (fd, addr, addr_len) - int fd; - __SOCKADDR_ARG addr; - socklen_t *addr_len; -{ - __set_errno (ENOSYS); - return -1; -} -libc_hidden_def (accept) - - -stub_warning (accept) -#include <stub-tag.h> diff --git a/socket/bind.c b/socket/bind.c deleted file mode 100644 index 382e29db16..0000000000 --- a/socket/bind.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright (C) 1991, 1995, 1996, 1997, 2002 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 <errno.h> -#include <sys/socket.h> - -/* Give the socket FD the local address ADDR (which is LEN bytes long). */ -int -__bind (fd, addr, len) - int fd; - __CONST_SOCKADDR_ARG addr; - socklen_t len; -{ - __set_errno (ENOSYS); - return -1; -} - -weak_alias (__bind, bind) - -stub_warning (bind) -#include <stub-tag.h> diff --git a/socket/bits/socket2.h b/socket/bits/socket2.h deleted file mode 100644 index 2543ea37d4..0000000000 --- a/socket/bits/socket2.h +++ /dev/null @@ -1,56 +0,0 @@ -/* Checking macros for socket functions. - Copyright (C) 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 - 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. */ - -#ifndef _SYS_SOCKET_H -# error "Never include <bits/socket2.h> directly; use <sys/socket.h> instead." -#endif - -extern ssize_t __recv_chk (int __fd, void *__buf, size_t __n, size_t __buflen, - int __flags); -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 - && (!__builtin_constant_p (__n) || __n > __bos0 (__buf))) - return __recv_chk (__fd, __buf, __n, __bos0 (__buf), __flags); - return __recv_alias (__fd, __buf, __n, __flags); -} - -extern ssize_t __recvfrom_chk (int __fd, void *__restrict __buf, size_t __n, - size_t __buflen, int __flags, - __SOCKADDR_ARG __addr, - socklen_t *__restrict __addr_len); -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 *__restrict __buf, size_t __n, int __flags, - __SOCKADDR_ARG __addr, socklen_t *__restrict __addr_len) -{ - if (__bos0 (__buf) != (size_t) -1 - && (!__builtin_constant_p (__n) || __n > __bos0 (__buf))) - return __recvfrom_chk (__fd, __buf, __n, __bos0 (__buf), __flags, - __addr, __addr_len); - return __recvfrom_alias (__fd, __buf, __n, __flags, __addr, __addr_len); -} diff --git a/socket/connect.c b/socket/connect.c deleted file mode 100644 index 55093313c9..0000000000 --- a/socket/connect.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (C) 1991, 1995, 1996, 1997 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 <errno.h> -#include <sys/socket.h> - -/* Open a connection on socket FD to peer at ADDR (which LEN bytes long). - For connectionless socket types, just set the default address to send to - and the only address from which to accept transmissions. - Return 0 on success, -1 for errors. */ -int -__connect (fd, addr, len) - int fd; - __CONST_SOCKADDR_ARG addr; - socklen_t len; -{ - __set_errno (ENOSYS); - return -1; -} -weak_alias (__connect, connect) - -stub_warning (connect) -#include <stub-tag.h> diff --git a/socket/getpeername.c b/socket/getpeername.c deleted file mode 100644 index 6507387bd1..0000000000 --- a/socket/getpeername.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright (C) 1991, 1995, 1996, 1997 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 <errno.h> -#include <sys/socket.h> - -/* Put the address of the peer connected to socket FD into *ADDR - (which is *LEN bytes long), and its actual length into *LEN. */ -int -getpeername (fd, addr, len) - int fd; - __SOCKADDR_ARG addr; - socklen_t *len; -{ - __set_errno (ENOSYS); - return -1; -} - - -stub_warning (getpeername) -#include <stub-tag.h> diff --git a/socket/getsockname.c b/socket/getsockname.c deleted file mode 100644 index b698bdbb7a..0000000000 --- a/socket/getsockname.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright (C) 1991, 1995, 1996, 1997, 2002 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 <errno.h> -#include <sys/socket.h> - -/* Put the local address of FD into *ADDR and its length in *LEN. */ -int -__getsockname (fd, addr, len) - int fd; - __SOCKADDR_ARG addr; - socklen_t *len; -{ - __set_errno (ENOSYS); - return -1; -} - -weak_alias (__getsockname, getsockname) - -stub_warning (getsockname) -#include <stub-tag.h> diff --git a/socket/getsockopt.c b/socket/getsockopt.c deleted file mode 100644 index 8f4fa89578..0000000000 --- a/socket/getsockopt.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (C) 1991, 1995, 1996, 1997 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 <errno.h> -#include <sys/socket.h> - -/* Put the current value for socket FD's option OPTNAME at protocol level LEVEL - into OPTVAL (which is *OPTLEN bytes long), and set *OPTLEN to the value's - actual length. Returns 0 on success, -1 for errors. */ -int -getsockopt (fd, level, optname, optval, optlen) - int fd; - int level; - int optname; - void *optval; - socklen_t *optlen; -{ - __set_errno (ENOSYS); - return -1; -} - -stub_warning (getsockopt) -#include <stub-tag.h> diff --git a/socket/isfdtype.c b/socket/isfdtype.c deleted file mode 100644 index ba10912c9f..0000000000 --- a/socket/isfdtype.c +++ /dev/null @@ -1,31 +0,0 @@ -/* isfdtype - Determine whether descriptor has given property. Stub version. - Copyright (C) 1996, 1997 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 <errno.h> -#include <sys/stat.h> - - -int -isfdtype (int fildes, int fdtype) -{ - __set_errno (ENOSYS); - return -1; -} -stub_warning (isfdtype) -#include <stub-tag.h> diff --git a/socket/listen.c b/socket/listen.c deleted file mode 100644 index cbdd8b9d18..0000000000 --- a/socket/listen.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (C) 1991,1995,1996,1997,2001,2002 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 <errno.h> -#include <sys/socket.h> - -/* Prepare to accept connections on socket FD. - N connection requests will be queued before further requests are refused. - Returns 0 on success, -1 for errors. */ -int -__listen (fd, n) - int fd; - int n; -{ - __set_errno (ENOSYS); - return -1; -} - -weak_alias (__listen, listen) - -stub_warning (listen) -#include <stub-tag.h> diff --git a/socket/opensock.c b/socket/opensock.c deleted file mode 100644 index 4a4d5dd385..0000000000 --- a/socket/opensock.c +++ /dev/null @@ -1,71 +0,0 @@ -/* Copyright (C) 1999 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 <stdio.h> -#include <sys/socket.h> -#include <bits/libc-lock.h> - -/* Return a socket of any type. The socket can be used in subsequent - ioctl calls to talk to the kernel. */ -int internal_function -__opensock (void) -{ - /* Cache the last AF that worked, to avoid many redundant calls to - socket(). */ - static int sock_af = -1; - int fd = -1; - __libc_lock_define_initialized (static, lock); - - if (sock_af != -1) - { - fd = __socket (sock_af, SOCK_DGRAM, 0); - if (fd != -1) - return fd; - } - - __libc_lock_lock (lock); - - if (sock_af != -1) - fd = __socket (sock_af, SOCK_DGRAM, 0); - - if (fd == -1) - { -#ifdef AF_INET - fd = __socket (sock_af = AF_INET, SOCK_DGRAM, 0); -#endif -#ifdef AF_INET6 - if (fd < 0) - fd = __socket (sock_af = AF_INET6, SOCK_DGRAM, 0); -#endif -#ifdef AF_IPX - if (fd < 0) - fd = __socket (sock_af = AF_IPX, SOCK_DGRAM, 0); -#endif -#ifdef AF_AX25 - if (fd < 0) - fd = __socket (sock_af = AF_AX25, SOCK_DGRAM, 0); -#endif -#ifdef AF_APPLETALK - if (fd < 0) - fd = __socket (sock_af = AF_APPLETALK, SOCK_DGRAM, 0); -#endif - } - - __libc_lock_unlock (lock); - return fd; -} diff --git a/socket/recv.c b/socket/recv.c deleted file mode 100644 index 62af8fedf2..0000000000 --- a/socket/recv.c +++ /dev/null @@ -1,37 +0,0 @@ -/* 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 - 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 <errno.h> -#include <sys/socket.h> - -/ |
