aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-12-12 18:13:35 +0000
committerJakub Jelinek <jakub@redhat.com>2007-12-12 18:13:35 +0000
commit574e283890a6ca92325a06dafa76ff307a8019a2 (patch)
tree055e44e24a55fb4863e5d9cdc04e320cde52ffe9 /sysdeps/unix
parenta162e5955f7e324be82d9318bbcbe869c66ffb86 (diff)
downloadglibc-574e283890a6ca92325a06dafa76ff307a8019a2.zip
glibc-574e283890a6ca92325a06dafa76ff307a8019a2.tar.gz
glibc-574e283890a6ca92325a06dafa76ff307a8019a2.tar.bz2
Updated to fedora-glibc-20071212T1051
Diffstat (limited to 'sysdeps/unix')
-rw-r--r--sysdeps/unix/sysv/linux/Makefile6
-rw-r--r--sysdeps/unix/sysv/linux/adjtime.c24
-rw-r--r--sysdeps/unix/sysv/linux/bits/sched.h56
-rw-r--r--sysdeps/unix/sysv/linux/check_native.c172
-rw-r--r--sysdeps/unix/sysv/linux/check_pf.c124
-rw-r--r--sysdeps/unix/sysv/linux/i386/makecontext.S16
-rw-r--r--sysdeps/unix/sysv/linux/ia64/syscalls.list3
-rw-r--r--sysdeps/unix/sysv/linux/kernel-features.h5
-rw-r--r--sysdeps/unix/sysv/linux/netiucv/iucv.h39
-rw-r--r--sysdeps/unix/sysv/linux/nscd_setup_thread.c8
-rw-r--r--sysdeps/unix/sysv/linux/open64.c23
-rw-r--r--sysdeps/unix/sysv/linux/open64_2.c32
-rw-r--r--sysdeps/unix/sysv/linux/opensock.c7
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list2
-rw-r--r--sysdeps/unix/sysv/linux/readahead.c8
-rw-r--r--sysdeps/unix/sysv/linux/s390/opensock.c2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list3
-rw-r--r--sysdeps/unix/sysv/linux/s390/sa_len.c2
-rw-r--r--sysdeps/unix/sysv/linux/sa_len.c7
-rw-r--r--sysdeps/unix/sysv/linux/sys/epoll.h4
-rw-r--r--sysdeps/unix/sysv/linux/sys/signalfd.h2
-rw-r--r--sysdeps/unix/sysv/linux/sys/timex.h3
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/aio_read.c7
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/aio_read64.c1
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/aio_write.c7
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/aio_write64.c1
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/creat64.c1
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/getdirentries.c3
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/getdirentries64.c1
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/lio_listio.c13
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/lio_listio64.c1
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/open64.c1
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/openat.c16
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/openat64.c1
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/syscalls.list4
35 files changed, 456 insertions, 149 deletions
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 6ba3a25..5f32d1a 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -25,7 +25,7 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \
sys/quota.h sys/fsuid.h \
scsi/sg.h scsi/scsi.h scsi/scsi_ioctl.h sys/pci.h \
sys/ultrasound.h sys/raw.h sys/personality.h sys/epoll.h \
- bits/a.out.h sys/inotify.h
+ bits/a.out.h sys/inotify.h sys/signalfd.h sys/eventfd.h
install-others += $(inst_includedir)/bits/syscall.h
@@ -122,7 +122,7 @@ ifeq ($(subdir),inet)
sysdep_headers += netinet/if_fddi.h netinet/if_tr.h \
netipx/ipx.h netash/ash.h netax25/ax25.h netatalk/at.h \
netrom/netrom.h netpacket/packet.h netrose/rose.h \
- neteconet/ec.h
+ neteconet/ec.h netiucv/iucv.h
endif
# Don't compile the ctype glue code, since there is no old non-GNU C library.
@@ -138,7 +138,7 @@ endif
ifeq ($(subdir),io)
sysdep_routines += xstatconv internal_statvfs internal_statvfs64 \
- sync_file_range open_2
+ sync_file_range open_2 open64_2
endif
ifeq ($(subdir),elf)
diff --git a/sysdeps/unix/sysv/linux/adjtime.c b/sysdeps/unix/sysv/linux/adjtime.c
index 38ef805..202bb14 100644
--- a/sysdeps/unix/sysv/linux/adjtime.c
+++ b/sysdeps/unix/sysv/linux/adjtime.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1996, 1997, 1998, 2002, 2004
+/* Copyright (C) 1995, 1996, 1997, 1998, 2002, 2004, 2007
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -22,6 +22,8 @@
#include <sys/time.h>
#include <sys/timex.h>
+#include <kernel-features.h>
+
#define MAX_SEC (INT_MAX / 1000000L - 2)
#define MIN_SEC (INT_MIN / 1000000L + 2)
@@ -69,13 +71,29 @@ ADJTIME (const struct TIMEVAL *itv, struct TIMEVAL *otv)
return -1;
}
tntx.offset = tmp.tv_usec + tmp.tv_sec * 1000000L;
+#ifdef ADJ_OFFSET_SS_READ
+ tntx.modes = ADJ_OFFSET_SS_READ;
+#else
tntx.modes = ADJ_OFFSET_SINGLESHOT;
+#endif
}
else
tntx.modes = 0;
- if (ADJTIMEX (&tntx) < 0)
- return -1;
+#if defined ADJ_OFFSET_SS_READ && !defined __ASSUME_ADJ_OFFSET_SS_READ
+ again:
+#endif
+ if (__builtin_expect (ADJTIMEX (&tntx) < 0, 0))
+ {
+#if defined ADJ_OFFSET_SS_READ && !defined __ASSUME_ADJ_OFFSET_SS_READ
+ if (itv && errno == EINVAL && tntx.modes == ADJ_OFFSET_SS_READ)
+ {
+ tntx.modes = ADJ_OFFSET_SINGLESHOT;
+ goto again;
+ }
+#endif
+ return -1;
+ }
if (otv)
{
diff --git a/sysdeps/unix/sysv/linux/bits/sched.h b/sysdeps/unix/sysv/linux/bits/sched.h
index 5eaa2fe..5387b9c 100644
--- a/sysdeps/unix/sysv/linux/bits/sched.h
+++ b/sysdeps/unix/sysv/linux/bits/sched.h
@@ -132,17 +132,21 @@ typedef struct
} while (0)
# endif
# define __CPU_SET_S(cpu, setsize, cpusetp) \
- ({ size_t __cpu = (cpu); \
- __cpu < 8 * (setsize) \
- ? ((cpusetp)->__bits[__CPUELT (__cpu)] |= __CPUMASK (__cpu)) : 0; })
+ (__extension__ \
+ ({ size_t __cpu = (cpu); \
+ __cpu < 8 * (setsize) \
+ ? ((cpusetp)->__bits[__CPUELT (__cpu)] |= __CPUMASK (__cpu)) : 0; }))
# define __CPU_CLR_S(cpu, setsize, cpusetp) \
- ({ size_t __cpu = (cpu); \
- __cpu < 8 * (setsize) \
- ? ((cpusetp)->__bits[__CPUELT (__cpu)] &= ~__CPUMASK (__cpu)) : 0; })
+ (__extension__ \
+ ({ size_t __cpu = (cpu); \
+ __cpu < 8 * (setsize) \
+ ? ((cpusetp)->__bits[__CPUELT (__cpu)] &= ~__CPUMASK (__cpu)) : 0; }))
# define __CPU_ISSET_S(cpu, setsize, cpusetp) \
- ({ size_t __cpu = (cpu); \
- __cpu < 8 * (setsize) \
- ? (((cpusetp)->__bits[__CPUELT (__cpu)] & __CPUMASK (__cpu))) != 0 : 0; })
+ (__extension__ \
+ ({ size_t __cpu = (cpu); \
+ __cpu < 8 * (setsize) \
+ ? (((cpusetp)->__bits[__CPUELT (__cpu)] & __CPUMASK (__cpu))) != 0 \
+ : 0; }))
# define __CPU_COUNT_S(setsize, cpusetp) \
__sched_cpucount (setsize, cpusetp)
@@ -152,25 +156,27 @@ typedef struct
(__builtin_memcmp (cpusetp1, cpusetp2, setsize) == 0)
# else
# define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \
- ({ cpu_set_t *__arr1 = (cpusetp1); \
- cpu_set_t *__arr2 = (cpusetp2); \
- size_t __imax = (setsize) / sizeof (__cpu_mask); \
- size_t __i; \
- for (__i = 0; __i < __imax; ++__i) \
- if (__arr1->__bits[__i] != __arr2->__bits[__i]) \
- break; \
- __i == __imax; })
+ (__extension__ \
+ ({ cpu_set_t *__arr1 = (cpusetp1); \
+ cpu_set_t *__arr2 = (cpusetp2); \
+ size_t __imax = (setsize) / sizeof (__cpu_mask); \
+ size_t __i; \
+ for (__i = 0; __i < __imax; ++__i) \
+ if (__arr1->__bits[__i] != __arr2->__bits[__i]) \
+ break; \
+ __i == __imax; }))
# endif
# define __CPU_OP_S(setsize, destset, srcset1, srcset2, op) \
- ({ cpu_set_t *__dest = (destset); \
- cpu_set_t *__arr1 = (srcset1); \
- cpu_set_t *__arr2 = (srcset2); \
- size_t __imax = (setsize) / sizeof (__cpu_mask); \
- size_t __i; \
- for (__i = 0; __i < __imax; ++__i) \
- __dest->__bits[__i] = __arr1->__bits[__i] op __arr2->__bits[__i]; \
- __dest; })
+ (__extension__ \
+ ({ cpu_set_t *__dest = (destset); \
+ cpu_set_t *__arr1 = (srcset1); \
+ cpu_set_t *__arr2 = (srcset2); \
+ size_t __imax = (setsize) / sizeof (__cpu_mask); \
+ size_t __i; \
+ for (__i = 0; __i < __imax; ++__i) \
+ __dest->__bits[__i] = __arr1->__bits[__i] op __arr2->__bits[__i]; \
+ __dest; }))
# define __CPU_ALLOC_SIZE(count) \
((((count) + __NCPUBITS - 1) / __NCPUBITS) * 8)
diff --git a/sysdeps/unix/sysv/linux/check_native.c b/sysdeps/unix/sysv/linux/check_native.c
new file mode 100644
index 0000000..6e6624a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/check_native.c
@@ -0,0 +1,172 @@
+/* Determine whether interfaces use native transport. Linux version.
+ Copyright (C) 2007 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 <assert.h>
+#include <errno.h>
+#include <ifaddrs.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <time.h>
+#include <unistd.h>
+#include <net/if.h>
+#include <net/if_arp.h>
+#include <sys/ioctl.h>
+
+#include <asm/types.h>
+#include <linux/netlink.h>
+#include <linux/rtnetlink.h>
+
+#include <not-cancel.h>
+
+
+void
+__check_native (uint32_t a1_index, int *a1_native,
+ uint32_t a2_index, int *a2_native)
+{
+ int fd = __socket (PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
+
+ struct sockaddr_nl nladdr;
+ memset (&nladdr, '\0', sizeof (nladdr));
+ nladdr.nl_family = AF_NETLINK;
+
+ socklen_t addr_len = sizeof (nladdr);
+
+ if (fd < 0
+ || __bind (fd, (struct sockaddr *) &nladdr, sizeof (nladdr)) != 0
+ || __getsockname (fd, (struct sockaddr *) &nladdr, &addr_len) != 0)
+ return;
+
+ pid_t pid = nladdr.nl_pid;
+ struct req
+ {
+ struct nlmsghdr nlh;
+ struct rtgenmsg g;
+ /* struct rtgenmsg consists of a single byte. This means there
+ are three bytes of padding included in the REQ definition.
+ We make them explicit here. */
+ char pad[3];
+ } req;
+
+ req.nlh.nlmsg_len = sizeof (req);
+ req.nlh.nlmsg_type = RTM_GETLINK;
+ req.nlh.nlmsg_flags = NLM_F_ROOT | NLM_F_MATCH | NLM_F_REQUEST;
+ req.nlh.nlmsg_pid = 0;
+ req.nlh.nlmsg_seq = time (NULL);
+ req.g.rtgen_family = AF_UNSPEC;
+
+ assert (sizeof (req) - offsetof (struct req, pad) == 3);
+ memset (req.pad, '\0', sizeof (req.pad));
+
+ memset (&nladdr, '\0', sizeof (nladdr));
+ nladdr.nl_family = AF_NETLINK;
+
+#ifdef PAGE_SIZE
+ /* Help the compiler optimize out the malloc call if PAGE_SIZE
+ is constant and smaller or equal to PTHREAD_STACK_MIN/4. */
+ const size_t buf_size = PAGE_SIZE;
+#else
+ const size_t buf_size = __getpagesize ();
+#endif
+ bool use_malloc = false;
+ char *buf;
+
+ if (__libc_use_alloca (buf_size))
+ buf = alloca (buf_size);
+ else
+ {
+ buf = malloc (buf_size);
+ if (buf != NULL)
+ use_malloc = true;
+ else
+ goto out_fail;
+ }
+
+ struct iovec iov = { buf, buf_size };
+
+ if (TEMP_FAILURE_RETRY (__sendto (fd, (void *) &req, sizeof (req), 0,
+ (struct sockaddr *) &nladdr,
+ sizeof (nladdr))) < 0)
+ goto out_fail;
+
+ bool done = false;
+ do
+ {
+ struct msghdr msg =
+ {
+ (void *) &nladdr, sizeof (nladdr),
+ &iov, 1,
+ NULL, 0,
+ 0
+ };
+
+ ssize_t read_len = TEMP_FAILURE_RETRY (__recvmsg (fd, &msg, 0));
+ if (read_len < 0)
+ goto out_fail;
+
+ if (msg.msg_flags & MSG_TRUNC)
+ goto out_fail;
+
+ struct nlmsghdr *nlmh;
+ for (nlmh = (struct nlmsghdr *) buf;
+ NLMSG_OK (nlmh, (size_t) read_len);
+ nlmh = (struct nlmsghdr *) NLMSG_NEXT (nlmh, read_len))
+ {
+ if (nladdr.nl_pid != 0 || (pid_t) nlmh->nlmsg_pid != pid
+ || nlmh->nlmsg_seq != req.nlh.nlmsg_seq)
+ continue;
+
+ if (nlmh->nlmsg_type == RTM_NEWLINK)
+ {
+ struct ifinfomsg *ifim = (struct ifinfomsg *) NLMSG_DATA (nlmh);
+ int native = (ifim->ifi_type != ARPHRD_TUNNEL6
+ && ifim->ifi_type != ARPHRD_TUNNEL
+ && ifim->ifi_type != ARPHRD_SIT);
+
+ if (a1_index == ifim->ifi_index)
+ {
+ *a1_native = native;
+ a1_index = 0xffffffffu;
+ }
+ if (a2_index == ifim->ifi_index)
+ {
+ *a2_native = native;
+ a2_index = 0xffffffffu;
+ }
+
+ if (a1_index == 0xffffffffu
+ && a2_index == 0xffffffffu)
+ goto out;
+ }
+ else if (nlmh->nlmsg_type == NLMSG_DONE)
+ /* We found the end, leave the loop. */
+ done = true;
+ }
+ }
+ while (! done);
+
+ out:
+ close_not_cancel_no_status (fd);
+
+ return;
+
+out_fail:
+ if (use_malloc)
+ free (buf);
+}
diff --git a/sysdeps/unix/sysv/linux/check_pf.c b/sysdeps/unix/sysv/linux/check_pf.c
index 06fb189..d66f029 100644
--- a/sysdeps/unix/sysv/linux/check_pf.c
+++ b/sysdeps/unix/sysv/linux/check_pf.c
@@ -32,9 +32,6 @@
#include "netlinkaccess.h"
-#ifndef IFA_F_TEMPORARY
-# define IFA_F_TEMPORARY IFA_F_SECONDARY
-#endif
#ifndef IFA_F_HOMEADDRESS
# define IFA_F_HOMEADDRESS 0
#endif
@@ -142,92 +139,67 @@ make_request (int fd, pid_t pid, bool *seen_ipv4, bool *seen_ipv6,
struct rtattr *rta = IFA_RTA (ifam);
size_t len = nlmh->nlmsg_len - NLMSG_LENGTH (sizeof (*ifam));
- switch (ifam->ifa_family)
- {
- const void *local;
- const void *address;
+ if (ifam->ifa_family != AF_INET
+ && ifam->ifa_family != AF_INET6)
+ continue;
- case AF_INET:
- local = NULL;
- address = NULL;
- while (RTA_OK (rta, len))
+ const void *local = NULL;
+ const void *address = NULL;
+ while (RTA_OK (rta, len))
+ {
+ switch (rta->rta_type)
{
- switch (rta->rta_type)
- {
- case IFA_LOCAL:
- local = RTA_DATA (rta);
- break;
-
- case IFA_ADDRESS:
- address = RTA_DATA (rta);
- goto out_v4;
- }
-
- rta = RTA_NEXT (rta, len);
+ case IFA_LOCAL:
+ local = RTA_DATA (rta);
+ break;
+
+ case IFA_ADDRESS:
+ address = RTA_DATA (rta);
+ goto out;
}
- if (local != NULL)
+ rta = RTA_NEXT (rta, len);
+ }
+
+ if (local != NULL)
+ {
+ address = local;
+ out:
+ if (ifam->ifa_family != AF_INET)
{
- out_v4:
- if (*(const in_addr_t *) (address ?: local)
+ if (*(const in_addr_t *) address
!= htonl (INADDR_LOOPBACK))
*seen_ipv4 = true;
}
- break;
-
- case AF_INET6:
- local = NULL;
- address = NULL;
- while (RTA_OK (rta, len))
+ else
{
- switch (rta->rta_type)
- {
- case IFA_LOCAL:
- local = RTA_DATA (rta);
- break;
-
- case IFA_ADDRESS:
- address = RTA_DATA (rta);
- goto out_v6;
- }
-
- rta = RTA_NEXT (rta, len);
- }
-
- if (local != NULL)
- {
- out_v6:
- if (!IN6_IS_ADDR_LOOPBACK (address ?: local))
+ if (!IN6_IS_ADDR_LOOPBACK (address))
*seen_ipv6 = true;
}
+ }
- if (ifam->ifa_flags & (IFA_F_DEPRECATED
- | IFA_F_TEMPORARY
- | IFA_F_HOMEADDRESS
- | IFA_F_OPTIMISTIC))
- {
- struct in6ailist *newp = alloca (sizeof (*newp));
- newp->info.flags = (((ifam->ifa_flags
- & (IFA_F_DEPRECATED
- | IFA_F_OPTIMISTIC))
- ? in6ai_deprecated : 0)
- | ((ifam->ifa_flags
- & IFA_F_TEMPORARY)
- ? in6ai_temporary : 0)
- | ((ifam->ifa_flags
- & IFA_F_HOMEADDRESS)
- ? in6ai_homeaddress : 0));
- memcpy (newp->info.addr, address ?: local,
- sizeof (newp->info.addr));
- newp->next = in6ailist;
- in6ailist = newp;
- ++in6ailistlen;
- }
- break;
- default:
- /* Ignore. */
- break;
+ struct in6ailist *newp = alloca (sizeof (*newp));
+ newp->info.flags = (((ifam->ifa_flags
+ & (IFA_F_DEPRECATED
+ | IFA_F_OPTIMISTIC))
+ ? in6ai_deprecated : 0)
+ | ((ifam->ifa_flags
+ & IFA_F_HOMEADDRESS)
+ ? in6ai_homeaddress : 0));
+ newp->info.prefixlen = ifam->ifa_prefixlen;
+ newp->info.index = ifam->ifa_index;
+ if (ifam->ifa_family == AF_INET)
+ {
+ newp->info.addr[0] = 0;
+ newp->info.addr[1] = 0;
+ newp->info.addr[2] = htonl (0xffff);
+ newp->info.addr[3] = *(const in_addr_t *) address;
}
+ else
+ memcpy (newp->info.addr, address, sizeof (newp->info.addr));
+ newp->next = in6ailist;
+ in6ailist = newp;
+ ++in6ailistlen;
}
else if (nlmh->nlmsg_type == NLMSG_DONE)
/* We found the end, leave the loop. */
diff --git a/sysdeps/unix/sysv/linux/i386/makecontext.S b/sysdeps/unix/sysv/linux/i386/makecontext.S
index 12ba4e2..89be117 100644
--- a/sysdeps/unix/sysv/linux/i386/makecontext.S
+++ b/sysdeps/unix/sysv/linux/i386/makecontext.S
@@ -35,11 +35,6 @@ ENTRY(__makecontext)
movl %ecx, oEIP(%eax)
addl oSS_SIZE(%eax), %edx
- /* Put the next context on the new stack (from the uc_link
- element). */
- movl oLINK(%eax), %ecx
- movl %ecx, -4(%edx)
-
/* Remember the number of parameters for the exit handler since
it has to remove them. We store the number in the EBX register
which the function we will call must preserve. */
@@ -50,9 +45,20 @@ ENTRY(__makecontext)
negl %ecx
leal -8(%edx,%ecx,4), %edx
negl %ecx
+
+ /* Align the stack. */
+ addl $16, %edx
+ andl $0xfffffff0, %edx
+ subl $4, %edx
+
/* Store the future stack pointer. */
movl %edx, oESP(%eax)
+ /* Put the next context on the new stack (from the uc_link
+ element). */
+ movl oLINK(%eax), %eax
+ movl %eax, 4(%edx,%ecx,4)
+
/* Copy all the parameters. */
jecxz 2f
1: movl 12(%esp,%ecx,4), %eax
diff --git a/sysdeps/unix/sysv/linux/ia64/syscalls.list b/sysdeps/unix/sysv/linux/ia64/syscalls.list
index c55c70e..5824927 100644
--- a/sysdeps/unix/sysv/linux/ia64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/ia64/syscalls.list
@@ -4,6 +4,9 @@ umount2 - umount 2 __umount2 umount2
getpriority - getpriority i:ii __getpriority getpriority
+creat - creat Ci:si __libc_creat creat creat64
+open - open Ci:siv __libc_open __open open __open64 open64
+
# semaphore and shm system calls
msgctl - msgctl i:iip __msgctl msgctl
msgget - msgget i:ii __msgget msgget
diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
index aab3df3..01baab0 100644
--- a/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/kernel-features.h
@@ -487,3 +487,8 @@
|| (__LINUX_KERNEL_VERSION >= 0x020618 && defined __s390__))
# define __ASSUME_FALLOCATE 1
#endif
+
+/* Support for ADJ_OFFSET_SS_READ was added in 2.6.24. */
+#if __LINUX_KERNEL_VERSION >= 0x020618
+# define __ASSUME_ADJ_OFFSET_SS_READ 1
+#endif
diff --git a/sysdeps/unix/sysv/linux/netiucv/iucv.h b/sysdeps/unix/sysv/linux/netiucv/iucv.h
new file mode 100644
index 0000000..779ebff
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/netiucv/iucv.h
@@ -0,0 +1,39 @@
+/* Copyright (C) 2007 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 __NETIUCV_IUCV_H
+#define __NETIUCV_IUCV_H 1
+
+#include <features.h>
+#include <bits/sockaddr.h>
+
+__BEGIN_DECLS
+
+struct sockaddr_iucv
+ {
+ __SOCKADDR_COMMON (siucv_);
+ unsigned short siucv_port; /* Reserved */
+ unsigned int siucv_addr; /* Reserved */
+ char siucv_nodeid[8]; /* Reserved */
+ char siucv_user_id[8]; /* Guest User Id */
+ char siucv_name[8]; /* Application Name */
+ };
+
+__END_DECLS
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/nscd_setup_thread.c b/sysdeps/unix/sysv/linux/nscd_setup_thread.c
index 56e23dc..c29f972 100644
--- a/sysdeps/unix/sysv/linux/nscd_setup_thread.c
+++ b/sysdeps/unix/sysv/linux/nscd_setup_thread.c
@@ -23,7 +23,7 @@
#include <sysdep.h>
-void
+int
setup_thread (struct database_dyn *db)
{
#ifdef __NR_set_tid_address
@@ -31,7 +31,7 @@ setup_thread (struct database_dyn *db)
char buf[100];
if (confstr (_CS_GNU_LIBPTHREAD_VERSION, buf, sizeof (buf)) >= sizeof (buf)
|| strncmp (buf, "NPTL", 4) != 0)
- return;
+ return 0;
/* Do not try this at home, kids. We play with the SETTID address
even thought the process is multi-threaded. This can only work
@@ -43,6 +43,8 @@ setup_thread (struct database_dyn *db)
/* We know the kernel can reset this field when nscd terminates.
So, set the field to a nonzero value which indicates that nscd
is certainly running and clients can skip the test. */
- db->head->nscd_certainly_running = 1;
+ return db->head->nscd_certainly_running = 1;
#endif
+
+ return 0;
}
diff --git a/sysdeps/unix/sysv/linux/open64.c b/sysdeps/unix/sysv/linux/open64.c
index c52ce39..21b3d0b 100644
--- a/sysdeps/unix/sysv/linux/open64.c
+++ b/sysdeps/unix/sysv/linux/open64.c
@@ -52,26 +52,3 @@ __libc_open64 (const char *file, int oflag, ...)
weak_alias (__libc_open64, __open64)
libc_hidden_weak (__open64)
weak_alias (__libc_open64, open64)
-
-
-#ifndef PTW
-int
-__open64_2 (file, oflag)
- const char *file;
- int oflag;
-{
- if (oflag & O_CREAT)
- __fortify_fail ("invalid open64 call: O_CREAT without mode");
-
- if (SINGLE_THREAD_P)
- return INLINE_SYSCALL (open, 2, file, oflag | O_LARGEFILE);
-
- int oldtype = LIBC_CANCEL_ASYNC ();
-
- int result = INLINE_SYSCALL (open, 2, file, oflag | O_LARGEFILE);
-
- LIBC_CANCEL_RESET (oldtype);
-
- return result;
-}
-#endif
diff --git a/sysdeps/unix/sysv/linux/open64_2.c b/sysdeps/unix/sysv/linux/open64_2.c
new file mode 100644
index 0000000..76b65e5
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/open64_2.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 2007 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 <fcntl.h>
+#include <stdio.h>
+
+
+int
+__open64_2 (file, oflag)
+ const char *file;
+ int oflag;
+{
+ if (oflag & O_CREAT)
+ __fortify_fail ("invalid open64 call: O_CREAT without mode");
+
+ return __open64 (file, oflag);
+}
diff --git a/sysdeps/unix/sysv/linux/opensock.c b/sysdeps/unix/sysv/linux/opensock.c
index 2252980..95559eb 100644
--- a/sysdeps/unix/sysv/linux/opensock.c
+++ b/sysdeps/unix/sysv/linux/opensock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2001, 2002, 2007 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
@@ -53,7 +53,10 @@ __opensock (void)
{ AF_APPLETALK, "net/appletalk" },
{ AF_ECONET, "sys/net/econet" },
{ AF_ASH, "sys/net/ash" },
- { AF_X25, "net/x25" }
+ { AF_X25, "net/x25" },
+#ifdef NEED_AF_IUCV
+ { AF_IUCV, "net/iucv" }
+#endif
};
#define nafs (sizeof (afs) / sizeof (afs[0]))
char fname[sizeof "/proc/" + 14];
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list b/sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list
index aee60bf..320c40d 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list
@@ -1,3 +1,5 @@
# File name Caller Syscall name # args Strong name Weak names
+creat - creat Ci:si __libc_creat creat creat64
getrlimit - ugetrlimit i:ip __getrlimit getrlimit getrlimit64
+open - open Ci:siv __libc_open __open open __open64 open64
diff --git a/sysdeps/unix/sysv/linux/readahead.c b/sysdeps/unix/sysv/linux/readahead.c
index dc628b2..c280a47 100644
--- a/sysdeps/unix/sysv/linux/readahead.c
+++ b/sysdeps/unix/sysv/linux/readahead.c
@@ -1,5 +1,5 @@
/* Provide kernel hint to read ahead.
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2007 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
@@ -30,8 +30,10 @@
ssize_t
__readahead (int fd, off64_t offset, size_t count)
{
- return INLINE_SYSCALL (readahead, 4, fd, (off_t) (offset >> 32),
- (off_t) (offset & 0xffffffff), count);
+ return INLINE_SYSCALL (readahead, 4, fd,
+ __LONG_LONG_PAIR ((off_t) (offset >> 32),
+ (off_t) (offset & 0xffffffff)),
+ count);
}
#else
ssize_t
diff --git a/sysdeps/unix/sysv/linux/s390/opensock.c b/sysdeps/unix/sysv/linux/s390/opensock.c
new file mode 100644
index 0000000..f099d65
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/s390/opensock.c
@@ -0,0 +1,2 @@
+#define NEED_AF_IUCV 1
+#include "../opensock.c"
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list b/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list
index 791ab9b..6849999 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list
@@ -2,6 +2,9 @@
vfork - vfork 0 __vfork vfork
+creat - creat Ci:si __libc_creat creat creat64
+open - open Ci:siv __libc_open __open open __open64 open64
+
# semaphore and shm system calls
msgctl - msgctl i:iip __msgctl msgctl
msgget - msgget i:ii __msgget msgget
diff --git a/sysdeps/unix/sysv/linux/s390/sa_len.c b/sysdeps/unix/sysv/linux/s390/sa_len.c
new file mode 100644
index 0000000..6575b83
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/s390/sa_len.c
@@ -0,0 +1,2 @@
+#define NEED_AF_IUCV 1
+#include "../sa_len.c"
diff --git a/sysdeps/unix/sysv/linux/sa_len.c b/sysdeps/unix/sysv/linux/sa_len.c
index ae5616b..1a89b27 100644
--- a/sysdeps/unix/sysv/linux/sa_len.c
+++ b/sysdeps/unix/sysv/linux/sa_len.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999, 2002, 2007 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,6 +26,7 @@
#include <netipx/ipx.h>
#include <netpacket/packet.h>
#include <netrose/rose.h>
+#include <netiucv/iucv.h>
#include <sys/un.h>
int
@@ -47,6 +48,10 @@ __libc_sa_len (sa_family_t af)
return sizeof (struct sockaddr_in6);
case AF_IPX:
return sizeof (struct sockaddr_ipx);
+#ifdef NEED_AF_IUCV
+ case AF_IUCV:
+ return sizeof (struct sockaddr_iucv);
+#endif
case AF_LOCAL:
return sizeof (struct sockaddr_un);
case AF_PACKET:
diff --git a/sysdeps/unix/sysv/linux/sys/epoll.h b/sysdeps/unix/sysv/linux/sys/epoll.h
index d8901f7..f4e8bda 100644
--- a/sysdeps/unix/sysv/linux/sys/epoll.h
+++ b/sysdeps/unix/sysv/linux/sys/epoll.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2006, 2007 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
@@ -53,6 +53,8 @@ enum EPOLL_EVENTS
#define EPOLLERR EPOLLERR
EPOLLHUP = 0x010,
#define EPOLLHUP EPOLLHUP
+ EPOLLRDHUP = 0x2000,
+#define EPOLLRDHUP EPOLLRDHUP
EPOLLONESHOT = (1 << 30),
#define EPOLLONESHOT EPOLLONESHOT
EPOLLET = (1 << 31)
diff --git a/sysdeps/unix/sysv/linux/sys/signalfd.h b/sysdeps/unix/sysv/linux/sys/signalfd.h
index 247b20b..6649bc1 100644
--- a/sysdeps/unix/sysv/linux/sys/signalfd.h
+++ b/sysdeps/unix/sysv/linux/sys/signalfd.h
@@ -51,7 +51,7 @@ __BEGIN_DECLS
/* Request notification for delivery of signals in MASK to be
performed using descriptor FD.*/
extern int signalfd (int __fd, const sigset_t *__mask, int __flags)
- __nonnull (2) __THROW;
+ __nonnull ((2)) __THROW;
__END_DECLS
diff --git a/sysdeps/unix/sysv/linux/sys/timex.h b/sysdeps/unix/sysv/linux/sys/timex.h
index 773a5ab..f7bd6e7 100644
--- a/sysdeps/unix/sysv/linux/sys/timex.h
+++ b/sysdeps/unix/sysv/linux/sys/timex.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1997, 1999, 2007 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
@@ -69,6 +69,7 @@ struct timex
#define ADJ_TIMECONST 0x0020 /* pll time constant */
#define ADJ_TICK 0x4000 /* tick value */
#define ADJ_OFFSET_SINGLESHOT 0x8001 /* old-fashioned adjtime */
+#define ADJ_OFFSET_SS_READ 0xa001 /* read-only adjtime */
/* xntp 3.4 compatibility names */
#define MOD_OFFSET ADJ_OFFSET
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/aio_read.c b/sysdeps/unix/sysv/linux/wordsize-64/aio_read.c
new file mode 100644
index 0000000..d10fc43
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/wordsize-64/aio_read.c
@@ -0,0 +1,7 @@
+#define aio_read64 __renamed_aio_read64
+
+#include "../../../../pthread/aio_read.c"
+
+#undef aio_read64
+
+weak_alias (aio_read, aio_read64)
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/aio_read64.c b/sysdeps/unix/sysv/linux/wordsize-64/aio_read64.c
new file mode 100644
index 0000000..6a6a102
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/wordsize-64/aio_read64.c
@@ -0,0 +1 @@
+/* Defined in aio_read.c. */
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/aio_write.c b/sysdeps/unix/sysv/linux/wordsize-64/aio_write.c
new file mode 100644
index 0000000..b0fb469
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/wordsize-64/aio_write.c
@@ -0,0 +1,7 @@
+#define aio_write64 __renamed_aio_write64
+
+#include "../../../../pthread/aio_write.c"
+
+#undef aio_write64
+
+weak_alias (aio_write, aio_write64)
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/aio_write64.c b/sysdeps/unix/sysv/linux/wordsize-64/aio_write64.c
new file mode 100644
index 0000000..ced07fa
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/wordsize-64/aio_write64.c
@@ -0,0 +1 @@
+/* Defined in aio_write.c. */
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/creat64.c b/sysdeps/unix/sysv/linux/wordsize-64/creat64.c
new file mode 100644
index 0000000..c106e2b
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/wordsize-64/creat64.c
@@ -0,0 +1 @@
+/* Defined as alias for the syscall. */
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/getdirentries.c b/sysdeps/unix/sysv/linux/wordsize-64/getdirentries.c
new file mode 100644
index 0000000..298d1e9
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/wordsize-64/getdirentries.c
@@ -0,0 +1,3 @@
+#include "../getdirentries.c"
+
+weak_alias (getdirentries, getdirentries64)
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/getdirentries64.c b/sysdeps/unix/sysv/linux/wordsize-64/getdirentries64.c
new file mode 100644
index 0000000..622baf0
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/wordsize-64/getdirentries64.c
@@ -0,0 +1 @@
+/* Defined in getdirentries.c. */
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/lio_listio.c b/sysdeps/unix/sysv/linux/wordsize-64/lio_listio.c
new file mode 100644
index 0000000..25ee5a3
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/wordsize-64/lio_listio.c
@@ -0,0 +1,13 @@
+#define lio_listio64 __renamed_lio_listio64
+
+#include "../../../../pthread/lio_listio.c"
+
+#undef lio_listio64
+
+#if SHLIB_COMPAT (librt, GLIBC_2_1, GLIBC_2_4)
+strong_alias (__lio_listio_21, __lio_listio64_21)
+compat_symbol (librt, __lio_listio64_21, lio_listio64, GLIBC_2_1);
+#endif
+
+strong_alias (__lio_listio_item_notify, __lio_listio64_item_notify)
+versioned_symbol (librt, __lio_listio64_item_notify, lio_listio64, GLIBC_2_4);
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/lio_listio64.c b/sysdeps/unix/sysv/linux/wordsize-64/lio_listio64.c
new file mode 100644
index 0000000..1dabae3
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/wordsize-64/lio_listio64.c
@@ -0,0 +1 @@
+/* Defined in lio_listio.c. */
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/open64.c b/sysdeps/unix/sysv/linux/wordsize-64/open64.c
new file mode 100644
index 0000000..0abe30e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/wordsize-64/open64.c
@@ -0,0 +1 @@
+/* Defined in open syscall. */
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/openat.c b/sysdeps/unix/sysv/linux/wordsize-64/openat.c
new file mode 100644
index 0000000..4921fca
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/wordsize-64/openat.c
@@ -0,0 +1,16 @@
+#define __openat64 __rename___openat64
+#define __openat64_2 __rename___openat64_2
+#define __openat64_nocancel __rename___openat64_nocancel
+#define openat64 __rename_openat64
+
+#include "../openat.c"
+
+#undef __openat64
+#undef __openat64_2
+#undef __openat64_nocancel
+#undef openat64
+
+weak_alias (__openat, __openat64)
+weak_alias (__openat_2, __openat64_2)
+weak_alias (__openat_nocancel, __openat64_nocancel)
+weak_alias (openat, openat64)
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/openat64.c b/sysdeps/unix/sysv/linux/wordsize-64/openat64.c
new file mode 100644
index 0000000..b4a864b
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/wordsize-64/openat64.c
@@ -0,0 +1 @@
+/* Defined in openat.c. */
diff --git a/sysdeps/unix/sysv/linux/x86_64/syscalls.list b/sysdeps/unix/sysv/linux/x86_64/syscalls.list
index a9d4044..a3d3d6c 100644
--- a/sysdeps/unix/sysv/linux/x86_64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/x86_64/syscalls.list
@@ -1,13 +1,13 @@
# File name Caller Syscall name # args Strong name Weak names
arch_prctl EXTRA arch_prctl i:ii __arch_prctl arch_prctl
+creat - creat Ci:si __libc_creat creat creat64
modify_ldt EXTRA modify_ldt i:ipi __modify_ldt modify_ldt
-
-# semaphore and shm system calls
msgctl - msgctl i:iip __msgctl msgctl
msgget - msgget i:ii __msgget msgget
msgrcv - msgrcv Ci:ibnii __msgrcv msgrcv
msgsnd - msgsnd Ci:ibni __msgsnd msgsnd
+open - open Ci:siv __libc_open __open open __open64 open64
shmat - shmat i:ipi __shmat shmat
shmctl - shmctl i:iip __shmctl shmctl
shmdt - shmdt i:s __shmdt shmdt