diff options
author | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2009-06-24 16:26:34 +0000 |
---|---|---|
committer | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2009-06-24 16:26:34 +0000 |
commit | 0c0eed75570abfa84c7cebbbe4b2dd14492db0a8 (patch) | |
tree | b61aa9fb0ab9b47e63f5d16c5fa8cb6e823c9bdf /libc/sysdeps/unix/sysv | |
parent | 257ea412cd5f858b64148bef99d4bd6b882c4fb1 (diff) | |
download | eglibc2-0c0eed75570abfa84c7cebbbe4b2dd14492db0a8.tar.gz |
Merge changes between r8519 and r8594 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@8595 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/sysdeps/unix/sysv')
-rw-r--r-- | libc/sysdeps/unix/sysv/linux/bits/socket.h | 6 | ||||
-rw-r--r-- | libc/sysdeps/unix/sysv/linux/grantpt.c | 81 | ||||
-rw-r--r-- | libc/sysdeps/unix/sysv/linux/libc_fatal.c | 18 | ||||
-rw-r--r-- | libc/sysdeps/unix/sysv/linux/net/if_arp.h | 4 | ||||
-rw-r--r-- | libc/sysdeps/unix/sysv/linux/sparc/bits/socket.h | 16 |
5 files changed, 38 insertions, 87 deletions
diff --git a/libc/sysdeps/unix/sysv/linux/bits/socket.h b/libc/sysdeps/unix/sysv/linux/bits/socket.h index 88062e59a..f23b338a3 100644 --- a/libc/sysdeps/unix/sysv/linux/bits/socket.h +++ b/libc/sysdeps/unix/sysv/linux/bits/socket.h @@ -1,5 +1,5 @@ /* System-specific socket constants and types. Linux version. - Copyright (C) 1991, 1992, 1994-2001, 2004, 2006, 2007, 2008 + Copyright (C) 1991, 1992, 1994-2001, 2004, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -108,7 +108,8 @@ enum __socket_type #define PF_RXRPC 33 /* RxRPC sockets. */ #define PF_ISDN 34 /* mISDN sockets. */ #define PF_PHONET 35 /* Phonet sockets. */ -#define PF_MAX 36 /* For now.. */ +#define PF_IEEE802154 36 /* IEEE 802.15.4 sockets. */ +#define PF_MAX 37 /* For now.. */ /* Address families. */ #define AF_UNSPEC PF_UNSPEC @@ -148,6 +149,7 @@ enum __socket_type #define AF_RXRPC PF_RXRPC #define AF_ISDN PF_ISDN #define AF_PHONET PF_PHONET +#define AF_IEEE802154 PF_IEEE802154 #define AF_MAX PF_MAX /* Socket level values. Others are defined in the appropriate headers. diff --git a/libc/sysdeps/unix/sysv/linux/grantpt.c b/libc/sysdeps/unix/sysv/linux/grantpt.c deleted file mode 100644 index b894b8b63..000000000 --- a/libc/sysdeps/unix/sysv/linux/grantpt.c +++ /dev/null @@ -1,81 +0,0 @@ -/* Copyright (C) 1998, 1999, 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 <fcntl.h> -#include <limits.h> -#include <stdlib.h> -#include <sys/statfs.h> - -#include "linux_fsinfo.h" - -/* Prototype for function that changes ownership and access permission - for slave pseudo terminals that do not live on a `devpts' - filesystem. */ -static int __unix_grantpt (int fd); - -/* Prototype for private function that gets the name of the slave - pseudo terminal in a safe way. */ -static int pts_name (int fd, char **pts, size_t buf_len); - -/* Change the ownership and access permission of the slave pseudo - terminal associated with the master pseudo terminal specified - by FD. */ -int -grantpt (int fd) -{ - struct statfs fsbuf; -#ifdef PATH_MAX - char _buf[PATH_MAX]; -#else - char _buf[512]; -#endif - char *buf = _buf; - - if (__builtin_expect (pts_name (fd, &buf, sizeof (_buf)), 0)) - { - int save_errno = errno; - - /* Check, if the file descriptor is valid. pts_name returns the - wrong errno number, so we cannot use that. */ - if (__libc_fcntl (fd, F_GETFD) == -1 && errno == EBADF) - return -1; - - /* If the filedescriptor is no TTY, grantpt has to set errno - to EINVAL. */ - if (save_errno == ENOTTY) - __set_errno (EINVAL); - else - __set_errno (save_errno); - - return -1; - } - - if (__statfs (buf, &fsbuf) < 0) - return -1; - - /* If the slave pseudo terminal lives on a `devpts' filesystem, the - ownership and access permission are already set. */ - if (fsbuf.f_type == DEVPTS_SUPER_MAGIC || fsbuf.f_type == DEVFS_SUPER_MAGIC) - return 0; - - return __unix_grantpt (fd); -} - -#define grantpt static __unix_grantpt -#include <sysdeps/unix/grantpt.c> diff --git a/libc/sysdeps/unix/sysv/linux/libc_fatal.c b/libc/sysdeps/unix/sysv/linux/libc_fatal.c index 8d37f1ad0..4206bb206 100644 --- a/libc/sysdeps/unix/sysv/linux/libc_fatal.c +++ b/libc/sysdeps/unix/sysv/linux/libc_fatal.c @@ -1,4 +1,5 @@ -/* Copyright (C) 1993-1995,1997,2000,2002-2005 Free Software Foundation, Inc. +/* Copyright (C) 1993-1995,1997,2000,2002-2005,2009 + 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 @@ -16,6 +17,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#include <atomic.h> #include <errno.h> #include <fcntl.h> #include <paths.h> @@ -132,6 +134,20 @@ __libc_message (int do_abort, const char *fmt, ...) if (cnt == total) written = true; + + char *buf = do_abort ? malloc (total + 1) : NULL; + if (buf != NULL) + { + char *wp = buf; + for (int cnt = 0; cnt < nlist; ++cnt) + wp = mempcpy (wp, iov[cnt].iov_base, iov[cnt].iov_len); + *wp = '\0'; + + /* We have to free the old buffer since the application might + catch the SIGABRT signal. */ + char *old = atomic_exchange_acq (&__abort_msg, buf); + free (old); + } } va_end (ap); diff --git a/libc/sysdeps/unix/sysv/linux/net/if_arp.h b/libc/sysdeps/unix/sysv/linux/net/if_arp.h index 9608652ee..97cb61f62 100644 --- a/libc/sysdeps/unix/sysv/linux/net/if_arp.h +++ b/libc/sysdeps/unix/sysv/linux/net/if_arp.h @@ -1,5 +1,5 @@ /* Definitions for Address Resolution Protocol. - Copyright (C) 1997,1999,2001,2006 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2001,2006,2009 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -128,6 +128,8 @@ struct arphdr #define ARPHRD_IEEE80211 801 /* IEEE 802.11. */ #define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header. */ #define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header. */ +#define ARPHRD_IEEE802154 804 /* IEEE 802.15.4 header. */ +#define ARPHRD_IEEE802154_PHY 805 /* IEEE 802.15.4 PHY header. */ #define ARPHRD_VOID 0xFFFF /* Void type, nothing is known. */ #define ARPHRD_NONE 0xFFFE /* Zero header length. */ diff --git a/libc/sysdeps/unix/sysv/linux/sparc/bits/socket.h b/libc/sysdeps/unix/sysv/linux/sparc/bits/socket.h index d43a3cdf7..a14807209 100644 --- a/libc/sysdeps/unix/sysv/linux/sparc/bits/socket.h +++ b/libc/sysdeps/unix/sysv/linux/sparc/bits/socket.h @@ -1,5 +1,5 @@ /* System-specific socket constants and types. Linux/SPARC version. - Copyright (C) 1991, 1992, 1994-2001, 2004, 2006, 2007, 2008 + Copyright (C) 1991, 1992, 1994-2001, 2004, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -94,15 +94,21 @@ enum __socket_type #define PF_ASH 18 /* Ash. */ #define PF_ECONET 19 /* Acorn Econet. */ #define PF_ATMSVC 20 /* ATM SVCs. */ +#define PF_RDS 21 /* RDS sockets. */ #define PF_SNA 22 /* Linux SNA Project */ #define PF_IRDA 23 /* IRDA sockets. */ #define PF_PPPOX 24 /* PPPoX sockets. */ #define PF_WANPIPE 25 /* Wanpipe API sockets. */ +#define PF_LLC 26 /* Linux LLC. */ +#define PF_CAN 29 /* Controller Area Network. */ +#define PF_TIPC 30 /* TIPC sockets. */ #define PF_BLUETOOTH 31 /* Bluetooth sockets. */ #define PF_IUCV 32 /* IUCV sockets. */ #define PF_RXRPC 33 /* RxRPC sockets. */ #define PF_ISDN 34 /* mISDN sockets. */ -#define PF_MAX 35 /* For now.. */ +#define PF_PHONET 35 /* Phonet sockets. */ +#define PF_IEEE802154 36 /* IEEE 802.15.4 sockets. */ +#define PF_MAX 37 /* For now.. */ /* Address families. */ #define AF_UNSPEC PF_UNSPEC @@ -129,14 +135,20 @@ enum __socket_type #define AF_ASH PF_ASH #define AF_ECONET PF_ECONET #define AF_ATMSVC PF_ATMSVC +#define AF_RDS PF_RDS #define AF_SNA PF_SNA #define AF_IRDA PF_IRDA #define AF_PPPOX PF_PPPOX #define AF_WANPIPE PF_WANPIPE +#define AF_LLC PF_LLC +#define AF_CAN PF_CAN +#define AF_TIPC PF_TIPC #define AF_BLUETOOTH PF_BLUETOOTH #define AF_IUCV PF_IUCV #define AF_RXRPC PF_RXRPC #define AF_ISDN PF_ISDN +#define AF_PHONET PF_PHONET +#define AF_IEEE802154 PF_IEEE802154 #define AF_MAX PF_MAX /* Socket level values. Others are defined in the appropriate headers. |