summaryrefslogtreecommitdiff
path: root/libc/sysdeps/unix/sysv/linux
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/unix/sysv/linux')
-rw-r--r--libc/sysdeps/unix/sysv/linux/Makefile3
-rw-r--r--libc/sysdeps/unix/sysv/linux/bits/mman-linux.h108
-rw-r--r--libc/sysdeps/unix/sysv/linux/bits/msq.h1
-rw-r--r--libc/sysdeps/unix/sysv/linux/fpathconf.c7
-rw-r--r--libc/sysdeps/unix/sysv/linux/internal_statvfs.c6
-rw-r--r--libc/sysdeps/unix/sysv/linux/ldsodefs.h6
-rw-r--r--libc/sysdeps/unix/sysv/linux/linux_fsinfo.h7
-rw-r--r--libc/sysdeps/unix/sysv/linux/pathconf.c23
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/Implies4
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h10
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/bits/mman.h73
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/bits/msq.h1
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c48
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S9
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S11
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h3
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/bits/mman.h76
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/bits/msq.h1
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S43
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-32/setcontext.S43
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S6
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S43
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S43
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S6
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/sys/ptrace.h3
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/ucontext_i.sym2
-rw-r--r--libc/sysdeps/unix/sysv/linux/sh/bits/mman.h76
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/bits/mman.h74
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/bits/msq.h1
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h3
-rw-r--r--libc/sysdeps/unix/sysv/linux/sys/ptrace.h3
-rw-r--r--libc/sysdeps/unix/sysv/linux/times.c10
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86/bits/mman.h72
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86/bits/msq.h1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libpthread.abilist1
35 files changed, 314 insertions, 513 deletions
diff --git a/libc/sysdeps/unix/sysv/linux/Makefile b/libc/sysdeps/unix/sysv/linux/Makefile
index ecd9c2c97..f82c94982 100644
--- a/libc/sysdeps/unix/sysv/linux/Makefile
+++ b/libc/sysdeps/unix/sysv/linux/Makefile
@@ -35,7 +35,8 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \
bits/a.out.h sys/inotify.h sys/signalfd.h sys/eventfd.h \
sys/timerfd.h sys/fanotify.h bits/eventfd.h bits/inotify.h \
bits/signalfd.h bits/timerfd.h bits/epoll.h \
- bits/socket_type.h bits/syscall.h bits/sysctl.h
+ bits/socket_type.h bits/syscall.h bits/sysctl.h \
+ bits/mman-linux.h
tests += tst-clone
diff --git a/libc/sysdeps/unix/sysv/linux/bits/mman-linux.h b/libc/sysdeps/unix/sysv/linux/bits/mman-linux.h
new file mode 100644
index 000000000..05d2d9237
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/bits/mman-linux.h
@@ -0,0 +1,108 @@
+/* Definitions for POSIX memory map interface. Linux generic version.
+ Copyright (C) 2001-2013 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _SYS_MMAN_H
+# error "Never use <bits/mman-linux.h> directly; include <sys/mman.h> instead."
+#endif
+
+/* The following definitions basically come from the kernel headers.
+ But the kernel header is not namespace clean. */
+
+
+/* Protections are chosen from these bits, OR'd together. The
+ implementation does not necessarily support PROT_EXEC or PROT_WRITE
+ without PROT_READ. The only guarantees are that no writing will be
+ allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
+
+#define PROT_READ 0x1 /* Page can be read. */
+#define PROT_WRITE 0x2 /* Page can be written. */
+#define PROT_EXEC 0x4 /* Page can be executed. */
+#define PROT_NONE 0x0 /* Page can not be accessed. */
+#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of
+ growsdown vma (mprotect only). */
+#define PROT_GROWSUP 0x02000000 /* Extend change to start of
+ growsup vma (mprotect only). */
+
+/* Sharing types (must choose one and only one of these). */
+#define MAP_SHARED 0x01 /* Share changes. */
+#define MAP_PRIVATE 0x02 /* Changes are private. */
+#ifdef __USE_MISC
+# define MAP_TYPE 0x0f /* Mask for type of mapping. */
+#endif
+
+/* Other flags. */
+#define MAP_FIXED 0x10 /* Interpret addr exactly. */
+#ifdef __USE_MISC
+# define MAP_FILE 0
+# ifdef __MAP_ANONYMOUS
+# define MAP_ANONYMOUS __MAP_ANONYMOUS /* Don't use a file. */
+# else
+# define MAP_ANONYMOUS 0x20 /* Don't use a file. */
+# endif
+# define MAP_ANON MAP_ANONYMOUS
+/* When MAP_HUGETLB is set bits [26:31] encode the log2 of the huge page size. */
+# define MAP_HUGE_SHIFT 26
+# define MAP_HUGE_MASK 0x3f
+#endif
+
+/* Flags to `msync'. */
+#define MS_ASYNC 1 /* Sync memory asynchronously. */
+#define MS_SYNC 4 /* Synchronous memory sync. */
+#define MS_INVALIDATE 2 /* Invalidate the caches. */
+
+/* Flags for `mremap'. */
+#ifdef __USE_GNU
+# define MREMAP_MAYMOVE 1
+# define MREMAP_FIXED 2
+#endif
+
+/* Advice to `madvise'. */
+#ifdef __USE_BSD
+# define MADV_NORMAL 0 /* No further special treatment. */
+# define MADV_RANDOM 1 /* Expect random page references. */
+# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
+# define MADV_WILLNEED 3 /* Will need these pages. */
+# define MADV_DONTNEED 4 /* Don't need these pages. */
+# define MADV_REMOVE 9 /* Remove these pages and resources. */
+# define MADV_DONTFORK 10 /* Do not inherit across fork. */
+# define MADV_DOFORK 11 /* Do inherit across fork. */
+# define MADV_MERGEABLE 12 /* KSM may merge identical pages. */
+# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */
+# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */
+# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */
+# define MADV_DONTDUMP 16 /* Explicity exclude from the core dump,
+ overrides the coredump filter bits. */
+# define MADV_DODUMP 17 /* Clear the MADV_DONTDUMP flag. */
+# define MADV_HWPOISON 100 /* Poison a page for testing. */
+#endif
+
+/* The POSIX people had to invent similar names for the same things. */
+#ifdef __USE_XOPEN2K
+# define POSIX_MADV_NORMAL 0 /* No further special treatment. */
+# define POSIX_MADV_RANDOM 1 /* Expect random page references. */
+# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */
+# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */
+# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */
+#endif
+
+/* Flags for `mlockall'. */
+#ifndef MCL_CURRENT
+# define MCL_CURRENT 1 /* Lock all currently mapped pages. */
+# define MCL_FUTURE 2 /* Lock all additions to address
+ space. */
+#endif
diff --git a/libc/sysdeps/unix/sysv/linux/bits/msq.h b/libc/sysdeps/unix/sysv/linux/bits/msq.h
index bd005fb10..8f6eb8a7d 100644
--- a/libc/sysdeps/unix/sysv/linux/bits/msq.h
+++ b/libc/sysdeps/unix/sysv/linux/bits/msq.h
@@ -25,6 +25,7 @@
#define MSG_NOERROR 010000 /* no error if message is too big */
#ifdef __USE_GNU
# define MSG_EXCEPT 020000 /* recv any msg except of specified type */
+# define MSG_COPY 040000 /* copy (not remove) all queue messages */
#endif
/* Types used in the structure definition. */
diff --git a/libc/sysdeps/unix/sysv/linux/fpathconf.c b/libc/sysdeps/unix/sysv/linux/fpathconf.c
index c97164468..e8c4dc972 100644
--- a/libc/sysdeps/unix/sysv/linux/fpathconf.c
+++ b/libc/sysdeps/unix/sysv/linux/fpathconf.c
@@ -33,7 +33,6 @@ __fpathconf (fd, name)
int name;
{
struct statfs fsbuf;
- int r;
switch (name)
{
@@ -49,12 +48,6 @@ __fpathconf (fd, name)
case _PC_CHOWN_RESTRICTED:
return __statfs_chown_restricted (__fstatfs (fd, &fsbuf), &fsbuf);
- case _PC_PIPE_BUF:
- r = __fcntl (fd, F_GETPIPE_SZ);
- if (r > 0)
- return r;
- /* FALLTHROUGH */
-
default:
return posix_fpathconf (fd, name);
}
diff --git a/libc/sysdeps/unix/sysv/linux/internal_statvfs.c b/libc/sysdeps/unix/sysv/linux/internal_statvfs.c
index 4cd4f042c..45a66b83d 100644
--- a/libc/sysdeps/unix/sysv/linux/internal_statvfs.c
+++ b/libc/sysdeps/unix/sysv/linux/internal_statvfs.c
@@ -117,6 +117,12 @@ __statvfs_getflags (const char *name, int fstype, struct stat64 *st)
case LUSTRE_SUPER_MAGIC:
fsname = "lustre";
break;
+ case F2FS_SUPER_MAGIC:
+ fsname = "f2fs";
+ break;
+ case EFIVARFS_MAGIC:
+ fsname = "efivarfs";
+ break;
}
FILE *mtab = __setmntent ("/proc/mounts", "r");
diff --git a/libc/sysdeps/unix/sysv/linux/ldsodefs.h b/libc/sysdeps/unix/sysv/linux/ldsodefs.h
index 081fa01f8..18ff8528c 100644
--- a/libc/sysdeps/unix/sysv/linux/ldsodefs.h
+++ b/libc/sysdeps/unix/sysv/linux/ldsodefs.h
@@ -29,12 +29,6 @@
/* We have the auxiliary vector. */
#define HAVE_AUX_VECTOR
-/* Used by static binaries to check the auxiliary vector. */
-extern void _dl_aux_init (ElfW(auxv_t) *av) internal_function;
-
-/* Initialization which is normally done by the dynamic linker. */
-extern void _dl_non_dynamic_init (void) internal_function;
-
/* We can assume that the kernel always provides the AT_UID, AT_EUID,
AT_GID, and AT_EGID values in the auxiliary vector from 2.4.0 or so on. */
#define HAVE_AUX_XID
diff --git a/libc/sysdeps/unix/sysv/linux/linux_fsinfo.h b/libc/sysdeps/unix/sysv/linux/linux_fsinfo.h
index 1bcd9e2b2..2312b4702 100644
--- a/libc/sysdeps/unix/sysv/linux/linux_fsinfo.h
+++ b/libc/sysdeps/unix/sysv/linux/linux_fsinfo.h
@@ -61,9 +61,15 @@
#define EFS_SUPER_MAGIC 0x414a53
#define EFS_MAGIC 0x072959
+/* Constants that identifies the `evivar' filesystem. */
+#define EFIVARFS_MAGIC 0xde5e81e4
+
/* Constant that identifies the `ext2' and `ext3' filesystems. */
#define EXT2_SUPER_MAGIC 0xef53
+/* Constant that identifies the `f2fs' filesystem. */
+#define F2FS_SUPER_MAGIC 0xf2f52010
+
/* Constant that identifies the `hpfs' filesystem. */
#define HPFS_SUPER_MAGIC 0xf995e849
@@ -153,6 +159,7 @@
#define COH_LINK_MAX 10000
#define EXT2_LINK_MAX 32000
#define EXT4_LINK_MAX 65000
+#define F2FS_LINK_MAX 32000
#define LUSTRE_LINK_MAX EXT4_LINK_MAX
#define MINIX2_LINK_MAX 65530
#define MINIX_LINK_MAX 250
diff --git a/libc/sysdeps/unix/sysv/linux/pathconf.c b/libc/sysdeps/unix/sysv/linux/pathconf.c
index e86925f7d..de91a4541 100644
--- a/libc/sysdeps/unix/sysv/linux/pathconf.c
+++ b/libc/sysdeps/unix/sysv/linux/pathconf.c
@@ -39,8 +39,6 @@ long int
__pathconf (const char *file, int name)
{
struct statfs fsbuf;
- int fd;
- int flags;
switch (name)
{
@@ -56,21 +54,6 @@ __pathconf (const char *file, int name)
case _PC_CHOWN_RESTRICTED:
return __statfs_chown_restricted (__statfs (file, &fsbuf), &fsbuf);
- case _PC_PIPE_BUF:
- flags = O_RDONLY|O_NONBLOCK|O_NOCTTY;
-#ifdef O_CLOEXEC
- flags |= O_CLOEXEC;
-#endif
- fd = open_not_cancel_2 (file, flags);
- if (fd >= 0)
- {
- long int r = __fcntl (fd, F_GETPIPE_SZ);
- close_not_cancel_no_status (fd);
- if (r > 0)
- return r;
- }
- /* FALLTHROUGH */
-
default:
return posix_pathconf (file, name);
}
@@ -168,6 +151,9 @@ __statfs_link_max (int result, const struct statfs *fsbuf, const char *file,
the hard way. */
return distinguish_extX (fsbuf, file, fd);
+ case F2FS_SUPER_MAGIC:
+ return F2FS_LINK_MAX;
+
case MINIX_SUPER_MAGIC:
case MINIX_SUPER_MAGIC2:
return MINIX_LINK_MAX;
@@ -221,6 +207,9 @@ __statfs_filesize_max (int result, const struct statfs *fsbuf)
switch (fsbuf->f_type)
{
+ case F2FS_SUPER_MAGIC:
+ return 256;
+
case BTRFS_SUPER_MAGIC:
return 255;
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/Implies b/libc/sysdeps/unix/sysv/linux/powerpc/Implies
deleted file mode 100644
index ff27cdb56..000000000
--- a/libc/sysdeps/unix/sysv/linux/powerpc/Implies
+++ /dev/null
@@ -1,4 +0,0 @@
-# Make sure these routines come before ldbl-opt.
-ieee754/ldbl-128ibm
-# These supply the ABI compatibility for when long double was double.
-ieee754/ldbl-opt
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h b/libc/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h
index 545fda462..5f5fc1eb3 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h
@@ -32,6 +32,16 @@ extern void *__vdso_get_tbfreq;
extern void *__vdso_getcpu;
+/* This macro is needed for PPC64 to return a skeleton OPD entry of a vDSO
+ symbol. This works because _dl_vdso_vsym always return the function
+ address, and no vDSO symbols use the TOC or chain pointers from the OPD
+ so we can allow them to be garbage. */
+#if defined(__PPC64__) || defined(__powerpc64__)
+#define VDSO_IFUNC_RET(value) &value
+#else
+#define VDSO_IFUNC_RET(value) value
+#endif
+
#endif
#endif /* _LIBC_VDSO_H */
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/bits/mman.h b/libc/sysdeps/unix/sysv/linux/powerpc/bits/mman.h
index a27018965..3f72c0335 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/bits/mman.h
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/bits/mman.h
@@ -17,42 +17,13 @@
<http://www.gnu.org/licenses/>. */
#ifndef _SYS_MMAN_H
-# error "Never use <bits/mman.h> directly; iclude <sys/mman.h> instead."
+# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
#endif
/* The following definitions basically come from the kernel headers.
But the kernel header is not namespace clean. */
-
-/* Protections are chosen from these bits, OR'd together. The
- implementation does not necessarily support PROT_EXEC or PROT_WRITE
- without PROT_READ. The only guarantees are that no writing will be
- allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
-
-#define PROT_READ 0x1 /* Page can be read. */
-#define PROT_WRITE 0x2 /* Page can be written. */
-#define PROT_EXEC 0x4 /* Page can be executed. */
-#define PROT_NONE 0x0 /* Page can not be accessed. */
#define PROT_SAO 0x10 /* Strong Access Ordering. */
-#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of
- growsdown vma (mprotect only). */
-#define PROT_GROWSUP 0x02000000 /* Extend change to start of
- growsup vma (mprotect only). */
-
-/* Sharing types (must choose one and only one of these). */
-#define MAP_SHARED 0x001 /* Share changes. */
-#define MAP_PRIVATE 0x002 /* Changes are private. */
-#ifdef __USE_MISC
-# define MAP_TYPE 0x00f /* Mask for type of mapping. */
-#endif
-
-/* Other flags. */
-#define MAP_FIXED 0x010 /* Interpret addr exactly. */
-#ifdef __USE_MISC
-# define MAP_FILE 0x000
-# define MAP_ANONYMOUS 0x020 /* Don't use a file. */
-# define MAP_ANON MAP_ANONYMOUS
-#endif
/* These are Linux-specific. */
#ifdef __USE_MISC
@@ -67,48 +38,10 @@
# define MAP_HUGETLB 0x40000 /* Create huge page mapping. */
#endif
-/* Flags to `msync'. */
-#define MS_ASYNC 1 /* Sync memory asynchronously. */
-#define MS_SYNC 4 /* Synchronous memory sync. */
-#define MS_INVALIDATE 2 /* Invalidate the caches. */
-
/* Flags for `mlockall'. */
#define MCL_CURRENT 0x2000 /* Lock all currently mapped pages. */
#define MCL_FUTURE 0x4000 /* Lock all additions to address
space. */
-
-/* Flags for `mremap'. */
-#ifdef __USE_GNU
-# define MREMAP_MAYMOVE 1
-# define MREMAP_FIXED 2
-#endif
-
-/* Advice to `madvise'. */
-#ifdef __USE_BSD
-# define MADV_NORMAL 0 /* No further special treatment. */
-# define MADV_RANDOM 1 /* Expect random page references. */
-# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
-# define MADV_WILLNEED 3 /* Will need these pages. */
-# define MADV_DONTNEED 4 /* Don't need these pages. */
-# define MADV_REMOVE 9 /* Remove these pages and resources. */
-# define MADV_DONTFORK 10 /* Do not inherit across fork. */
-# define MADV_DOFORK 11 /* Do inherit across fork. */
-# define MADV_MERGEABLE 12 /* KSM may merge identical pages. */
-# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */
-# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */
-# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */
-# define MADV_DONTDUMP 16 /* Explicity exclude from the core dump,
- overrides the coredump filter bits. */
-# define MADV_DODUMP 17 /* Clear the MADV_DONTDUMP flag. */
-# define MADV_HWPOISON 100 /* Poison a page for testing. */
-#endif
-
-/* The POSIX people had to invent similar names for the same things. */
-#ifdef __USE_XOPEN2K
-# define POSIX_MADV_NORMAL 0 /* No further special treatment. */
-# define POSIX_MADV_RANDOM 1 /* Expect random page references. */
-# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */
-# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */
-# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */
-#endif
+/* Include generic Linux declarations. */
+#include <bits/mman-linux.h>
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/bits/msq.h b/libc/sysdeps/unix/sysv/linux/powerpc/bits/msq.h
index b9811c656..59147c268 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/bits/msq.h
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/bits/msq.h
@@ -25,6 +25,7 @@
#define MSG_NOERROR 010000 /* no error if message is too big */
#ifdef __USE_GNU
# define MSG_EXCEPT 020000 /* recv any msg except of specified type */
+# define MSG_COPY 040000 /* copy (not remove) all queue messages */
#endif
/* Types used in the structure definition. */
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c b/libc/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
index f60748507..6506d75e6 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
@@ -15,25 +15,49 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sysdep.h>
-#include <stddef.h>
+
#include <sys/time.h>
-#include <time.h>
-#include <hp-timing.h>
-#include <bits/libc-vdso.h>
+#ifdef SHARED
+
+# include <dl-vdso.h>
+# include <bits/libc-vdso.h>
+
+void *gettimeofday_ifunc (void) __asm__ ("__gettimeofday");
+
+static int
+__gettimeofday_syscall (struct timeval *tv, struct timezone *tz)
+{
+ return INLINE_SYSCALL (gettimeofday, 2, tv, tz);
+}
+
+void *
+gettimeofday_ifunc (void)
+{
+ /* If the vDSO is not available we fall back syscall. */
+ return (__vdso_gettimeofday ? VDSO_IFUNC_RET (__vdso_gettimeofday)
+ : __gettimeofday_syscall);
+}
+asm (".type __gettimeofday, %gnu_indirect_function");
+
+/* This is doing "libc_hidden_def (__gettimeofday)" but the compiler won't
+ let us do it in C because it doesn't know we're defining __gettimeofday
+ here in this file. */
+asm (".globl __GI___gettimeofday\n"
+ "__GI___gettimeofday = __gettimeofday");
+
+#else
-/* Get the current time of day and timezone information,
- putting it into *TV and *TZ. If TZ is NULL, *TZ is not filled.
- Returns 0 on success, -1 on errors. */
+# include <sysdep.h>
+# include <errno.h>
int
-__gettimeofday (tv, tz)
- struct timeval *tv;
- struct timezone *tz;
+__gettimeofday (struct timeval *tv, struct timezone *tz)
{
- return INLINE_VSYSCALL (gettimeofday, 2, tv, tz);
+ return INLINE_SYSCALL (gettimeofday, 2, tv, tz);
}
libc_hidden_def (__gettimeofday)
+
+#endif
weak_alias (__gettimeofday, gettimeofday)
libc_hidden_weak (gettimeofday)
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S
index 06596ce58..348aeb5ba 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S
@@ -19,17 +19,14 @@
#include <sysdep.h>
#define _ERRNO_H 1
#include <bits/errno.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
.comm __curbrk,8,8
.section ".toc","aw"
.LC__curbrk:
.tc __curbrk[TC],__curbrk
.section ".text"
-ENTRY (BP_SYM (__brk))
+ENTRY (__brk)
CALL_MCOUNT 1
- DISCARD_BOUNDS (r3) /* the bounds are meaningless, so toss 'em. */
std r3,48(r1)
DO_CALL(SYS_ify(brk))
@@ -41,6 +38,6 @@ ENTRY (BP_SYM (__brk))
blelr+
li r3,ENOMEM
TAIL_CALL_SYSCALL_ERROR
-END (BP_SYM (__brk))
+END (__brk)
-weak_alias (BP_SYM (__brk), BP_SYM (brk))
+weak_alias (__brk, brk)
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S
index f74dcae90..cf46856e1 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S
@@ -19,8 +19,6 @@
#include <sysdep.h>
#define _ERRNO_H 1
#include <bits/errno.h>
-#include <bp-sym.h>
-#include <bp-asm.h>
#define CLONE_VM 0x00000100
#define CLONE_THREAD 0x00010000
@@ -33,11 +31,8 @@
int flags [r5], void *arg [r6], void *parent_tid [r7],
void *tls [r8], void *child_tid [r9]); */
-ENTRY (BP_SYM (__clone))
+ENTRY (__clone)
CALL_MCOUNT 7
- /* GKM FIXME: add bounds checks, where sensible. */
- DISCARD_BOUNDS (r4)
- DISCARD_BOUNDS (r6)
/* Check for child_stack == NULL || fn == NULL. */
cmpdi cr0,r4,0
@@ -144,6 +139,6 @@ L(parent):
cfi_restore(r31)
PSEUDO_RET
-END (BP_SYM (__clone))
+END (__clone)
-weak_alias (BP_SYM (__clone), BP_SYM (clone))
+weak_alias (__clone, clone)
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h b/libc/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
index dfda1c889..e6e916b0f 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
@@ -136,7 +136,8 @@ enum __ptrace_setoptions
PTRACE_O_TRACEVFORKDONE = 0x00000020,
PTRACE_O_TRACEEXIT = 0x00000040,
PTRACE_O_TRACESECCOMP = 0x00000080,
- PTRACE_O_MASK = 0x000000ff
+ PTRACE_O_EXITKILL = 0x00100000,
+ PTRACE_O_MASK = 0x001000ff
};
/* Wait extended result codes for the above trace options. */
diff --git a/libc/sysdeps/unix/sysv/linux/s390/bits/mman.h b/libc/sysdeps/unix/sysv/linux/s390/bits/mman.h
index 3e7bf92f4..b788fa50d 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/bits/mman.h
+++ b/libc/sysdeps/unix/sysv/linux/s390/bits/mman.h
@@ -24,39 +24,9 @@
But the kernel header is not namespace clean. */
-/* Protections are chosen from these bits, OR'd together. The
- implementation does not necessarily support PROT_EXEC or PROT_WRITE
- without PROT_READ. The only guarantees are that no writing will be
- allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
-
-#define PROT_READ 0x1 /* Page can be read. */
-#define PROT_WRITE 0x2 /* Page can be written. */
-#define PROT_EXEC 0x4 /* Page can be executed. */
-#define PROT_NONE 0x0 /* Page can not be accessed. */
-#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of
- growsdown vma (mprotect only). */
-#define PROT_GROWSUP 0x02000000 /* Extend change to start of
- growsup vma (mprotect only). */
-
-/* Sharing types (must choose one and only one of these). */
-#define MAP_SHARED 0x01 /* Share changes. */
-#define MAP_PRIVATE 0x02 /* Changes are private. */
-#ifdef __USE_MISC
-# define MAP_TYPE 0x0f /* Mask for type of mapping. */
-#endif
-
-/* Other flags. */
-#define MAP_FIXED 0x10 /* Interpret addr exactly. */
-#ifdef __USE_MISC
-# define MAP_FILE 0
-# define MAP_ANONYMOUS 0x20 /* Don't use a file. */
-# define MAP_ANON MAP_ANONYMOUS
-#endif
-
/* These are Linux-specific. */
#ifdef __USE_MISC
# define MAP_GROWSDOWN 0x00100 /* Stack-like segment. */
-# define MAP_GROWSUP 0x00200 /* Register stack-like segment */
# define MAP_DENYWRITE 0x00800 /* ETXTBSY */
# define MAP_EXECUTABLE 0x01000 /* Mark it as an executable. */
# define MAP_LOCKED 0x02000 /* Lock the mapping. */
@@ -67,47 +37,5 @@
# define MAP_HUGETLB 0x40000 /* Create huge page mapping. */
#endif
-/* Flags to `msync'. */
-#define MS_ASYNC 1 /* Sync memory asynchronously. */
-#define MS_SYNC 4 /* Synchronous memory sync. */
-#define MS_INVALIDATE 2 /* Invalidate the caches. */
-
-/* Flags for `mlockall'. */
-#define MCL_CURRENT 1 /* Lock all currently mapped pages. */
-#define MCL_FUTURE 2 /* Lock all additions to address
- space. */
-
-/* Flags for `mremap'. */
-#ifdef __USE_GNU
-# define MREMAP_MAYMOVE 1
-# define MREMAP_FIXED 2
-#endif
-
-/* Advice to `madvise'. */
-#ifdef __USE_BSD
-# define MADV_NORMAL 0 /* No further special treatment. */
-# define MADV_RANDOM 1 /* Expect random page references. */
-# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
-# define MADV_WILLNEED 3 /* Will need these pages. */
-# define MADV_DONTNEED 4 /* Don't need these pages. */
-# define MADV_REMOVE 9 /* Remove these pages and resources. */
-# define MADV_DONTFORK 10 /* Do not inherit across fork. */
-# define MADV_DOFORK 11 /* Do inherit across fork. */
-# define MADV_MERGEABLE 12 /* KSM may merge identical pages. */
-# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */
-# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */
-# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */
-# define MADV_DONTDUMP 16 /* Explicity exclude from the core dump,
- overrides the coredump filter bits. */
-# define MADV_DODUMP 17 /* Clear the MADV_DONTDUMP flag. */
-# define MADV_HWPOISON 100 /* Poison a page for testing. */
-#endif
-
-/* The POSIX people had to invent similar names for the same things. */
-#ifdef __USE_XOPEN2K
-# define POSIX_MADV_NORMAL 0 /* No further special treatment. */
-# define POSIX_MADV_RANDOM 1 /* Expect random page references. */
-# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */
-# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */
-# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */
-#endif
+/* Include generic Linux declarations. */
+#include <bits/mman-linux.h>
diff --git a/libc/sysdeps/unix/sysv/linux/s390/bits/msq.h b/libc/sysdeps/unix/sysv/linux/s390/bits/msq.h
index 5a1f6b29e..a5eaf89dd 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/bits/msq.h
+++ b/libc/sysdeps/unix/sysv/linux/s390/bits/msq.h
@@ -26,6 +26,7 @@
#define MSG_NOERROR 010000 /* no error if message is too big */
#ifdef __USE_GNU
# define MSG_EXCEPT 020000 /* recv any msg except of specified type */
+# define MSG_COPY 040000 /* copy (not remove) all queue messages */
#endif
/* Types used in the structure definition. */
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S b/libc/sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S
index 1a3712d8c..0a2e63e78 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S
@@ -31,41 +31,42 @@
other than the PRESERVED state. */
ENTRY(__getcontext)
- lr %r5,%r2
+ lr %r1,%r2
/* sigprocmask (SIG_BLOCK, NULL, &sc->sc_mask). */
la %r2,SIG_BLOCK
slr %r3,%r3
- la %r4,SC_MASK(%r5)
+ la %r4,SC_MASK(%r1)
+ lhi %r5,_NSIG8
svc SYS_ify(rt_sigprocmask)
/* Store fpu context. */
- stfpc SC_FPC(%r5)
- std %f0,SC_FPRS(%r5)
- std %f1,SC_FPRS+8(%r5)
- std %f2,SC_FPRS+16(%r5)
- std %f3,SC_FPRS+24(%r5)
- std %f4,SC_FPRS+32(%r5)
- std %f5,SC_FPRS+40(%r5)
- std %f6,SC_FPRS+48(%r5)
- std %f7,SC_FPRS+56(%r5)
- std %f8,SC_FPRS+64(%r5)
- std %f9,SC_FPRS+72(%r5)
- std %f10,SC_FPRS+80(%r5)
- std %f11,SC_FPRS+88(%r5)
- std %f12,SC_FPRS+96(%r5)
- std %f13,SC_FPRS+104(%r5)
- std %f14,SC_FPRS+112(%r5)
- std %f15,SC_FPRS+120(%r5)
+ stfpc SC_FPC(%r1)
+ std %f0,SC_FPRS(%r1)
+ std %f1,SC_FPRS+8(%r1)
+ std %f2,SC_FPRS+16(%r1)
+ std %f3,SC_FPRS+24(%r1)
+ std %f4,SC_FPRS+32(%r1)
+ std %f5,SC_FPRS+40(%r1)
+ std %f6,SC_FPRS+48(%r1)
+ std %f7,SC_FPRS+56(%r1)
+ std %f8,SC_FPRS+64(%r1)
+ std %f9,SC_FPRS+72(%r1)
+ std %f10,SC_FPRS+80(%r1)
+ std %f11,SC_FPRS+88(%r1)
+ std %f12,SC_FPRS+96(%r1)
+ std %f13,SC_FPRS+104(%r1)
+ std %f14,SC_FPRS+112(%r1)
+ std %f15,SC_FPRS+120(%r1)
/* Set __getcontext return value to 0. */
slr %r2,%r2
/* Store access registers. */
- stam %a0,%a15,SC_ACRS(%r5)
+ stam %a0,%a15,SC_ACRS(%r1)
/* Store general purpose registers. */
- stm %r0,%r15,SC_GPRS(%r5)
+ stm %r0,%r15,SC_GPRS(%r1)
/* Return. */
br %r14
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-32/setcontext.S b/libc/sysdeps/unix/sysv/linux/s390/s390-32/setcontext.S
index fe56c24aa..ac25bea50 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/s390-32/setcontext.S
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-32/setcontext.S
@@ -31,38 +31,39 @@
other than the PRESERVED state. */
ENTRY(__setcontext)
- lr %r5,%r2
+ lr %r1,%r2
/* sigprocmask (SIG_SETMASK, &sc->sc_mask, NULL). */
la %r2,SIG_BLOCK
- la %r3,SC_MASK(%r5)
+ la %r3,SC_MASK(%r1)
slr %r4,%r4
+ lhi %r5,_NSIG8
svc SYS_ify(rt_sigprocmask)
/* Load fpu context. */
- lfpc SC_FPC(%r5)
- ld %f0,SC_FPRS(%r5)
- ld %f1,SC_FPRS+8(%r5)
- ld %f2,SC_FPRS+16(%r5)
- ld %f3,SC_FPRS+24(%r5)
- ld %f4,SC_FPRS+32(%r5)
- ld %f5,SC_FPRS+40(%r5)
- ld %f6,SC_FPRS+48(%r5)
- ld %f7,SC_FPRS+56(%r5)
- ld %f8,SC_FPRS+64(%r5)
- ld %f9,SC_FPRS+72(%r5)
- ld %f10,SC_FPRS+80(%r5)
- ld %f11,SC_FPRS+88(%r5)
- ld %f12,SC_FPRS+96(%r5)
- ld %f13,SC_FPRS+104(%r5)
- ld %f14,SC_FPRS+112(%r5)
- ld %f15,SC_FPRS+120(%r5)
+ lfpc SC_FPC(%r1)
+ ld %f0,SC_FPRS(%r1)
+ ld %f1,SC_FPRS+8(%r1)
+ ld %f2,SC_FPRS+16(%r1)
+ ld %f3,SC_FPRS+24(%r1)
+ ld %f4,SC_FPRS+32(%r1)
+ ld %f5,SC_FPRS+40(%r1)
+ ld %f6,SC_FPRS+48(%r1)
+ ld %f7,SC_FPRS+56(%r1)
+ ld %f8,SC_FPRS+64(%r1)
+ ld %f9,SC_FPRS+72(%r1)
+ ld %f10,SC_FPRS+80(%r1)
+ ld %f11,SC_FPRS+88(%r1)
+ ld %f12,SC_FPRS+96(%r1)
+ ld %f13,SC_FPRS+104(%r1)
+ ld %f14,SC_FPRS+112(%r1)
+ ld %f15,SC_FPRS+120(%r1)
/* Don't touch %a0, used for thread purposes. */
- lam %a1,%a15,SC_ACRS+4(%r5)
+ lam %a1,%a15,SC_ACRS+4(%r1)
/* Load general purpose registers. */
- lm %r0,%r15,SC_GPRS(%r5)
+ lm %r0,%r15,SC_GPRS(%r1)
/* Return. */
br %r14
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S b/libc/sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S
index 9a4b2b987..ecb0b3f80 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S
@@ -34,12 +34,13 @@
ENTRY(__swapcontext)
lr %r1,%r2
- lr %r5,%r3
+ lr %r0,%r3
/* sigprocmask (SIG_BLOCK, NULL, &sc->sc_mask). */
la %r2,SIG_BLOCK
slr %r3,%r3
la %r4,SC_MASK(%r1)
+ lhi %r5,_NSIG8
svc SYS_ify(rt_sigprocmask)
/* Store fpu context. */
@@ -72,11 +73,14 @@ ENTRY(__swapcontext)
/* sigprocmask (SIG_SETMASK, &sc->sc_mask, NULL). */
la %r2,SIG_BLOCK
+ lr %r5,%r0
la %r3,SC_MASK(%r5)
slr %r4,%r4
+ lhi %r5,_NSIG8
svc SYS_ify(rt_sigprocmask)
/* Load fpu context. */
+ lr %r5,%r0
lfpc SC_FPC(%r5)
ld %f0,SC_FPRS(%r5)
ld %f1,SC_FPRS+8(%r5)
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S b/libc/sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S
index 68e89102a..7c406cb23 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S
@@ -31,41 +31,42 @@
other than the PRESERVED state. */
ENTRY(__getcontext)
- lgr %r5,%r2
+ lgr %r1,%r2
/* sigprocmask (SIG_BLOCK, NULL, &sc->sc_mask). */
la %r2,SIG_BLOCK
slgr %r3,%r3
- la %r4,SC_MASK(%r5)
+ la %r4,SC_MASK(%r1)
+ lghi %r5,_NSIG8
svc SYS_ify(rt_sigprocmask)
/* Store fpu context. */
- stfpc SC_FPC(%r5)
- std %f0,SC_FPRS(%r5)
- std %f1,SC_FPRS+8(%r5)
- std %f2,SC_FPRS+16(%r5)
- std %f3,SC_FPRS+24(%r5)
- std %f4,SC_FPRS+32(%r5)
- std %f5,SC_FPRS+40(%r5)
- std %f6,SC_FPRS+48(%r5)
- std %f7,SC_FPRS+56(%r5)
- std %f8,SC_FPRS+64(%r5)
- std %f9,SC_FPRS+72(%r5)
- std %f10,SC_FPRS+80(%r5)
- std %f11,SC_FPRS+88(%r5)
- std %f12,SC_FPRS+96(%r5)
- std %f13,SC_FPRS+104(%r5)
- std %f14,SC_FPRS+112(%r5)
- std %f15,SC_FPRS+120(%r5)
+ stfpc SC_FPC(%r1)
+ std %f0,SC_FPRS(%r1)
+ std %f1,SC_FPRS+8(%r1)
+ std %f2,SC_FPRS+16(%r1)
+ std %f3,SC_FPRS+24(%r1)
+ std %f4,SC_FPRS+32(%r1)
+ std %f5,SC_FPRS+40(%r1)
+ std %f6,SC_FPRS+48(%r1)
+ std %f7,SC_FPRS+56(%r1)
+ std %f8,SC_FPRS+64(%r1)
+ std %f9,SC_FPRS+72(%r1)
+ std %f10,SC_FPRS+80(%r1)
+ std %f11,SC_FPRS+88(%r1)
+ std %f12,SC_FPRS+96(%r1)
+ std %f13,SC_FPRS+104(%r1)
+ std %f14,SC_FPRS+112(%r1)
+ std %f15,SC_FPRS+120(%r1)
/* Set __getcontext return value to 0. */
slgr %r2,%r2
/* Store access registers. */
- stam %a0,%a15,SC_ACRS(%r5)
+ stam %a0,%a15,SC_ACRS(%r1)
/* Store general purpose registers. */
- stmg %r0,%r15,SC_GPRS(%r5)
+ stmg %r0,%r15,SC_GPRS(%r1)
/* Return. */
br %r14
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S b/libc/sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S
index 7415bd938..8157327bf 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S
@@ -31,38 +31,39 @@
other than the PRESERVED state. */
ENTRY(__setcontext)
- lgr %r5,%r2
+ lgr %r1,%r2
/* sigprocmask (SIG_SETMASK, &sc->sc_mask, NULL). */
la %r2,SIG_BLOCK
- la %r3,SC_MASK(%r5)
+ la %r3,SC_MASK(%r1)
slgr %r4,%r4
+ lghi %r5,_NSIG8
svc SYS_ify(rt_sigprocmask)
/* Load fpu context. */
- lfpc SC_FPC(%r5)
- ld %f0,SC_FPRS(%r5)
- ld %f1,SC_FPRS+8(%r5)
- ld %f2,SC_FPRS+16(%r5)
- ld %f3,SC_FPRS+24(%r5)
- ld %f4,SC_FPRS+32(%r5)
- ld %f5,SC_FPRS+40(%r5)
- ld %f6,SC_FPRS+48(%r5)
- ld %f7,SC_FPRS+56(%r5)
- ld %f8,SC_FPRS+64(%r5)
- ld %f9,SC_FPRS+72(%r5)
- ld %f10,SC_FPRS+80(%r5)
- ld %f11,SC_FPRS+88(%r5)
- ld %f12,SC_FPRS+96(%r5)
- ld %f13,SC_FPRS+104(%r5)
- ld %f14,SC_FPRS+112(%r5)
- ld %f15,SC_FPRS+120(%r5)
+ lfpc SC_FPC(%r1)
+ ld %f0,SC_FPRS(%r1)
+ ld %f1,SC_FPRS+8(%r1)
+ ld %f2,SC_FPRS+16(%r1)
+ ld %f3,SC_FPRS+24(%r1)
+ ld %f4,SC_FPRS+32(%r1)
+ ld %f5,SC_FPRS+40(%r1)
+ ld %f6,SC_FPRS+48(%r1)
+ ld %f7,SC_FPRS+56(%r1)
+ ld %f8,SC_FPRS+64(%r1)
+ ld %f9,SC_FPRS+72(%r1)
+ ld %f10,SC_FPRS+80(%r1)
+ ld %f11,SC_FPRS+88(%r1)
+ ld %f12,SC_FPRS+96(%r1)
+ ld %f13,SC_FPRS+104(%r1)
+ ld %f14,SC_FPRS+112(%r1)
+ ld %f15,SC_FPRS+120(%r1)
/* Don't touch %a0 and %a1, used for thread purposes. */
- lam %a2,%a15,SC_ACRS+8(%r5)
+ lam %a2,%a15,SC_ACRS+8(%r1)
/* Load general purpose registers. */
- lmg %r0,%r15,SC_GPRS(%r5)
+ lmg %r0,%r15,SC_GPRS(%r1)
/* Return. */
br %r14
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S b/libc/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S
index 2d8f0d50e..a08e68cdd 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S
@@ -34,12 +34,13 @@
ENTRY(__swapcontext)
lgr %r1,%r2
- lgr %r5,%r3
+ lgr %r0,%r3
/* sigprocmask (SIG_BLOCK, NULL, &sc->sc_mask). */
la %r2,SIG_BLOCK
slgr %r3,%r3
la %r4,SC_MASK(%r1)
+ lghi %r5,_NSIG8
svc SYS_ify(rt_sigprocmask)
/* Store fpu context. */
@@ -72,11 +73,14 @@ ENTRY(__swapcontext)
/* sigprocmask (SIG_SETMASK, &sc->sc_mask, NULL). */
la %r2,SIG_BLOCK
+ lgr %r5,%r0
la %r3,SC_MASK(%r5)
+ lghi %r5,_NSIG8
slgr %r4,%r4
svc SYS_ify(rt_sigprocmask)
/* Load fpu context. */
+ lgr %r5,%r0
lfpc SC_FPC(%r5)
ld %f0,SC_FPRS(%r5)
ld %f1,SC_FPRS+8(%r5)
diff --git a/libc/sysdeps/unix/sysv/linux/s390/sys/ptrace.h b/libc/sysdeps/unix/sysv/linux/s390/sys/ptrace.h
index b9062dc1a..ca2ebb959 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/sys/ptrace.h
+++ b/libc/sysdeps/unix/sysv/linux/s390/sys/ptrace.h
@@ -175,7 +175,8 @@ enum __ptrace_setoptions
PTRACE_O_TRACEVFORKDONE = 0x00000020,
PTRACE_O_TRACEEXIT = 0x00000040,
PTRACE_O_TRACESECCOMP = 0x00000080,
- PTRACE_O_MASK = 0x000000ff
+ PTRACE_O_EXITKILL = 0x00100000,
+ PTRACE_O_MASK = 0x001000ff
};
/* Wait extended result codes for the above trace options. */
diff --git a/libc/sysdeps/unix/sysv/linux/s390/ucontext_i.sym b/libc/sysdeps/unix/sysv/linux/s390/ucontext_i.sym
index 525b54300..6cc9f1962 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/ucontext_i.sym
+++ b/libc/sysdeps/unix/sysv/linux/s390/ucontext_i.sym
@@ -8,6 +8,8 @@ SIG_BLOCK
SIG_UNBLOCK
SIG_SETMASK
+_NSIG8 (_NSIG / 8)
+
#define ucontext(member) offsetof (ucontext_t, member)
#define mcontext(member) ucontext (uc_mcontext.member)
diff --git a/libc/sysdeps/unix/sysv/linux/sh/bits/mman.h b/libc/sysdeps/unix/sysv/linux/sh/bits/mman.h
index 40da97e2f..396a9b918 100644
--- a/libc/sysdeps/unix/sysv/linux/sh/bits/mman.h
+++ b/libc/sysdeps/unix/sysv/linux/sh/bits/mman.h
@@ -23,36 +23,6 @@
/* The following definitions basically come from the kernel headers.
But the kernel header is not namespace clean. */
-
-/* Protections are chosen from these bits, OR'd together. The
- implementation does not necessarily support PROT_EXEC or PROT_WRITE
- without PROT_READ. The only guarantees are that no writing will be
- allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
-
-#define PROT_READ 0x1 /* Page can be read. */
-#define PROT_WRITE 0x2 /* Page can be written. */
-#define PROT_EXEC 0x4 /* Page can be executed. */
-#define PROT_NONE 0x0 /* Page can not be accessed. */
-#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of
- growsdown vma (mprotect only). */
-#define PROT_GROWSUP 0x02000000 /* Extend change to start of
- growsup vma (mprotect only). */
-
-/* Sharing types (must choose one and only one of these). */
-#define MAP_SHARED 0x01 /* Share changes. */
-#define MAP_PRIVATE 0x02 /* Changes are private. */
-#ifdef __USE_MISC
-# define MAP_TYPE 0x0f /* Mask for type of mapping. */
-#endif
-
-/* Other flags. */
-#define MAP_FIXED 0x10 /* Interpret addr exactly. */
-#ifdef __USE_MISC
-# define MAP_FILE 0
-# define MAP_ANONYMOUS 0x20 /* Don't use a file. */
-# define MAP_ANON MAP_ANONYMOUS
-#endif
-
/* These are Linux-specific. */
#ifdef __USE_MISC
# define MAP_GROWSDOWN 0x0100 /* Stack-like segment. */
@@ -66,47 +36,5 @@
# define MAP_HUGETLB 0x40000 /* Create huge page mapping. */
#endif
-/* Flags to `msync'. */
-#define MS_ASYNC 1 /* Sync memory asynchronously. */
-#define MS_SYNC 4 /* Synchronous memory sync. */
-#define MS_INVALIDATE 2 /* Invalidate the caches. */
-
-/* Flags for `mlockall'. */
-#define MCL_CURRENT 1 /* Lock all currently mapped pages. */
-#define MCL_FUTURE 2 /* Lock all additions to address
- space. */
-
-/* Flags for `mremap'. */
-#ifdef __USE_GNU
-# define MREMAP_MAYMOVE 1
-# define MREMAP_FIXED 2
-#endif
-
-/* Advice to `madvise'. */
-#ifdef __USE_BSD
-# define MADV_NORMAL 0 /* No further special treatment. */
-# define MADV_RANDOM 1 /* Expect random page references. */
-# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
-# define MADV_WILLNEED 3 /* Will need these pages. */
-# define MADV_DONTNEED 4 /* Don't need these pages. */
-# define MADV_REMOVE 9 /* Remove these pages and resources. */
-# define MADV_DONTFORK 10 /* Do not inherit across fork. */
-# define MADV_DOFORK 11 /* Do inherit across fork. */
-# define MADV_MERGEABLE 12 /* KSM may merge identical pages. */
-# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */
-# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */
-# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */
-# define MADV_DONTDUMP 16 /* Explicity exclude from the core dump,
- overrides the coredump filter bits. */
-# define MADV_DODUMP 17 /* Clear the MADV_DONTDUMP flag. */
-# define MADV_HWPOISON 100 /* Poison a page for testing. */
-#endif
-
-/* The POSIX people had to invent similar names for the same things. */
-#ifdef __USE_XOPEN2K
-# define POSIX_MADV_NORMAL 0 /* No further special treatment. */
-# define POSIX_MADV_RANDOM 1 /* Expect random page references. */
-# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */
-# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */
-# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */
-#endif
+/* Include generic Linux declarations. */
+#include <bits/mman-linux.h>
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/bits/mman.h b/libc/sysdeps/unix/sysv/linux/sparc/bits/mman.h
index 616e24333..ad0389ca3 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/bits/mman.h
+++ b/libc/sysdeps/unix/sysv/linux/sparc/bits/mman.h
@@ -24,36 +24,6 @@
But the kernel header is not namespace clean. */
-/* Protections are chosen from these bits, OR'd together. The
- implementation does not necessarily support PROT_EXEC or PROT_WRITE
- without PROT_READ. The only guarantees are that no writing will be
- allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
-
-#define PROT_READ 0x1 /* Page can be read. */
-#define PROT_WRITE 0x2 /* Page can be written. */
-#define PROT_EXEC 0x4 /* Page can be executed. */
-#define PROT_NONE 0x0 /* Page can not be accessed. */
-#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of
- growsdown vma (mprotect only). */
-#define PROT_GROWSUP 0x02000000 /* Extend change to start of
- growsup vma (mprotect only). */
-
-/* Sharing types (must choose one and only one of these). */
-#define MAP_SHARED 0x01 /* Share changes. */
-#define MAP_PRIVATE 0x02 /* Changes are private. */
-#ifdef __USE_MISC
-# define MAP_TYPE 0x0f /* Mask for type of mapping. */
-#endif
-
-/* Other flags. */
-#define MAP_FIXED 0x10 /* Interpret addr exactly. */
-#ifdef __USE_MISC
-# define MAP_FILE 0x00
-# define MAP_ANONYMOUS 0x20 /* Don't use a file. */
-# define MAP_ANON MAP_ANONYMOUS
-# define MAP_RENAME MAP_ANONYMOUS
-#endif
-
/* These are Linux-specific. */
#ifdef __USE_MISC
# define MAP_GROWSDOWN 0x0200 /* Stack-like segment. */
@@ -68,48 +38,14 @@
# define MAP_HUGETLB 0x40000 /* Create huge page mapping. */
#endif
-/* Flags to `msync'. */
-#define MS_ASYNC 1 /* Sync memory asynchronously. */
-#define MS_SYNC 4 /* Synchronous memory sync. */
-#define MS_INVALIDATE 2 /* Invalidate the caches. */
-
/* Flags for `mlockall'. */
#define MCL_CURRENT 0x2000 /* Lock all currently mapped pages. */
#define MCL_FUTURE 0x4000 /* Lock all additions to address
space. */
+/* Include generic Linux declarations. */
+#include <bits/mman-linux.h>
-/* Flags for `mremap'. */
-#ifdef __USE_GNU
-# define MREMAP_MAYMOVE 1
-# define MREMAP_FIXED 2
-#endif
-
-/* Advice to `madvise'. */
-#ifdef __USE_BSD
-# define MADV_NORMAL 0 /* No further special treatment. */
-# define MADV_RANDOM 1 /* Expect random page references. */
-# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
-# define MADV_WILLNEED 3 /* Will need these pages. */
-# define MADV_DONTNEED 4 /* Don't need these pages. */
-# define MADV_FREE 5 /* Content can be freed (Solaris). */
-# define MADV_REMOVE 9 /* Remove these pages and resources. */
-# define MADV_DONTFORK 10 /* Do not inherit across fork. */
-# define MADV_DOFORK 11 /* Do inherit across fork. */
-# define MADV_MERGEABLE 12 /* KSM may merge identical pages. */
-# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */
-# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */
-# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */
-# define MADV_DONTDUMP 16 /* Explicity exclude from the core dump,
- overrides the coredump filter bits. */
-# define MADV_DODUMP 17 /* Clear the MADV_DONTDUMP flag. */
-# define MADV_HWPOISON 100 /* Poison a page for testing. */
-#endif
-
-/* The POSIX people had to invent similar names for the same things. */
-#ifdef __USE_XOPEN2K
-# define POSIX_MADV_NORMAL 0 /* No further special treatment. */
-# define POSIX_MADV_RANDOM 1 /* Expect random page references. */
-# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */
-# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */
-# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */
+/* Other flags. */
+#ifdef __USE_MISC
+# define MAP_RENAME MAP_ANONYMOUS
#endif
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/bits/msq.h b/libc/sysdeps/unix/sysv/linux/sparc/bits/msq.h
index 84c4b858b..0a0192732 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/bits/msq.h
+++ b/libc/sysdeps/unix/sysv/linux/sparc/bits/msq.h
@@ -26,6 +26,7 @@
#define MSG_NOERROR 010000 /* no error if message is too big */
#ifdef __USE_GNU
# define MSG_EXCEPT 020000 /* recv any msg except of specified type */
+# define MSG_COPY 040000 /* copy (not remove) all queue messages */
#endif
/* Types used in the structure definition. */
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h b/libc/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h
index bd6fd536d..7ba8f5f25 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h
@@ -219,7 +219,8 @@ enum __ptrace_setoptions
PTRACE_O_TRACEVFORKDONE = 0x00000020,
PTRACE_O_TRACEEXIT = 0x00000040,
PTRACE_O_TRACESECCOMP = 0x00000080,
- PTRACE_O_MASK = 0x000000ff
+ PTRACE_O_EXITKILL = 0x00100000,
+ PTRACE_O_MASK = 0x001000ff
};
/* Wait extended result codes for the above trace options. */
diff --git a/libc/sysdeps/unix/sysv/linux/sys/ptrace.h b/libc/sysdeps/unix/sysv/linux/sys/ptrace.h
index d04fab599..08709bf64 100644
--- a/libc/sysdeps/unix/sysv/linux/sys/ptrace.h
+++ b/libc/sysdeps/unix/sysv/linux/sys/ptrace.h
@@ -166,7 +166,8 @@ enum __ptrace_setoptions
PTRACE_O_TRACEVFORKDONE = 0x00000020,
PTRACE_O_TRACEEXIT = 0x00000040,
PTRACE_O_TRACESECCOMP = 0x00000080,
- PTRACE_O_MASK = 0x000000ff
+ PTRACE_O_EXITKILL = 0x00100000,
+ PTRACE_O_MASK = 0x001000ff
};
/* Wait extended result codes for the above trace options. */
diff --git a/libc/sysdeps/unix/sysv/linux/times.c b/libc/sysdeps/unix/sysv/linux/times.c
index f3b5f014e..2a5caf2cd 100644
--- a/libc/sysdeps/unix/sysv/linux/times.c
+++ b/libc/sysdeps/unix/sysv/linux/times.c
@@ -26,13 +26,14 @@ __times (struct tms *buf)
INTERNAL_SYSCALL_DECL (err);
clock_t ret = INTERNAL_SYSCALL (times, err, 1, buf);
if (INTERNAL_SYSCALL_ERROR_P (ret, err)
- && __builtin_expect (INTERNAL_SYSCALL_ERRNO (ret, err) == EFAULT, 0))
+ && __builtin_expect (INTERNAL_SYSCALL_ERRNO (ret, err) == EFAULT, 0)
+ && buf)
{
/* This might be an error or not. For architectures which have
no separate return value and error indicators we cannot
distinguish a return value of -1 from an error. Do it the
- hard way. We crash applications which pass in an invalid BUF
- pointer. */
+ hard way. We crash applications which pass in an invalid
+ non-NULL BUF pointer. Linux allows BUF to be NULL. */
#define touch(v) \
do { \
clock_t temp = v; \
@@ -44,7 +45,8 @@ __times (struct tms *buf)
touch (buf->tms_cutime);
touch (buf->tms_cstime);
- /* If we come here the memory is valid and the kernel did not
+ /* If we come here the memory is valid (or BUF is NULL, which is
+ a valid condition for the kernel syscall) and the kernel did not
return an EFAULT error. Return the value given by the kernel. */
}
diff --git a/libc/sysdeps/unix/sysv/linux/x86/bits/mman.h b/libc/sysdeps/unix/sysv/linux/x86/bits/mman.h
index 591df139d..a2fa80879 100644
--- a/libc/sysdeps/unix/sysv/linux/x86/bits/mman.h
+++ b/libc/sysdeps/unix/sysv/linux/x86/bits/mman.h
@@ -23,34 +23,8 @@
/* The following definitions basically come from the kernel headers.
But the kernel header is not namespace clean. */
-
-/* Protections are chosen from these bits, OR'd together. The
- implementation does not necessarily support PROT_EXEC or PROT_WRITE
- without PROT_READ. The only guarantees are that no writing will be
- allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
-
-#define PROT_READ 0x1 /* Page can be read. */
-#define PROT_WRITE 0x2 /* Page can be written. */
-#define PROT_EXEC 0x4 /* Page can be executed. */
-#define PROT_NONE 0x0 /* Page can not be accessed. */
-#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of
- growsdown vma (mprotect only). */
-#define PROT_GROWSUP 0x02000000 /* Extend change to start of
- growsup vma (mprotect only). */
-
-/* Sharing types (must choose one and only one of these). */
-#define MAP_SHARED 0x01 /* Share changes. */
-#define MAP_PRIVATE 0x02 /* Changes are private. */
-#ifdef __USE_MISC
-# define MAP_TYPE 0x0f /* Mask for type of mapping. */
-#endif
-
/* Other flags. */
-#define MAP_FIXED 0x10 /* Interpret addr exactly. */
#ifdef __USE_MISC
-# define MAP_FILE 0
-# define MAP_ANONYMOUS 0x20 /* Don't use a file. */
-# define MAP_ANON MAP_ANONYMOUS
# define MAP_32BIT 0x40 /* Only give out 32-bit addresses. */
#endif
@@ -67,47 +41,5 @@
# define MAP_HUGETLB 0x40000 /* Create huge page mapping. */
#endif
-/* Flags to `msync'. */
-#define MS_ASYNC 1 /* Sync memory asynchronously. */
-#define MS_SYNC 4 /* Synchronous memory sync. */
-#define MS_INVALIDATE 2 /* Invalidate the caches. */
-
-/* Flags for `mlockall'. */
-#define MCL_CURRENT 1 /* Lock all currently mapped pages. */
-#define MCL_FUTURE 2 /* Lock all additions to address
- space. */
-
-/* Flags for `mremap'. */
-#ifdef __USE_GNU
-# define MREMAP_MAYMOVE 1
-# define MREMAP_FIXED 2
-#endif
-
-/* Advice to `madvise'. */
-#ifdef __USE_BSD
-# define MADV_NORMAL 0 /* No further special treatment. */
-# define MADV_RANDOM 1 /* Expect random page references. */
-# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
-# define MADV_WILLNEED 3 /* Will need these pages. */
-# define MADV_DONTNEED 4 /* Don't need these pages. */
-# define MADV_REMOVE 9 /* Remove these pages and resources. */
-# define MADV_DONTFORK 10 /* Do not inherit across fork. */
-# define MADV_DOFORK 11 /* Do inherit across fork. */
-# define MADV_MERGEABLE 12 /* KSM may merge identical pages. */
-# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */
-# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */
-# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */
-# define MADV_DONTDUMP 16 /* Explicity exclude from the core dump,
- overrides the coredump filter bits. */
-# define MADV_DODUMP 17 /* Clear the MADV_DONTDUMP flag. */
-# define MADV_HWPOISON 100 /* Poison a page for testing. */
-#endif
-
-/* The POSIX people had to invent similar names for the same things. */
-#ifdef __USE_XOPEN2K
-# define POSIX_MADV_NORMAL 0 /* No further special treatment. */
-# define POSIX_MADV_RANDOM 1 /* Expect random page references. */
-# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */
-# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */
-# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */
-#endif
+/* Include generic Linux declarations. */
+#include <bits/mman-linux.h>
diff --git a/libc/sysdeps/unix/sysv/linux/x86/bits/msq.h b/libc/sysdeps/unix/sysv/linux/x86/bits/msq.h
index ef5cc3868..9355e465d 100644
--- a/libc/sysdeps/unix/sysv/linux/x86/bits/msq.h
+++ b/libc/sysdeps/unix/sysv/linux/x86/bits/msq.h
@@ -25,6 +25,7 @@
#define MSG_NOERROR 010000 /* no error if message is too big */
#ifdef __USE_GNU
# define MSG_EXCEPT 020000 /* recv any msg except of specified type */
+# define MSG_COPY 040000 /* copy (not remove) all queue messages */
#endif
/* Types used in the structure definition. */
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libpthread.abilist b/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libpthread.abilist
index ee6993291..b07d16f78 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libpthread.abilist
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libpthread.abilist
@@ -73,7 +73,6 @@ GLIBC_2.16
pause F
pread F
pread64 F
- pthread_atfork F
pthread_attr_destroy F
pthread_attr_getaffinity_np F
pthread_attr_getdetachstate F