summaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/framestate.c3
-rw-r--r--sysdeps/generic/libgcc_s.h2
-rw-r--r--sysdeps/ia64/memchr.S11
-rw-r--r--sysdeps/powerpc/fpu/e_sqrt.c6
-rw-r--r--sysdeps/powerpc/fpu/e_sqrtf.c6
-rw-r--r--sysdeps/unix/grantpt.c4
-rw-r--r--sysdeps/unix/sysv/linux/bits/sched.h12
-rw-r--r--sysdeps/unix/sysv/linux/grantpt.c42
-rw-r--r--sysdeps/unix/sysv/linux/i386/bits/fcntl.h4
-rw-r--r--sysdeps/unix/sysv/linux/i386/bits/mman.h21
-rw-r--r--sysdeps/unix/sysv/linux/i386/fallocate.c6
-rw-r--r--sysdeps/unix/sysv/linux/i386/fallocate64.c6
-rw-r--r--sysdeps/unix/sysv/linux/ia64/bits/fcntl.h4
-rw-r--r--sysdeps/unix/sysv/linux/ia64/bits/mman.h22
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h8
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/mman.h22
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c44
-rw-r--r--sysdeps/unix/sysv/linux/s390/bits/fcntl.h4
-rw-r--r--sysdeps/unix/sysv/linux/s390/bits/mman.h21
-rw-r--r--sysdeps/unix/sysv/linux/sh/bits/fcntl.h8
-rw-r--r--sysdeps/unix/sysv/linux/sh/bits/mman.h22
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/fcntl.h4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/mman.h24
-rw-r--r--sysdeps/unix/sysv/linux/sync_file_range.c10
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h8
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/bits/mman.h21
26 files changed, 246 insertions, 99 deletions
diff --git a/sysdeps/generic/framestate.c b/sysdeps/generic/framestate.c
index a912a8c375..80375bba98 100644
--- a/sysdeps/generic/framestate.c
+++ b/sysdeps/generic/framestate.c
@@ -24,6 +24,7 @@
#define __frame_state_for fallback_frame_state_for
#include <unwind-dw2.c>
#undef __frame_state_for
+#include <libgcc_s.h>
typedef struct frame_state * (*framesf)(void *pc, struct frame_state *);
struct frame_state *__frame_state_for (void *pc,
@@ -36,7 +37,7 @@ __frame_state_for (void *pc, struct frame_state *frame_state)
if (frame_state_for == NULL)
{
- void *handle = __libc_dlopen ("libgcc_s.so.1");
+ void *handle = __libc_dlopen (LIBGCC_S_SO);
if (handle == NULL
|| (frame_state_for
diff --git a/sysdeps/generic/libgcc_s.h b/sysdeps/generic/libgcc_s.h
new file mode 100644
index 0000000000..e74a1034ca
--- /dev/null
+++ b/sysdeps/generic/libgcc_s.h
@@ -0,0 +1,2 @@
+/* Name of libgcc_s library provided by gcc. */
+#define LIBGCC_S_SO "libgcc_s.so.1"
diff --git a/sysdeps/ia64/memchr.S b/sysdeps/ia64/memchr.S
index cd062b2dd5..cdd71ca5a5 100644
--- a/sysdeps/ia64/memchr.S
+++ b/sysdeps/ia64/memchr.S
@@ -126,7 +126,16 @@ ENTRY(__memchr)
br.ret.sptk.many b0
.recovery:
- adds ret0 = -((MEMLAT + 1) * 8), ret0;;
+#if MEMLAT != 6
+# error "MEMLAT must be 6!"
+#endif
+(p[MEMLAT-6]) add ret0 = -8, ret0;;
+(p[MEMLAT-5]) add ret0 = -8, ret0;;
+(p[MEMLAT-4]) add ret0 = -8, ret0;;
+(p[MEMLAT-3]) add ret0 = -8, ret0;;
+(p[MEMLAT-2]) add ret0 = -8, ret0;;
+(p[MEMLAT-1]) add ret0 = -8, ret0;;
+(p[MEMLAT]) add ret0 = -8, ret0;;
(p[MEMLAT+1]) add ret0 = -8, ret0;;
(p[MEMLAT+2]) add ret0 = -8, ret0;;
.l4:
diff --git a/sysdeps/powerpc/fpu/e_sqrt.c b/sysdeps/powerpc/fpu/e_sqrt.c
index 24e0dd3523..e95b786a00 100644
--- a/sysdeps/powerpc/fpu/e_sqrt.c
+++ b/sysdeps/powerpc/fpu/e_sqrt.c
@@ -35,7 +35,7 @@ extern const float __t_sqrt[1024];
/* The method is based on a description in
Computation of elementary functions on the IBM RISC System/6000 processor,
P. W. Markstein, IBM J. Res. Develop, 34(1) 1990.
- Basically, it consists of two interleaved Newton-Rhapson approximations,
+ Basically, it consists of two interleaved Newton-Raphson approximations,
one to find the actual square root, and one to find its reciprocal
without the expense of a division operation. The tricky bit here
is the use of the POWER/PowerPC multiply-add operation to get the
@@ -44,7 +44,7 @@ extern const float __t_sqrt[1024];
The argument reduction works by a combination of table lookup to
obtain the initial guesses, and some careful modification of the
generated guesses (which mostly runs on the integer unit, while the
- Newton-Rhapson is running on the FPU). */
+ Newton-Raphson is running on the FPU). */
#ifdef __STDC__
double
@@ -102,7 +102,7 @@ __slow_ieee754_sqrt (x)
/* complete the INSERT_WORDS (sx, sxi, xi1) operation. */
sx = iw_u.value;
- /* Here we have three Newton-Rhapson iterations each of a
+ /* Here we have three Newton-Raphson iterations each of a
division and a square root and the remainder of the
argument reduction, all interleaved. */
sd = -(sg * sg - sx);
diff --git a/sysdeps/powerpc/fpu/e_sqrtf.c b/sysdeps/powerpc/fpu/e_sqrtf.c
index 8e8138a17d..ca44fac559 100644
--- a/sysdeps/powerpc/fpu/e_sqrtf.c
+++ b/sysdeps/powerpc/fpu/e_sqrtf.c
@@ -35,7 +35,7 @@ extern const float __t_sqrt[1024];
/* The method is based on a description in
Computation of elementary functions on the IBM RISC System/6000 processor,
P. W. Markstein, IBM J. Res. Develop, 34(1) 1990.
- Basically, it consists of two interleaved Newton-Rhapson approximations,
+ Basically, it consists of two interleaved Newton-Raphson approximations,
one to find the actual square root, and one to find its reciprocal
without the expense of a division operation. The tricky bit here
is the use of the POWER/PowerPC multiply-add operation to get the
@@ -44,7 +44,7 @@ extern const float __t_sqrt[1024];
The argument reduction works by a combination of table lookup to
obtain the initial guesses, and some careful modification of the
generated guesses (which mostly runs on the integer unit, while the
- Newton-Rhapson is running on the FPU). */
+ Newton-Raphson is running on the FPU). */
#ifdef __STDC__
float
@@ -90,7 +90,7 @@ __slow_ieee754_sqrtf (x)
sg = t_sqrt[0];
sy = t_sqrt[1];
- /* Here we have three Newton-Rhapson iterations each of a
+ /* Here we have three Newton-Raphson iterations each of a
division and a square root and the remainder of the
argument reduction, all interleaved. */
sd = -(sg * sg - sx);
diff --git a/sysdeps/unix/grantpt.c b/sysdeps/unix/grantpt.c
index 8c299e9147..b02bf7cccf 100644
--- a/sysdeps/unix/grantpt.c
+++ b/sysdeps/unix/grantpt.c
@@ -190,6 +190,10 @@ grantpt (int fd)
if (__dup2 (fd, PTY_FILENO) < 0)
_exit (FAIL_EBADF);
+#ifdef CLOSE_ALL_FDS
+ CLOSE_ALL_FDS ();
+#endif
+
execle (_PATH_PT_CHOWN, basename (_PATH_PT_CHOWN), NULL, NULL);
_exit (FAIL_EXEC);
}
diff --git a/sysdeps/unix/sysv/linux/bits/sched.h b/sysdeps/unix/sysv/linux/bits/sched.h
index 95d05b4ab2..18269a99b9 100644
--- a/sysdeps/unix/sysv/linux/bits/sched.h
+++ b/sysdeps/unix/sysv/linux/bits/sched.h
@@ -1,6 +1,6 @@
/* Definitions of constants and data structure for POSIX 1003.1b-1993
scheduling interface.
- Copyright (C) 1996-1999,2001-2003,2005,2006,2007,2008
+ Copyright (C) 1996-1999,2001-2003,2005,2006,2007,2008,2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -154,7 +154,7 @@ typedef struct
(__extension__ \
({ size_t __cpu = (cpu); \
__cpu < 8 * (setsize) \
- ? ((((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \
+ ? ((((__const __cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \
& __CPUMASK (__cpu))) != 0 \
: 0; }))
@@ -167,8 +167,8 @@ typedef struct
# else
# define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \
(__extension__ \
- ({ __cpu_mask *__arr1 = (cpusetp1)->__bits; \
- __cpu_mask *__arr2 = (cpusetp2)->__bits; \
+ ({ __const __cpu_mask *__arr1 = (cpusetp1)->__bits; \
+ __const __cpu_mask *__arr2 = (cpusetp2)->__bits; \
size_t __imax = (setsize) / sizeof (__cpu_mask); \
size_t __i; \
for (__i = 0; __i < __imax; ++__i) \
@@ -180,8 +180,8 @@ typedef struct
# define __CPU_OP_S(setsize, destset, srcset1, srcset2, op) \
(__extension__ \
({ cpu_set_t *__dest = (destset); \
- __cpu_mask *__arr1 = (srcset1)->__bits; \
- __cpu_mask *__arr2 = (srcset2)->__bits; \
+ __const __cpu_mask *__arr1 = (srcset1)->__bits; \
+ __const __cpu_mask *__arr2 = (srcset2)->__bits; \
size_t __imax = (setsize) / sizeof (__cpu_mask); \
size_t __i; \
for (__i = 0; __i < __imax; ++__i) \
diff --git a/sysdeps/unix/sysv/linux/grantpt.c b/sysdeps/unix/sysv/linux/grantpt.c
new file mode 100644
index 0000000000..f2fc60f83a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/grantpt.c
@@ -0,0 +1,42 @@
+#include <assert.h>
+#include <ctype.h>
+#include <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <paths.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "not-cancel.h"
+#include "pty-private.h"
+
+
+/* Close all file descriptors except the one specified. */
+static void
+close_all_fds (void)
+{
+ DIR *dir = __opendir ("/proc/self/fd");
+ if (dir != NULL)
+ {
+ struct dirent64 *d;
+ while ((d = __readdir64 (dir)) != NULL)
+ if (isdigit (d->d_name[0]))
+ {
+ char *endp;
+ long int fd = strtol (d->d_name, &endp, 10);
+ if (*endp == '\0' && fd != PTY_FILENO && fd != dirfd (dir))
+ close_not_cancel_no_status (fd);
+ }
+
+ __closedir (dir);
+
+ int nullfd = open_not_cancel_2 (_PATH_DEVNULL, O_RDONLY);
+ assert (nullfd == STDIN_FILENO);
+ nullfd = open_not_cancel_2 (_PATH_DEVNULL, O_WRONLY);
+ assert (nullfd == STDOUT_FILENO);
+ __dup2 (STDOUT_FILENO, STDERR_FILENO);
+ }
+}
+#define CLOSE_ALL_FDS() close_all_fds()
+
+#include <sysdeps/unix/grantpt.c>
diff --git a/sysdeps/unix/sysv/linux/i386/bits/fcntl.h b/sysdeps/unix/sysv/linux/i386/bits/fcntl.h
index 6a38dc03fe..a6db8a86b4 100644
--- a/sysdeps/unix/sysv/linux/i386/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/i386/bits/fcntl.h
@@ -92,8 +92,8 @@
#ifdef __USE_GNU
# define F_SETSIG 10 /* Set number of signal to be sent. */
# define F_GETSIG 11 /* Get number of signal to be sent. */
-# define F_SETOWN_EX 12 /* Get owner (thread receiving SIGIO). */
-# define F_GETOWN_EX 13 /* Set owner (thread receiving SIGIO). */
+# define F_SETOWN_EX 15 /* Get owner (thread receiving SIGIO). */
+# define F_GETOWN_EX 16 /* Set owner (thread receiving SIGIO). */
#endif
#ifdef __USE_GNU
diff --git a/sysdeps/unix/sysv/linux/i386/bits/mman.h b/sysdeps/unix/sysv/linux/i386/bits/mman.h
index 2b90c8d7d5..22aa401e02 100644
--- a/sysdeps/unix/sysv/linux/i386/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/i386/bits/mman.h
@@ -1,5 +1,5 @@
/* Definitions for POSIX memory map interface. Linux/i386 version.
- Copyright (C) 1997, 2000, 2003, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1997,2000,2003,2005,2006,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
@@ -84,14 +84,17 @@
/* 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_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_HWPOISON 100 /* Poison a page for testing. */
#endif
/* The POSIX people had to invent similar names for the same things. */
diff --git a/sysdeps/unix/sysv/linux/i386/fallocate.c b/sysdeps/unix/sysv/linux/i386/fallocate.c
index 7a943e44c0..14e788386c 100644
--- a/sysdeps/unix/sysv/linux/i386/fallocate.c
+++ b/sysdeps/unix/sysv/linux/i386/fallocate.c
@@ -16,6 +16,7 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#include <errno.h>
#include <fcntl.h>
#include <sysdep.h>
@@ -28,5 +29,10 @@ extern int __call_fallocate (int fd, int mode, __off64_t offset, __off64_t len)
int
fallocate (int fd, int mode, __off_t offset, __off_t len)
{
+#ifdef __NR_fallocate
return __call_fallocate (fd, mode, offset, len);
+#else
+ __set_errno (ENOSYS);
+ return -1;
+#endif
}
diff --git a/sysdeps/unix/sysv/linux/i386/fallocate64.c b/sysdeps/unix/sysv/linux/i386/fallocate64.c
index 4998f5e644..85f315c9b6 100644
--- a/sysdeps/unix/sysv/linux/i386/fallocate64.c
+++ b/sysdeps/unix/sysv/linux/i386/fallocate64.c
@@ -16,6 +16,7 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#include <errno.h>
#include <fcntl.h>
#include <sysdep.h>
@@ -28,5 +29,10 @@ extern int __call_fallocate (int fd, int mode, __off64_t offset, __off64_t len)
int
fallocate64 (int fd, int mode, __off64_t offset, __off64_t len)
{
+#ifdef __NR_fallocate
return __call_fallocate (fd, mode, offset, len);
+#else
+ __set_errno (ENOSYS);
+ return -1;
+#endif
}
diff --git a/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h b/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h
index 9a0245a6c4..51c5329ac2 100644
--- a/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h
@@ -88,8 +88,8 @@
#ifdef __USE_GNU
# define F_SETSIG 10 /* Set number of signal to be sent. */
# define F_GETSIG 11 /* Get number of signal to be sent. */
-# define F_SETOWN_EX 12 /* Get owner (thread receiving SIGIO). */
-# define F_GETOWN_EX 13 /* Set owner (thread receiving SIGIO). */
+# define F_SETOWN_EX 15 /* Get owner (thread receiving SIGIO). */
+# define F_GETOWN_EX 16 /* Set owner (thread receiving SIGIO). */
#endif
#ifdef __USE_GNU
diff --git a/sysdeps/unix/sysv/linux/ia64/bits/mman.h b/sysdeps/unix/sysv/linux/ia64/bits/mman.h
index a27a30fc0c..1b278c79ee 100644
--- a/sysdeps/unix/sysv/linux/ia64/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/ia64/bits/mman.h
@@ -1,5 +1,6 @@
/* Definitions for POSIX memory map interface. Linux/ia64 version.
- Copyright (C) 1997,1998,2000,2003,2005,2006 Free Software Foundation, Inc.
+ Copyright (C) 1997,1998,2000,2003,2005,2006,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
@@ -84,14 +85,17 @@
/* 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_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_HWPOISON 100 /* Poison a page for testing. */
#endif
/* The POSIX people had to invent similar names for the same things. */
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h b/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h
index 6c4b66b7ac..4bdaf7bd04 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h
@@ -85,15 +85,15 @@
#define F_SETLKW64 14 /* Set record locking info (blocking). */
#if defined __USE_BSD || defined __USE_UNIX98
-# define F_SETOWN 8 /* Get owner (process receiving of SIGIO). */
-# define F_GETOWN 9 /* Set owner (process receiving of SIGIO). */
+# define F_SETOWN 8 /* Get owner (process receiving SIGIO). */
+# define F_GETOWN 9 /* Set owner (process receiving SIGIO). */
#endif
#ifdef __USE_GNU
# define F_SETSIG 10 /* Set number of signal to be sent. */
# define F_GETSIG 11 /* Get number of signal to be sent. */
-# define F_SETOWN_EX 12 /* Get owner (thread receiving SIGIO). */
-# define F_GETOWN_EX 13 /* Set owner (thread receiving SIGIO). */
+# define F_SETOWN_EX 15 /* Get owner (thread receiving SIGIO). */
+# define F_GETOWN_EX 16 /* Set owner (thread receiving SIGIO). */
#endif
#ifdef __USE_GNU
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/mman.h b/sysdeps/unix/sysv/linux/powerpc/bits/mman.h
index d5729a1f1c..e6580f8220 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/mman.h
@@ -1,5 +1,6 @@
/* Definitions for POSIX memory map interface. Linux/PowerPC version.
- Copyright (C) 1997,2000,2003,2005,2006,2008 Free Software Foundation, Inc.
+ Copyright (C) 1997,2000,2003,2005,2006,2008,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
@@ -85,14 +86,17 @@
/* 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_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_HWPOISON 100 /* Poison a page for testing. */
#endif
/* The POSIX people had to invent similar names for the same things. */
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c
new file mode 100644
index 0000000000..1ca4ce66df
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c
@@ -0,0 +1,44 @@
+/* Selective file content synch'ing.
+ Copyright (C) 2006, 2007, 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
+ 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 <sys/types.h>
+
+#include <sysdep.h>
+#include <sys/syscall.h>
+
+
+#if defined __NR_sync_file_range2
+int
+sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
+{
+ return INLINE_SYSCALL (sync_file_range2, 4, fd, flags, from, to);
+}
+#else
+int
+sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
+{
+ __set_errno (ENOSYS);
+ return -1;
+}
+stub_warning (sync_file_range)
+
+# include <stub-tag.h>
+#endif
diff --git a/sysdeps/unix/sysv/linux/s390/bits/fcntl.h b/sysdeps/unix/sysv/linux/s390/bits/fcntl.h
index d3dddbc368..0af0f93f1e 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/fcntl.h
@@ -107,8 +107,8 @@
#ifdef __USE_GNU
# define F_SETSIG 10 /* Set number of signal to be sent. */
# define F_GETSIG 11 /* Get number of signal to be sent. */
-# define F_SETOWN_EX 12 /* Get owner (thread receiving SIGIO). */
-# define F_GETOWN_EX 13 /* Set owner (thread receiving SIGIO). */
+# define F_SETOWN_EX 15 /* Get owner (thread receiving SIGIO). */
+# define F_GETOWN_EX 16 /* Set owner (thread receiving SIGIO). */
#endif
#ifdef __USE_GNU
diff --git a/sysdeps/unix/sysv/linux/s390/bits/mman.h b/sysdeps/unix/sysv/linux/s390/bits/mman.h
index d25531c282..daeafd48ff 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/mman.h
@@ -1,5 +1,5 @@
/* Definitions for POSIX memory map interface. Linux/s390 version.
- Copyright (C) 2000,2001,2002,2003,2005,2006 Free Software Foundation, Inc.
+ Copyright (C) 2000-2003,2005,2006,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
@@ -84,14 +84,17 @@
/* 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_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_HWPOISON 100 /* Poison a page for testing. */
#endif
/* The POSIX people had to invent similar names for the same things. */
diff --git a/sysdeps/unix/sysv/linux/sh/bits/fcntl.h b/sysdeps/unix/sysv/linux/sh/bits/fcntl.h
index d7a21ea2e2..a6db8a86b4 100644
--- a/sysdeps/unix/sysv/linux/sh/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/sh/bits/fcntl.h
@@ -85,15 +85,15 @@
#define F_SETLKW64 14 /* Set record locking info (blocking). */
#if defined __USE_BSD || defined __USE_UNIX98
-# define F_SETOWN 8 /* Get owner (process receiving of SIGIO). */
-# define F_GETOWN 9 /* Set owner (process receiving of SIGIO). */
+# define F_SETOWN 8 /* Get owner (process receiving SIGIO). */
+# define F_GETOWN 9 /* Set owner (process receiving SIGIO). */
#endif
#ifdef __USE_GNU
# define F_SETSIG 10 /* Set number of signal to be sent. */
# define F_GETSIG 11 /* Get number of signal to be sent. */
-# define F_SETOWN_EX 12 /* Get owner (thread receiving of SIGIO). */
-# define F_GETOWN_EX 13 /* Set owner (thread receiving of SIGIO). */
+# define F_SETOWN_EX 15 /* Get owner (thread receiving SIGIO). */
+# define F_GETOWN_EX 16 /* Set owner (thread receiving SIGIO). */
#endif
#ifdef __USE_GNU
diff --git a/sysdeps/unix/sysv/linux/sh/bits/mman.h b/sysdeps/unix/sysv/linux/sh/bits/mman.h
index 7a6b572a4e..aee0011255 100644
--- a/sysdeps/unix/sysv/linux/sh/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/sh/bits/mman.h
@@ -1,5 +1,6 @@
/* Definitions for POSIX memory map interface. Linux/SH version.
- Copyright (C) 1997,1999,2000,2003,2005,2006 Free Software Foundation, Inc.
+ Copyright (C) 1997,1999,2000,2003,2005,2006,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
@@ -83,14 +84,17 @@
/* 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_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_HWPOISON 100 /* Poison a page for testing. */
#endif
/* The POSIX people had to invent similar names for the same things. */
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h b/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
index dfa848a377..ad4f48e673 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
@@ -99,8 +99,8 @@
#ifdef __USE_GNU
# define F_SETSIG 10 /* Set number of signal to be sent. */
# define F_GETSIG 11 /* Get number of signal to be sent. */
-# define F_GETOWN_EX 12 /* Get owner (thread receiving SIGIO). */
-# define F_SETOWN_EX 13 /* Set owner (thread receiving SIGIO). */
+# define F_SETOWN_EX 15 /* Set owner (thread receiving SIGIO). */
+# define F_GETOWN_EX 16 /* Get owner (thread receiving SIGIO). */
#endif
#ifdef __USE_GNU
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/mman.h b/sysdeps/unix/sysv/linux/sparc/bits/mman.h
index be2b7eb280..71a3aa6a30 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/mman.h
@@ -1,5 +1,6 @@
/* Definitions for POSIX memory map interface. Linux/SPARC version.
- Copyright (C) 1997,1999,2000,2003,2005,2006 Free Software Foundation, Inc.
+ Copyright (C) 1997,1999,2000,2003,2005,2006,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
@@ -85,15 +86,18 @@
/* 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_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_HWPOISON 100 /* Poison a page for testing. */
#endif
/* The POSIX people had to invent similar names for the same things. */
diff --git a/sysdeps/unix/sysv/linux/sync_file_range.c b/sysdeps/unix/sysv/linux/sync_file_range.c
index 4e267a1602..41e08e0281 100644
--- a/sysdeps/unix/sysv/linux/sync_file_range.c
+++ b/sysdeps/unix/sysv/linux/sync_file_range.c
@@ -1,5 +1,5 @@
/* Selective file content synch'ing.
- Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2007, 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
@@ -34,6 +34,14 @@ sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
__LONG_LONG_PAIR ((long) (to >> 32), (long) to),
flags);
}
+#elif defined __NR_sync_file_range2
+int
+sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
+{
+ return INLINE_SYSCALL (sync_file_range2, 6, fd, flags,
+ __LONG_LONG_PAIR ((long) (from >> 32), (long) from),
+ __LONG_LONG_PAIR ((long) (to >> 32), (long) to));
+}
#else
int
sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
diff --git a/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h b/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h
index c3eb859e7d..6e96885d55 100644
--- a/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h
@@ -99,15 +99,15 @@
#endif
#if defined __USE_BSD || defined __USE_UNIX98
-# define F_SETOWN 8 /* Get owner (process receiving of SIGIO). */
-# define F_GETOWN 9 /* Set owner (process receiving of SIGIO). */
+# define F_SETOWN 8 /* Get owner (process receiving SIGIO). */
+# define F_GETOWN 9 /* Set owner (process receiving SIGIO). */
#endif
#ifdef __USE_GNU
# define F_SETSIG 10 /* Set number of signal to be sent. */
# define F_GETSIG 11 /* Get number of signal to be sent. */
-# define F_SETOWN_EX 12 /* Get owner (thread receiving SIGIO). */
-# define F_GETOWN_EX 13 /* Set owner (thread receiving SIGIO). */
+# define F_SETOWN_EX 15 /* Get owner (thread receiving SIGIO). */
+# define F_GETOWN_EX 16 /* Set owner (thread receiving SIGIO). */
#endif
#ifdef __USE_GNU
diff --git a/sysdeps/unix/sysv/linux/x86_64/bits/mman.h b/sysdeps/unix/sysv/linux/x86_64/bits/mman.h
index 7810682536..3dcbf9c317 100644
--- a/sysdeps/unix/sysv/linux/x86_64/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/x86_64/bits/mman.h
@@ -1,5 +1,5 @@
/* Definitions for POSIX memory map interface. Linux/x86_64 version.
- Copyright (C) 2001, 2003, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2003, 2005, 2006, 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
@@ -85,14 +85,17 @@
/* 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_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_HWPOISON 100 /* Poison a page for testing. */
#endif
/* The POSIX people had to invent similar names for the same things. */