summaryrefslogtreecommitdiff
path: root/libc/ports/sysdeps/unix/sysv/linux
diff options
context:
space:
mode:
authorjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2012-08-28 14:14:43 +0000
committerjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2012-08-28 14:14:43 +0000
commit89a00bff19086cb0fe6b694dd82d485e3c732e4d (patch)
tree92a42478f401701889d5c5acf8a5f4324225f312 /libc/ports/sysdeps/unix/sysv/linux
parente7a9915190f0e2b940e4af9ad480cbe035a197d6 (diff)
Merge changes between r20213 and r20391 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@20392 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/ports/sysdeps/unix/sysv/linux')
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/alpha/Makefile1
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/alpha/fdatasync.c65
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/alpha/kernel-features.h5
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/kernel-features.h5
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/arm/ldsodefs.h18
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/hppa/kernel-features.h2
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h5
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c45
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c44
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c45
-rw-r--r--libc/ports/sysdeps/unix/sysv/linux/tile/kernel-features.h3
11 files changed, 220 insertions, 18 deletions
diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/Makefile b/libc/ports/sysdeps/unix/sysv/linux/alpha/Makefile
index f64f23fd7..9676feea9 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/alpha/Makefile
+++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/Makefile
@@ -20,6 +20,7 @@ sysdep_routines += osf_select osf_gettimeofday osf_settimeofday \
# Support old ipc control
sysdep_routines += oldmsgctl oldsemctl oldshmctl
+CFLAGS-fdatasync.c = -fexceptions
CFLAGS-ioperm.c = -Wa,-mev6
endif
diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/fdatasync.c b/libc/ports/sysdeps/unix/sysv/linux/alpha/fdatasync.c
new file mode 100644
index 000000000..10f503578
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/fdatasync.c
@@ -0,0 +1,65 @@
+/* fdatasync -- synchronize at least the data part of a file with
+ the underlying media. Linux version.
+
+ Copyright (C) 2007-2012 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/>. */
+
+#include <errno.h>
+#include <unistd.h>
+
+#include <sysdep-cancel.h>
+#include <sys/syscall.h>
+#include <bp-checks.h>
+
+#include <kernel-features.h>
+
+static int
+do_fdatasync (int fd)
+{
+#ifdef __ASSUME_FDATASYNC
+ return INLINE_SYSCALL (fdatasync, 1, fd);
+#elif defined __NR_fdatasync
+ static int __have_no_fdatasync;
+
+ if (!__builtin_expect (__have_no_fdatasync, 0))
+ {
+ int result = INLINE_SYSCALL (fdatasync, 1, fd);
+ if (__builtin_expect (result, 0) != -1 || errno != ENOSYS)
+ return result;
+
+ __have_no_fdatasync = 1;
+ }
+#endif
+ return INLINE_SYSCALL (fsync, 1, fd);
+}
+
+int
+__fdatasync (int fd)
+{
+ if (SINGLE_THREAD_P)
+ return do_fdatasync (fd);
+
+ int oldtype = LIBC_CANCEL_ASYNC ();
+
+ int result = do_fdatasync (fd);
+
+ LIBC_CANCEL_RESET (oldtype);
+
+ return result;
+}
+
+weak_alias (__fdatasync, fdatasync)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/kernel-features.h b/libc/ports/sysdeps/unix/sysv/linux/alpha/kernel-features.h
index ee349bc93..9fb53798a 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/alpha/kernel-features.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/kernel-features.h
@@ -82,4 +82,9 @@
#undef __ASSUME_STATFS64
#define __ASSUME_STATFS64 0
+/* Support for fsyncdata was added for alpha after 2.6.21. */
+#if __LINUX_KERNEL_VERSION >= 0x020616
+# define __ASSUME_FDATASYNC 1
+#endif
+
#endif /* _KERNEL_FEATURES_H */
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/kernel-features.h b/libc/ports/sysdeps/unix/sysv/linux/arm/kernel-features.h
index b003b17b0..e13443dc3 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/kernel-features.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/kernel-features.h
@@ -20,11 +20,6 @@
/* The utimes syscall was added before 2.6.1. */
#define __ASSUME_UTIMES 1
-/* On ARM the mmap2/stat64/lstat64/fstat64 syscalls were introduced in
- 2.3.35. */
-#define __ASSUME_MMAP2_SYSCALL 1
-#define __ASSUME_STAT64_SYSCALL 1
-
/* The signal frame layout changed in 2.6.18. */
#if __LINUX_KERNEL_VERSION >= 132626
# define __ASSUME_SIGFRAME_V2 1
diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/ldsodefs.h b/libc/ports/sysdeps/unix/sysv/linux/arm/ldsodefs.h
index 8980bb199..d95886222 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/arm/ldsodefs.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/arm/ldsodefs.h
@@ -27,10 +27,22 @@
#define EXTRA_OSABI ELFOSABI_ARM_AEABI
+#ifdef __ARM_PCS_VFP
+# define VALID_FLOAT_ABI(x) \
+ ((EF_ARM_EABI_VERSION ((x)) != EF_ARM_EABI_VER5) \
+ || !((x) & EF_ARM_ABI_FLOAT_SOFT))
+#else
+# define VALID_FLOAT_ABI(x) \
+ ((EF_ARM_EABI_VERSION ((x)) != EF_ARM_EABI_VER5) \
+ || !((x) & EF_ARM_ABI_FLOAT_HARD))
+#endif
+
+#undef VALID_ELF_HEADER
#define VALID_ELF_HEADER(hdr,exp,size) \
- (memcmp (hdr, exp, size) == 0 \
- || memcmp (hdr, expected2, size) == 0 \
- || memcmp (hdr, expected3, size) == 0)
+ ((memcmp (hdr, exp, size) == 0 \
+ || memcmp (hdr, expected2, size) == 0 \
+ || memcmp (hdr, expected3, size) == 0) \
+ && VALID_FLOAT_ABI (ehdr->e_flags))
#define VALID_ELF_OSABI(osabi) (osabi == ELFOSABI_SYSV \
|| osabi == EXTRA_OSABI \
|| osabi == ELFOSABI_LINUX)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/hppa/kernel-features.h b/libc/ports/sysdeps/unix/sysv/linux/hppa/kernel-features.h
index 49ba55f7c..fb0e9c999 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/hppa/kernel-features.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/hppa/kernel-features.h
@@ -23,8 +23,6 @@
and expect the final version here. */
#define __ASSUME_32BITUIDS 1
#define __ASSUME_TRUNCATE64_SYSCALL 1
-#define __ASSUME_MMAP2_SYSCALL 1
-#define __ASSUME_STAT64_SYSCALL 1
#define __ASSUME_IPC64 1
#define __ASSUME_ST_INO_64_BIT 1
#define __ASSUME_GETDENTS64_SYSCALL 1
diff --git a/libc/ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h b/libc/ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h
index 5c68d7f1c..454b23f22 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h
@@ -17,13 +17,8 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
-/* These features were surely available with 2.4.12. */
-#define __ASSUME_MMAP2_SYSCALL 1
-#define __ASSUME_STAT64_SYSCALL 1
-
/* Many syscalls were added in 2.6.10 for m68k. */
#define __ASSUME_UTIMES 1
-#define __ASSUME_FADVISE64_64_SYSCALL 1
#include_next <kernel-features.h>
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c
new file mode 100644
index 000000000..24b517e43
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c
@@ -0,0 +1,45 @@
+/* fxstat64 using 64-bit MIPS fstat system call.
+ Copyright (C) 1997-2012 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/>. */
+
+#include <errno.h>
+#include <stddef.h>
+#include <sys/stat.h>
+#include <kernel_stat.h>
+
+#include <sysdep.h>
+#include <sys/syscall.h>
+#include <bp-checks.h>
+
+#include <xstatconv.h>
+
+/* Get information about the file FD in BUF. */
+
+int
+__fxstat64 (int vers, int fd, struct stat64 *buf)
+{
+ int result;
+ struct kernel_stat kbuf;
+
+ result = INLINE_SYSCALL (fstat, 2, fd, __ptrvalue (&kbuf));
+ if (result == 0)
+ result = __xstat64_conv (vers, &kbuf, buf);
+
+ return result;
+}
+
+hidden_def (__fxstat64)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c
new file mode 100644
index 000000000..71123f2bf
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c
@@ -0,0 +1,44 @@
+/* lxstat64 using 64-bit MIPS lstat system call.
+ Copyright (C) 1997-2012 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/>. */
+
+#include <errno.h>
+#include <stddef.h>
+#include <sys/stat.h>
+#include <kernel_stat.h>
+
+#include <sysdep.h>
+#include <sys/syscall.h>
+#include <bp-checks.h>
+
+#include <xstatconv.h>
+
+/* Get information about the file NAME in BUF. */
+int
+__lxstat64 (int vers, const char *name, struct stat64 *buf)
+{
+ int result;
+ struct kernel_stat kbuf;
+
+ result = INLINE_SYSCALL (lstat, 2, CHECK_STRING (name), __ptrvalue (&kbuf));
+ if (result == 0)
+ result = __xstat64_conv (vers, &kbuf, buf);
+
+ return result;
+}
+
+hidden_def (__lxstat64)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c
new file mode 100644
index 000000000..b5bb93614
--- /dev/null
+++ b/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c
@@ -0,0 +1,45 @@
+/* xstat64 using 64-bit MIPS stat system call.
+ Copyright (C) 1991-2012 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/>. */
+
+#include <errno.h>
+#include <stddef.h>
+#include <sys/stat.h>
+#include <kernel_stat.h>
+
+#include <sysdep.h>
+#include <sys/syscall.h>
+#include <bp-checks.h>
+
+#include <xstatconv.h>
+
+/* Get information about the file NAME in BUF. */
+
+int
+__xstat64 (int vers, const char *name, struct stat64 *buf)
+{
+ int result;
+ struct kernel_stat kbuf;
+
+ result = INLINE_SYSCALL (stat, 2, CHECK_STRING (name), __ptrvalue (&kbuf));
+ if (result == 0)
+ result = __xstat64_conv (vers, &kbuf, buf);
+
+ return result;
+}
+
+hidden_def (__xstat64)
diff --git a/libc/ports/sysdeps/unix/sysv/linux/tile/kernel-features.h b/libc/ports/sysdeps/unix/sysv/linux/tile/kernel-features.h
index 956f14cb9..106af6239 100644
--- a/libc/ports/sysdeps/unix/sysv/linux/tile/kernel-features.h
+++ b/libc/ports/sysdeps/unix/sysv/linux/tile/kernel-features.h
@@ -18,10 +18,7 @@
/* TILE glibc support starts with 2.6.36, guaranteeing many kernel features. */
-#define __ASSUME_MMAP2_SYSCALL 1
-#define __ASSUME_STAT64_SYSCALL 1
#define __ASSUME_UTIMES 1
-#define __ASSUME_FADVISE64_64_SYSCALL 1
#define __ASSUME_O_CLOEXEC 1
#define __ASSUME_SOCK_CLOEXEC 1
#define __ASSUME_IN_NONBLOCK 1