[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r13355 - in /trunk: libc/ libc/iconv/ libc/io/ libc/libio/ libc/misc/ libc/posix/ libc/stdlib/ libc/sysdeps/unix/ libc/sysde...



Author: joseph
Date: Fri Apr  1 12:43:08 2011
New Revision: 13355

Log:
Merge changes between r13227 and r13354 from /fsf/trunk.

Added:
    trunk/libc/misc/syncfs.c
      - copied unchanged from r13354, fsf/trunk/libc/misc/syncfs.c
    trunk/libc/sysdeps/unix/sysv/linux/bits/time.h
      - copied unchanged from r13354, fsf/trunk/libc/sysdeps/unix/sysv/linux/bits/time.h
    trunk/libc/sysdeps/unix/sysv/linux/bits/timex.h
      - copied unchanged from r13354, fsf/trunk/libc/sysdeps/unix/sysv/linux/bits/timex.h
    trunk/libc/sysdeps/unix/sysv/linux/i386/call_sync_file_range.S
      - copied unchanged from r13354, fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/call_sync_file_range.S
    trunk/libc/sysdeps/unix/sysv/linux/i386/sync_file_range.c
      - copied unchanged from r13354, fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/sync_file_range.c
Removed:
    trunk/libc/sysdeps/unix/sysv/linux/i386/sync_file_range.S
    trunk/ports/sysdeps/arm/linuxthreads/
    trunk/ports/sysdeps/unix/sysv/linux/arm/eabi/linuxthreads/
    trunk/ports/sysdeps/unix/sysv/linux/arm/linuxthreads/
Modified:
    trunk/libc/ChangeLog
    trunk/libc/NEWS
    trunk/libc/Versions.def
    trunk/libc/iconv/iconv.h
    trunk/libc/io/Makefile
    trunk/libc/io/fcntl.h
    trunk/libc/libio/stdio.h
    trunk/libc/misc/Makefile
    trunk/libc/misc/Versions
    trunk/libc/posix/spawn.h
    trunk/libc/posix/unistd.h
    trunk/libc/stdlib/stdlib.h
    trunk/libc/sysdeps/unix/syscalls.list
    trunk/libc/sysdeps/unix/sysv/linux/Makefile
    trunk/libc/sysdeps/unix/sysv/linux/Versions
    trunk/libc/sysdeps/unix/sysv/linux/fallocate.c
    trunk/libc/sysdeps/unix/sysv/linux/fallocate64.c
    trunk/libc/sysdeps/unix/sysv/linux/i386/Makefile
    trunk/libc/sysdeps/unix/sysv/linux/i386/bits/fcntl.h
    trunk/libc/sysdeps/unix/sysv/linux/i386/fallocate.c
    trunk/libc/sysdeps/unix/sysv/linux/i386/fallocate64.c
    trunk/libc/sysdeps/unix/sysv/linux/i386/sysconf.c
    trunk/libc/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h
    trunk/libc/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h
    trunk/libc/sysdeps/unix/sysv/linux/s390/bits/fcntl.h
    trunk/libc/sysdeps/unix/sysv/linux/sh/bits/fcntl.h
    trunk/libc/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
    trunk/libc/sysdeps/unix/sysv/linux/sync_file_range.c
    trunk/libc/sysdeps/unix/sysv/linux/sys/timex.h
    trunk/libc/sysdeps/unix/sysv/linux/syscalls.list
    trunk/libc/sysdeps/unix/sysv/linux/wordsize-64/fallocate.c
    trunk/libc/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list
    trunk/libc/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h
    trunk/libc/sysdeps/x86_64/cacheinfo.c
    trunk/libc/time/time.h
    trunk/libc/wcsmbs/wchar.h
    trunk/ports/ChangeLog.alpha
    trunk/ports/ChangeLog.arm
    trunk/ports/ChangeLog.mips
    trunk/ports/sysdeps/mips/dl-lookup.c
    trunk/ports/sysdeps/unix/sysv/linux/alpha/____longjmp_chk.S
    trunk/ports/sysdeps/unix/sysv/linux/arm/bits/fcntl.h
    trunk/ports/sysdeps/unix/sysv/linux/arm/eabi/____longjmp_chk.S
    trunk/ports/sysdeps/unix/sysv/linux/arm/eabi/nptl/sysdep-cancel.h
    trunk/ports/sysdeps/unix/sysv/linux/arm/eabi/sysdep.h
    trunk/ports/sysdeps/unix/sysv/linux/arm/vfork.S
    trunk/ports/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
    trunk/ports/sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c
    trunk/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate.c
    trunk/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate64.c
    trunk/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list
    trunk/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list

Modified: trunk/libc/ChangeLog
==============================================================================
--- trunk/libc/ChangeLog (original)
+++ trunk/libc/ChangeLog Fri Apr  1 12:43:08 2011
@@ -1,3 +1,98 @@
+2011-03-30  Andreas Schwab  <schwab@xxxxxxxxxx>
+
+	* misc/syncfs.c: New file.
+	* misc/Makefile (routines): Add syncfs.
+	* posix/unistd.h: Declare syncfs.
+	* sysdeps/unix/syscalls.list: Add syncfs.
+
+2011-04-01  Andreas Schwab  <schwab@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/Versions: Rename open_by_handle to
+	open_by_handle_at.
+	* sysdeps/unix/sysv/linux/i386/bits/fcntl.h: Likewise.
+	* sysdeps/unix/sysv/linux/ia64/bits/fcntl.h: Likewise.
+	* sysdeps/unix/sysv/linux/s390/bits/fcntl.h: Likewise.
+	* sysdeps/unix/sysv/linux/sh/bits/fcntl.h: Likewise.
+	* sysdeps/unix/sysv/linux/sparc/bits/fcntl.h: Likewise.
+	* sysdeps/unix/sysv/linux/syscalls.list: Likewise.
+	* sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h: Likewise.
+
+2011-04-01  Ulrich Drepper  <drepper@xxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/i386/bits/fcntl.h: Define O_PATH.
+	* sysdeps/unix/sysv/linux/ia64/bits/fcntl.h: Likewise.
+	* sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h: Likewise.
+	* sysdeps/unix/sysv/linux/s390/bits/fcntl.h: Likewise.
+	* sysdeps/unix/sysv/linux/sh/bits/fcntl.h: Likewise.
+	* sysdeps/unix/sysv/linux/sparc/bits/fcntl.h: Likewise.
+	* sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h: Likewise.
+
+	* io/Makefile: Compile fallocate.c, fallocate64.c, and
+	sync_file_range.c with -fexceptions.
+	* sysdeps/unix/sysv/linux/fallocate.c: Make cancelable.
+	* sysdeps/unix/sysv/linux/fallocate64.c: Likewise.
+	* sysdeps/unix/sysv/linux/i386/fallocate.c: Likewise.
+	* sysdeps/unix/sysv/linux/i386/fallocate64.c: Likewise.
+	* sysdeps/unix/sysv/linux/wordsize-64/fallocate.c: Likewise.
+	* sysdeps/unix/sysv/linux/sync_file_range.c: Likewise.
+	* sysdeps/unix/sysv/linux/wordsize-64/syscalls.list: Mark
+	sync_file_range as cancellation point
+	* sysdeps/unix/sysv/linux/i386/sync_file_range.c: New file.  This is
+	now a wrapper around __call_sync_file_range with cancellation handling.
+	* sysdeps/unix/sysv/linux/i386/sync_file_range.S: Renamed to ...
+	* sysdeps/unix/sysv/linux/i386/call_sync_file_range.S: ...this.  Change
+	function name to __call_sync_file_range.
+	* sysdeps/unix/sysv/linux/i386/Makefile [subdir=io] (sysdep_routines):
+	Add call_sync_file_range.
+
+2011-04-01  Andreas Schwab  <schwab@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add
+	bits/timex.h.
+
+2011-04-01  Ulrich Drepper  <drepper@xxxxxxxxx>
+
+	* iconv/iconv.h: Fix typo in comment.
+	* io/fcntl.h: Likewise.
+	* libio/stdio.h: Likewise.
+	* posix/spawn.h: Likewise.
+	* posix/unistd.h: Likewise.
+	* stdlib/stdlib.h: Likewise.
+	* time/time.h: Likewise.
+	* wcsmbs/wchar.h: Likewise.
+
+	* sysdeps/unix/sysv/linux/Versions [GLIBC_2.14] (name_to_handle_at,
+	open_by_handle): Add.
+	* sysdeps/unix/sysv/linux/i386/bits/fcntl.h: Define struct file_handle
+	and MAX_HANDLE_SZ.  Declare name_to_handle_at and open_by_handle.
+	Augment a few comments.
+	* sysdeps/unix/sysv/linux/ia64/bits/fcntl.h: Likewise.
+	* sysdeps/unix/sysv/linux/s390/bits/fcntl.h: Likewise.
+	* sysdeps/unix/sysv/linux/sh/bits/fcntl.h: Likewise.
+	* sysdeps/unix/sysv/linux/sparc/bits/fcntl.h: Likewise.
+	* sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h: Likewise.
+	* sysdeps/unix/sysv/linux/syscalls.list: Add name_to_handle_at and
+	open_by_handle.
+
+	* io/fcntl.h (AT_EMPTY_PATH): Define.
+
+2011-03-30  Ulrich Drepper  <drepper@xxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/syscalls.list: Add clock_adjtime.
+	* sysdeps/unix/sysv/linux/bits/time.h: New file.
+	* sysdeps/unix/sysv/linux/sys/timex.h: Move struct timex definition
+	to...
+	* sysdeps/unix/sysv/linux/bits/timex.h: ...here.  New file.
+	* Versions.def: Add GLIBC_2.14.
+	* sysdeps/unix/sysv/linux/Versions [GLIBC_2.14] (clock_adjtime):
+	Export.
+
+2011-03-22  Ulrich Drepper  <drepper@xxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/i386/sysconf.c (intel_check_word): Increment
+	round counter.
+	* sysdeps/x86_64/cacheinfo.c (intel_check_word): Likewise.
+
 2011-03-20  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
 
 	[BZ #12597]

Modified: trunk/libc/NEWS
==============================================================================
--- trunk/libc/NEWS (original)
+++ trunk/libc/NEWS Fri Apr  1 12:43:08 2011
@@ -1,4 +1,4 @@
-GNU C Library NEWS -- history of user-visible changes.  2011-3-21
+GNU C Library NEWS -- history of user-visible changes.  2011-4-1
 Copyright (C) 1992-2009, 2010, 2011 Free Software Foundation, Inc.
 See the end for copying conditions.
 
@@ -6,6 +6,8 @@
 using `glibc' in the "product" field.
 
 Version 2.14
+
+* New Linux interfaces: clock_adjtime, name_to_handle_at, open_by_handle_at
 
 * The following bugs are resolved with this release:
 

Modified: trunk/libc/Versions.def
==============================================================================
--- trunk/libc/Versions.def (original)
+++ trunk/libc/Versions.def Fri Apr  1 12:43:08 2011
@@ -30,6 +30,7 @@
   GLIBC_2.11
   GLIBC_2.12
   GLIBC_2.13
+  GLIBC_2.14
 %ifdef USE_IN_LIBIO
   HURD_CTHREADS_0.3
 %endif

Modified: trunk/libc/iconv/iconv.h
==============================================================================
--- trunk/libc/iconv/iconv.h (original)
+++ trunk/libc/iconv/iconv.h Fri Apr  1 12:43:08 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 1999, 2000, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2000, 2003, 2011 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
@@ -33,7 +33,7 @@
 /* Allocate descriptor for code conversion from codeset FROMCODE to
    codeset TOCODE.
 
-   This function is a possible cancellation points and therefore not
+   This function is a possible cancellation point and therefore not
    marked with __THROW.  */
 extern iconv_t iconv_open (__const char *__tocode, __const char *__fromcode);
 
@@ -47,7 +47,7 @@
 
 /* Free resources allocated for descriptor CD for code conversion.
 
-   This function is a possible cancellation points and therefore not
+   This function is a possible cancellation point and therefore not
    marked with __THROW.  */
 extern int iconv_close (iconv_t __cd);
 

Modified: trunk/libc/io/Makefile
==============================================================================
--- trunk/libc/io/Makefile (original)
+++ trunk/libc/io/Makefile Fri Apr  1 12:43:08 2011
@@ -1,4 +1,4 @@
-# Copyright (C) 1992-2003,2005,2006,2007,2008 Free Software Foundation, Inc.
+# Copyright (C) 1992-2003,2005-2008,2011 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
@@ -96,6 +96,9 @@
 CFLAGS-lockf.c = -fexceptions
 CFLAGS-posix_fallocate.c = -fexceptions
 CFLAGS-posix_fallocate64.c = -fexceptions
+CFLAGS-fallocate.c = -fexceptions
+CFLAGS-fallocate64.c = -fexceptions
+CFLAGS-sync_file_range.c = -fexceptions
 
 CFLAGS-test-stat.c = -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
 CFLAGS-test-lfs.c = -D_LARGEFILE64_SOURCE

Modified: trunk/libc/io/fcntl.h
==============================================================================
--- trunk/libc/io/fcntl.h (original)
+++ trunk/libc/io/fcntl.h Fri Apr  1 12:43:08 2011
@@ -112,6 +112,7 @@
 # define AT_SYMLINK_FOLLOW	0x400	/* Follow symbolic links.  */
 # define AT_NO_AUTOMOUNT	0x800	/* Suppress terminal automount
 					   traversal.  */
+# define AT_EMPTY_PATH		0x1000	/* Allow empty relative pathname.  */
 # define AT_EACCESS		0x200	/* Test access permitted for
 					   effective IDs, not real IDs.  */
 #endif
@@ -241,7 +242,7 @@
 
 /* Reserve storage for the data of the file associated with FD.
 
-   This function is a possible cancellation points and therefore not
+   This function is a possible cancellation point and therefore not
    marked with __THROW.  */
 # ifndef __USE_FILE_OFFSET64
 extern int posix_fallocate (int __fd, __off_t __offset, __off_t __len);

Modified: trunk/libc/libio/stdio.h
==============================================================================
--- trunk/libc/libio/stdio.h (original)
+++ trunk/libc/libio/stdio.h Fri Apr  1 12:43:08 2011
@@ -1,5 +1,5 @@
 /* Define ISO C stdio on top of C++ iostreams.
-   Copyright (C) 1991, 1994-2008, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 1991, 1994-2010, 2011 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
@@ -186,7 +186,7 @@
 __BEGIN_NAMESPACE_STD
 /* Create a temporary file and open it read/write.
 
-   This function is a possible cancellation points and therefore not
+   This function is a possible cancellation point and therefore not
    marked with __THROW.  */
 #ifndef __USE_FILE_OFFSET64
 extern FILE *tmpfile (void) __wur;
@@ -677,33 +677,33 @@
 __BEGIN_NAMESPACE_STD
 /* Write a string to STREAM.
 
-   This function is a possible cancellation points and therefore not
+   This function is a possible cancellation point and therefore not
    marked with __THROW.  */
 extern int fputs (__const char *__restrict __s, FILE *__restrict __stream);
 
 /* Write a string, followed by a newline, to stdout.
 
-   This function is a possible cancellation points and therefore not
+   This function is a possible cancellation point and therefore not
    marked with __THROW.  */
 extern int puts (__const char *__s);
 
 
 /* Push a character back onto the input buffer of STREAM.
 
-   This function is a possible cancellation points and therefore not
+   This function is a possible cancellation point and therefore not
    marked with __THROW.  */
 extern int ungetc (int __c, FILE *__stream);
 
 
 /* Read chunks of generic data from STREAM.
 
-   This function is a possible cancellation points and therefore not
+   This function is a possible cancellation point and therefore not
    marked with __THROW.  */
 extern size_t fread (void *__restrict __ptr, size_t __size,
 		     size_t __n, FILE *__restrict __stream) __wur;
 /* Write chunks of generic data to STREAM.
 
-   This function is a possible cancellation points and therefore not
+   This function is a possible cancellation point and therefore not
    marked with __THROW.  */
 extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
 		      size_t __n, FILE *__restrict __s) __wur;

Modified: trunk/libc/misc/Makefile
==============================================================================
--- trunk/libc/misc/Makefile (original)
+++ trunk/libc/misc/Makefile Fri Apr  1 12:43:08 2011
@@ -1,4 +1,4 @@
-# Copyright (C) 1991-2006, 2007, 2009 Free Software Foundation, Inc.
+# Copyright (C) 1991-2006, 2007, 2009, 2011 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
@@ -45,7 +45,7 @@
 	    getdtsz \
 	    gethostname sethostname getdomain setdomain \
 	    select pselect \
-	    acct chroot fsync sync fdatasync reboot \
+	    acct chroot fsync sync fdatasync syncfs reboot \
 	    gethostid sethostid \
 	    vhangup \
 	    swapon swapoff mktemp mkstemp mkstemp64 mkdtemp \

Modified: trunk/libc/misc/Versions
==============================================================================
--- trunk/libc/misc/Versions (original)
+++ trunk/libc/misc/Versions Fri Apr  1 12:43:08 2011
@@ -143,4 +143,7 @@
   GLIBC_2.11 {
     mkstemps; mkstemps64; mkostemps; mkostemps64;
   }
+  GLIBC_2.14 {
+    syncfs;
+  }
 }

Modified: trunk/libc/posix/spawn.h
==============================================================================
--- trunk/libc/posix/spawn.h (original)
+++ trunk/libc/posix/spawn.h Fri Apr  1 12:43:08 2011
@@ -1,5 +1,5 @@
 /* Definitions for POSIX spawn interface.
-   Copyright (C) 2000, 2003, 2004, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2003, 2004, 2009, 2011 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
@@ -67,7 +67,7 @@
 /* Spawn a new process executing PATH with the attributes describes in *ATTRP.
    Before running the process perform the actions described in FILE-ACTIONS.
 
-   This function is a possible cancellation points and therefore not
+   This function is a possible cancellation point and therefore not
    marked with __THROW. */
 extern int posix_spawn (pid_t *__restrict __pid,
 			__const char *__restrict __path,
@@ -79,7 +79,7 @@
 
 /* Similar to `posix_spawn' but search for FILE in the PATH.
 
-   This function is a possible cancellation points and therefore not
+   This function is a possible cancellation point and therefore not
    marked with __THROW.  */
 extern int posix_spawnp (pid_t *__pid, __const char *__file,
 			 __const posix_spawn_file_actions_t *__file_actions,

Modified: trunk/libc/posix/unistd.h
==============================================================================
--- trunk/libc/posix/unistd.h (original)
+++ trunk/libc/posix/unistd.h Fri Apr  1 12:43:08 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2009, 2010, 2011 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
@@ -863,7 +863,7 @@
 
 /* Return the login name of the user.
 
-   This function is a possible cancellation points and therefore not
+   This function is a possible cancellation point and therefore not
    marked with __THROW.  */
 extern char *getlogin (void);
 #if defined __USE_REENTRANT || defined __USE_POSIX199506
@@ -871,7 +871,7 @@
    If it cannot be determined or some other error occurred, return the error
    code.  Otherwise return 0.
 
-   This function is a possible cancellation points and therefore not
+   This function is a possible cancellation point and therefore not
    marked with __THROW.  */
 extern int getlogin_r (char *__name, size_t __name_len) __nonnull ((1));
 #endif
@@ -975,6 +975,13 @@
    __THROW.  */
 extern int fsync (int __fd);
 #endif /* Use BSD || X/Open || Unix98.  */
+
+
+#ifdef __USE_GNU
+/* Make all changes done to all files on the file system associated
+   with FD actually appear on disk.  */
+extern int syncfs (int __fd) __THROW;
+#endif
 
 
 #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED

Modified: trunk/libc/stdlib/stdlib.h
==============================================================================
--- trunk/libc/stdlib/stdlib.h (original)
+++ trunk/libc/stdlib/stdlib.h Fri Apr  1 12:43:08 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2007, 2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2007, 2009, 2010, 2011 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
@@ -668,7 +668,7 @@
    mkstemp.  But allow the caller to pass additional flags which are
    used in the open call to create the file..
 
-   This function is a possible cancellation points and therefore not
+   This function is a possible cancellation point and therefore not
    marked with __THROW.  */
 # ifndef __USE_FILE_OFFSET64
 extern int mkostemp (char *__template, int __flags) __nonnull ((1)) __wur;

Modified: trunk/libc/sysdeps/unix/syscalls.list
==============================================================================
--- trunk/libc/sysdeps/unix/syscalls.list (original)
+++ trunk/libc/sysdeps/unix/syscalls.list Fri Apr  1 12:43:08 2011
@@ -55,6 +55,7 @@
 swapon		-	swapon		i:s	swapon
 symlink		-	symlink		i:ss	__symlink	symlink
 sync		-	sync		i:	sync
+syncfs		-	syncfs		i:i	syncfs
 sys_fstat	fxstat	fstat		i:ip	__syscall_fstat
 sys_mknod	xmknod	mknod		i:sii	__syscall_mknod
 sys_stat	xstat	stat		i:sp	__syscall_stat

Modified: trunk/libc/sysdeps/unix/sysv/linux/Makefile
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/Makefile (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/Makefile Fri Apr  1 12:43:08 2011
@@ -96,7 +96,7 @@
 endif
 
 ifeq ($(subdir),time)
-sysdep_headers += sys/timex.h
+sysdep_headers += sys/timex.h bits/timex.h
 
 sysdep_routines += ntp_gettime ntp_gettimex
 endif

Modified: trunk/libc/sysdeps/unix/sysv/linux/Versions
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/Versions (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/Versions Fri Apr  1 12:43:08 2011
@@ -154,6 +154,11 @@
 
     fanotify_init; fanotify_mark;
   }
+  GLIBC_2.14 {
+    clock_adjtime;
+
+    name_to_handle_at; open_by_handle_at;
+  }
   GLIBC_PRIVATE {
     # functions used in other libraries
     __syscall_rt_sigqueueinfo;

Modified: trunk/libc/sysdeps/unix/sysv/linux/fallocate.c
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/fallocate.c (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/fallocate.c Fri Apr  1 12:43:08 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2007, 2009, 2011 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
@@ -18,7 +18,7 @@
 
 #include <errno.h>
 #include <fcntl.h>
-#include <sysdep.h>
+#include <sysdep-cancel.h>
 
 
 /* Reserve storage for the data of the file associated with FD.  */
@@ -26,9 +26,21 @@
 fallocate (int fd, int mode, __off_t offset, __off_t len)
 {
 #ifdef __NR_fallocate
-  return INLINE_SYSCALL (fallocate, 6, fd, mode,
-			 __LONG_LONG_PAIR (offset >> 31, offset),
-			 __LONG_LONG_PAIR (len >> 31, len));
+  if (SINGLE_THREAD_P)
+    return INLINE_SYSCALL (fallocate, 6, fd, mode,
+			   __LONG_LONG_PAIR (offset >> 31, offset),
+			   __LONG_LONG_PAIR (len >> 31, len));
+
+  int result;
+  int oldtype = LIBC_CANCEL_ASYNC ();
+
+  result = INLINE_SYSCALL (fallocate, 6, fd, mode,
+			   __LONG_LONG_PAIR (offset >> 31, offset),
+			   __LONG_LONG_PAIR (len >> 31, len));
+
+  LIBC_CANCEL_RESET (oldtype);
+
+  return result;
 #else
   __set_errno (ENOSYS);
   return -1;

Modified: trunk/libc/sysdeps/unix/sysv/linux/fallocate64.c
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/fallocate64.c (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/fallocate64.c Fri Apr  1 12:43:08 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2007, 2009, 2011 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
@@ -18,7 +18,7 @@
 
 #include <errno.h>
 #include <fcntl.h>
-#include <sysdep.h>
+#include <sysdep-cancel.h>
 
 
 /* Reserve storage for the data of the file associated with FD.  */
@@ -26,11 +26,25 @@
 fallocate64 (int fd, int mode, __off64_t offset, __off64_t len)
 {
 #ifdef __NR_fallocate
-  return INLINE_SYSCALL (fallocate, 6, fd, mode,
-			 __LONG_LONG_PAIR ((long int) (offset >> 32),
-					   (long int) offset),
-			 __LONG_LONG_PAIR ((long int) (len >> 32),
-					   (long int) len));
+  if (SINGLE_THREAD_P)
+    return INLINE_SYSCALL (fallocate, 6, fd, mode,
+			   __LONG_LONG_PAIR ((long int) (offset >> 32),
+					     (long int) offset),
+			   __LONG_LONG_PAIR ((long int) (len >> 32),
+					     (long int) len));
+
+  int result;
+  int oldtype = LIBC_CANCEL_ASYNC ();
+
+  result = INLINE_SYSCALL (fallocate, 6, fd, mode,
+			   __LONG_LONG_PAIR ((long int) (offset >> 32),
+					     (long int) offset),
+			   __LONG_LONG_PAIR ((long int) (len >> 32),
+					     (long int) len));
+
+  LIBC_CANCEL_RESET (oldtype);
+
+  return result;
 #else
   __set_errno (ENOSYS);
   return -1;

Modified: trunk/libc/sysdeps/unix/sysv/linux/i386/Makefile
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/i386/Makefile (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/i386/Makefile Fri Apr  1 12:43:08 2011
@@ -6,7 +6,10 @@
 ifeq ($(subdir),elf)
 sysdep-others += lddlibc4
 install-bin += lddlibc4
+endif
 
+ifeq ($(subdir),io)
+sysdep_routines += call_sync_file_range
 endif
 
 ifeq ($(subdir),resource)

Modified: trunk/libc/sysdeps/unix/sysv/linux/i386/bits/fcntl.h
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/i386/bits/fcntl.h (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/i386/bits/fcntl.h Fri Apr  1 12:43:08 2011
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux.
-   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2004, 2006, 2007, 2009, 2010
+   Copyright (C) 1995-1998, 2000, 2004, 2006, 2007, 2009, 2010, 2011
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -53,6 +53,7 @@
 #ifdef __USE_GNU
 # define O_DIRECT	 040000	/* Direct disk access.	*/
 # define O_NOATIME     01000000 /* Do not set atime.  */
+# define O_PATH	      010000000 /* Resolve pathname but do not open file.  */
 #endif
 
 /* For now Linux has synchronisity options for data and read operations.
@@ -232,6 +233,19 @@
 					   we splice from/to).  */
 # define SPLICE_F_MORE		4	/* Expect more data.  */
 # define SPLICE_F_GIFT		8	/* Pages passed in are a gift.  */
+
+
+/* File handle structure.  */
+struct file_handle
+{
+  unsigned int handle_bytes;
+  int handle_type;
+  /* File identifier.  */
+  unsigned char f_handle[0];
+};
+
+/* Maximum handle size (for now).  */
+# define MAX_HANDLE_SZ	128
 #endif
 
 __BEGIN_DECLS
@@ -248,20 +262,32 @@
 			    unsigned int __flags);
 
 
-/* Splice address range into a pipe.  */
+/* Splice address range into a pipe.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
 			 size_t __count, unsigned int __flags);
 
-/* Splice two files together.  */
+/* Splice two files together.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
 		       __off64_t *__offout, size_t __len,
 		       unsigned int __flags);
 
-/* In-kernel implementation of tee for pipe buffers.  */
+/* In-kernel implementation of tee for pipe buffers.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 extern ssize_t tee (int __fdin, int __fdout, size_t __len,
 		    unsigned int __flags);
 
-/* Reserve storage for the data of the file associated with FD.  */
+/* Reserve storage for the data of the file associated with FD.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 # ifndef __USE_FILE_OFFSET64
 extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len);
 # else
@@ -278,6 +304,19 @@
 			__off64_t __len);
 # endif
 
+
+/* Map file name to file handle.  */
+extern int name_to_handle_at (int __dfd, const char *__name,
+			      struct file_handle *__handle, int *__mnt_id,
+			      int __flags) __THROW;
+
+/* Open file using the file handle.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
+extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle,
+			      int __flags);
+
 #endif
 
 __END_DECLS

Modified: trunk/libc/sysdeps/unix/sysv/linux/i386/fallocate.c
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/i386/fallocate.c (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/i386/fallocate.c Fri Apr  1 12:43:08 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2007, 2009, 2011 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
@@ -18,7 +18,7 @@
 
 #include <errno.h>
 #include <fcntl.h>
-#include <sysdep.h>
+#include <sysdep-cancel.h>
 
 
 extern int __call_fallocate (int fd, int mode, __off64_t offset, __off64_t len)
@@ -30,7 +30,17 @@
 fallocate (int fd, int mode, __off_t offset, __off_t len)
 {
 #ifdef __NR_fallocate
-  int err = __call_fallocate (fd, mode, offset, len);
+  int err;
+  if (SINGLE_THREAD_P)
+    err = __call_fallocate (fd, mode, offset, len);
+  else
+    {
+      int oldtype = LIBC_CANCEL_ASYNC ();
+
+      err = __call_fallocate (fd, mode, offset, len);
+
+      LIBC_CANCEL_RESET (oldtype);
+    }
   if (__builtin_expect (err, 0))
     {
       __set_errno (err);

Modified: trunk/libc/sysdeps/unix/sysv/linux/i386/fallocate64.c
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/i386/fallocate64.c (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/i386/fallocate64.c Fri Apr  1 12:43:08 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2007, 2009, 2011 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
@@ -18,7 +18,7 @@
 
 #include <errno.h>
 #include <fcntl.h>
-#include <sysdep.h>
+#include <sysdep-cancel.h>
 
 
 extern int __call_fallocate (int fd, int mode, __off64_t offset, __off64_t len)
@@ -30,7 +30,17 @@
 fallocate64 (int fd, int mode, __off64_t offset, __off64_t len)
 {
 #ifdef __NR_fallocate
-  int err = __call_fallocate (fd, mode, offset, len);
+  int err;
+  if (SINGLE_THREAD_P)
+    err = __call_fallocate (fd, mode, offset, len);
+  else
+    {
+      int oldtype = LIBC_CANCEL_ASYNC ();
+
+      err = __call_fallocate (fd, mode, offset, len);
+
+      LIBC_CANCEL_RESET (oldtype);
+    }
   if (__builtin_expect (err, 0))
     {
       __set_errno (err);

Modified: trunk/libc/sysdeps/unix/sysv/linux/i386/sysconf.c
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/i386/sysconf.c (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/i386/sysconf.c Fri Apr  1 12:43:08 2011
@@ -231,6 +231,8 @@
 		  assert (offset == 2);
 		  return (ebx & 0xfff) + 1;
 		}
+
+	      ++round;
 	    }
 	  /* There is no other cache information anywhere else.  */
 	  break;

Modified: trunk/libc/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h Fri Apr  1 12:43:08 2011
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux/IA64.
-   Copyright (C) 1999, 2000, 2004, 2006, 2007, 2009, 2010
+   Copyright (C) 1999, 2000, 2004, 2006, 2007, 2009, 2010, 2011
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -53,6 +53,7 @@
 #ifdef __USE_GNU
 # define O_DIRECT	040000
 # define O_NOATIME	01000000 /* Do not set atime.  */
+# define O_PATH		010000000 /* Resolve pathname but do not open file.  */
 #endif
 
 #ifdef __USE_LARGEFILE64
@@ -227,6 +228,19 @@
 					   we splice from/to).  */
 # define SPLICE_F_MORE		4	/* Expect more data.  */
 # define SPLICE_F_GIFT		8	/* Pages passed in are a gift.  */
+
+
+/* File handle structure.  */
+struct file_handle
+{
+  unsigned int handle_bytes;
+  int handle_type;
+  /* File identifier.  */
+  unsigned char f_handle[0];
+};
+
+/* Maximum handle size (for now).  */
+# define MAX_HANDLE_SZ	128
 #endif
 
 __BEGIN_DECLS
@@ -238,25 +252,40 @@
     __THROW;
 
 
-/* Selective file content synch'ing.  */
+/* Selective file content synch'ing.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count,
 			    unsigned int __flags);
 
 
-/* Splice address range into a pipe.  */
+/* Splice address range into a pipe.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
 			 size_t __count, unsigned int __flags);
 
-/* Splice two files together.  */
+/* Splice two files together.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
 		       __off64_t *__offout, size_t __len,
 		       unsigned int __flags);
 
-/* In-kernel implementation of tee for pipe buffers.  */
+/* In-kernel implementation of tee for pipe buffers.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 extern ssize_t tee (int __fdin, int __fdout, size_t __len,
 		    unsigned int __flags);
 
-/* Reserve storage for the data of the file associated with FD.  */
+/* Reserve storage for the data of the file associated with FD.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 # ifndef __USE_FILE_OFFSET64
 extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len);
 # else
@@ -273,6 +302,19 @@
 			__off64_t __len);
 # endif
 
+
+/* Map file name to file handle.  */
+extern int name_to_handle_at (int __dfd, const char *__name,
+			      struct file_handle *__handle, int *__mnt_id,
+			      int __flags) __THROW;
+
+/* Open file using the file handle.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
+extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle,
+			      int __flags);
+
 #endif
 
 __END_DECLS

Modified: trunk/libc/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h Fri Apr  1 12:43:08 2011
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux/PowerPC.
-   Copyright (C) 1995-1998, 2000, 2003, 2004, 2006, 2007, 2009, 2010
+   Copyright (C) 1995-1998, 2000, 2003, 2004, 2006, 2007, 2009, 2010, 2011
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -53,6 +53,7 @@
 #ifdef __USE_GNU
 # define O_DIRECT	0400000	/* Direct disk access.	*/
 # define O_NOATIME	01000000 /* Do not set atime.  */
+# define O_PATH		010000000 /* Resolve pathname but do not open file.  */
 #endif
 
 #ifdef __USE_LARGEFILE64

Modified: trunk/libc/sysdeps/unix/sysv/linux/s390/bits/fcntl.h
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/s390/bits/fcntl.h (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/s390/bits/fcntl.h Fri Apr  1 12:43:08 2011
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux.
-   Copyright (C) 2000-2002,2004,2006,2007,2009,2010
+   Copyright (C) 2000-2002,2004,2006,2007,2009,2010,2011
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -54,6 +54,7 @@
 #ifdef __USE_GNU
 # define O_DIRECT	 040000	/* Direct disk access.	*/
 # define O_NOATIME     01000000 /* Do not set atime.  */
+# define O_PATH	      010000000 /* Resolve pathname but do not open file.  */
 #endif
 
 #ifdef __USE_LARGEFILE64
@@ -253,6 +254,19 @@
 					   we splice from/to).  */
 # define SPLICE_F_MORE		4	/* Expect more data.  */
 # define SPLICE_F_GIFT		8	/* Pages passed in are a gift.  */
+
+
+/* File handle structure.  */
+struct file_handle
+{
+  unsigned int handle_bytes;
+  int handle_type;
+  /* File identifier.  */
+  unsigned char f_handle[0];
+};
+
+/* Maximum handle size (for now).  */
+# define MAX_HANDLE_SZ	128
 #endif
 
 __BEGIN_DECLS
@@ -264,25 +278,40 @@
     __THROW;
 
 
-/* Selective file content synch'ing.  */
+/* Selective file content synch'ing.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count,
 			    unsigned int __flags);
 
 
-/* Splice address range into a pipe.  */
+/* Splice address range into a pipe.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
 			 size_t __count, unsigned int __flags);
 
-/* Splice two files together.  */
+/* Splice two files together.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
 		       __off64_t *__offout, size_t __len,
 		       unsigned int __flags);
 
-/* In-kernel implementation of tee for pipe buffers.  */
+/* In-kernel implementation of tee for pipe buffers.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 extern ssize_t tee (int __fdin, int __fdout, size_t __len,
 		    unsigned int __flags);
 
-/* Reserve storage for the data of the file associated with FD.  */
+/* Reserve storage for the data of the file associated with FD.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 # ifndef __USE_FILE_OFFSET64
 extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len);
 # else
@@ -299,6 +328,19 @@
 			__off64_t __len);
 # endif
 
+
+/* Map file name to file handle.  */
+extern int name_to_handle_at (int __dfd, const char *__name,
+			      struct file_handle *__handle, int *__mnt_id,
+			      int __flags) __THROW;
+
+/* Open file using the file handle.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
+extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle,
+			      int __flags);
+
 #endif
 
 __END_DECLS

Modified: trunk/libc/sysdeps/unix/sysv/linux/sh/bits/fcntl.h
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/sh/bits/fcntl.h (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/sh/bits/fcntl.h Fri Apr  1 12:43:08 2011
@@ -1,5 +1,5 @@
-/* O_*, F_*, FD_* bit values for Linux.
-   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2004, 2006, 2007, 2009, 2010
+/* O_*, F_*, FD_* bit values for Linux/SH.
+   Copyright (C) 1995-1998, 2000, 2004, 2006, 2007, 2009, 2010, 2011
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -54,6 +54,7 @@
 #ifdef __USE_GNU
 # define O_DIRECT	 040000	/* Direct disk access.	*/
 # define O_NOATIME     01000000 /* Do not set atime.  */
+# define O_PATH	      010000000 /* Resolve pathname but do not open file.  */
 #endif
 
 /* For now Linux has synchronisity options for data and read operations.
@@ -233,6 +234,19 @@
 					   we splice from/to).  */
 # define SPLICE_F_MORE		4	/* Expect more data.  */
 # define SPLICE_F_GIFT		8	/* Pages passed in are a gift.  */
+
+
+/* File handle structure.  */
+struct file_handle
+{
+  unsigned int handle_bytes;
+  int handle_type;
+  /* File identifier.  */
+  unsigned char f_handle[0];
+};
+
+/* Maximum handle size (for now).  */
+# define MAX_HANDLE_SZ	128
 #endif
 
 __BEGIN_DECLS
@@ -244,25 +258,40 @@
     __THROW;
 
 
-/* Selective file content synch'ing.  */
+/* Selective file content synch'ing.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count,
 			    unsigned int __flags);
 
 
-/* Splice address range into a pipe.  */
+/* Splice address range into a pipe.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
 			 size_t __count, unsigned int __flags);
 
-/* Splice two files together.  */
+/* Splice two files together.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
 		       __off64_t *__offout, size_t __len,
 		       unsigned int __flags);
 
-/* In-kernel implementation of tee for pipe buffers.  */
+/* In-kernel implementation of tee for pipe buffers.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 extern ssize_t tee (int __fdin, int __fdout, size_t __len,
 		    unsigned int __flags);
 
-/* Reserve storage for the data of the file associated with FD.  */
+/* Reserve storage for the data of the file associated with FD.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 # ifndef __USE_FILE_OFFSET64
 extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len);
 # else
@@ -279,6 +308,19 @@
 			__off64_t __len);
 # endif
 
+
+/* Map file name to file handle.  */
+extern int name_to_handle_at (int __dfd, const char *__name,
+			      struct file_handle *__handle, int *__mnt_id,
+			      int __flags) __THROW;
+
+/* Open file using the file handle.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
+extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle,
+			      int __flags);
+
 #endif
 
 __END_DECLS

Modified: trunk/libc/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h Fri Apr  1 12:43:08 2011
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux/SPARC.
-   Copyright (C) 1995-1998, 2000, 2003, 2004, 2006, 2007, 2009, 2010
+   Copyright (C) 1995-1998, 2000, 2003, 2004, 2006, 2007, 2009, 2010, 2011
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -52,6 +52,7 @@
 #ifdef __USE_GNU
 # define O_DIRECT	0x100000 /* direct disk access hint */
 # define O_NOATIME	0x200000 /* Do not set atime.  */
+# define O_PATH		0x1000000 /* Resolve pathname but do not open file.  */
 #endif
 
 #ifdef __USE_LARGEFILE64
@@ -243,6 +244,19 @@
 					   we splice from/to).  */
 # define SPLICE_F_MORE		4	/* Expect more data.  */
 # define SPLICE_F_GIFT		8	/* Pages passed in are a gift.  */
+
+
+/* File handle structure.  */
+struct file_handle
+{
+  unsigned int handle_bytes;
+  int handle_type;
+  /* File identifier.  */
+  unsigned char f_handle[0];
+};
+
+/* Maximum handle size (for now).  */
+# define MAX_HANDLE_SZ	128
 #endif
 
 __BEGIN_DECLS
@@ -254,7 +268,10 @@
     __THROW;
 
 
-/* Selective file content synch'ing.  */
+/* Selective file content synch'ing.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count,
 			    unsigned int __flags);
 
@@ -263,16 +280,25 @@
 extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
 			 size_t __count, unsigned int __flags);
 
-/* Splice two files together.  */
+/* Splice two files together.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
 		       __off64_t *__offout, size_t __len,
 		       unsigned int __flags);
 
-/* In-kernel implementation of tee for pipe buffers.  */
+/* In-kernel implementation of tee for pipe buffers.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 extern ssize_t tee (int __fdin, int __fdout, size_t __len,
 		    unsigned int __flags);
 
-/* Reserve storage for the data of the file associated with FD.  */
+/* Reserve storage for the data of the file associated with FD.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 # ifndef __USE_FILE_OFFSET64
 extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len);
 # else
@@ -289,6 +315,19 @@
 			__off64_t __len);
 # endif
 
+
+/* Map file name to file handle.  */
+extern int name_to_handle_at (int __dfd, const char *__name,
+			      struct file_handle *__handle, int *__mnt_id,
+			      int __flags) __THROW;
+
+/* Open file using the file handle.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
+extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle,
+			      int __flags);
+
 #endif
 
 __END_DECLS

Modified: trunk/libc/sysdeps/unix/sysv/linux/sync_file_range.c
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/sync_file_range.c (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/sync_file_range.c Fri Apr  1 12:43:08 2011
@@ -1,5 +1,5 @@
 /* Selective file content synch'ing.
-   Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2007, 2009, 2011 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
@@ -21,7 +21,7 @@
 #include <fcntl.h>
 #include <sys/types.h>
 
-#include <sysdep.h>
+#include <sysdep-cancel.h>
 #include <sys/syscall.h>
 
 
@@ -29,18 +29,43 @@
 int
 sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
 {
-  return INLINE_SYSCALL (sync_file_range, 6, fd,
-			 __LONG_LONG_PAIR ((long) (from >> 32), (long) from),
-			 __LONG_LONG_PAIR ((long) (to >> 32), (long) to),
-			 flags);
+  if (SINGLE_THREAD_P)
+    return INLINE_SYSCALL (sync_file_range, 6, fd,
+			   __LONG_LONG_PAIR ((long) (from >> 32), (long) from),
+			   __LONG_LONG_PAIR ((long) (to >> 32), (long) to),
+			   flags);
+
+  int result;
+  int oldtype = LIBC_CANCEL_ASYNC ();
+
+  result = INLINE_SYSCALL (sync_file_range, 6, fd,
+			   __LONG_LONG_PAIR ((long) (from >> 32), (long) from),
+			   __LONG_LONG_PAIR ((long) (to >> 32), (long) to),
+			   flags);
+
+  LIBC_CANCEL_RESET (oldtype);
+
+  return result;
 }
 #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));
+  if (SINGLE_THREAD_P)
+    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));
+
+  int result;
+  int oldtype = LIBC_CANCEL_ASYNC ();
+
+  result = INLINE_SYSCALL (sync_file_range2, 6, fd, flags,
+			   __LONG_LONG_PAIR ((long) (from >> 32), (long) from),
+			   __LONG_LONG_PAIR ((long) (to >> 32), (long) to));
+
+  LIBC_CANCEL_RESET (oldtype);
+
+  return result;
 }
 #else
 int

Modified: trunk/libc/sysdeps/unix/sysv/linux/sys/timex.h
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/sys/timex.h (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/sys/timex.h Fri Apr  1 12:43:08 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-1997, 1999, 2007, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1995-1997,1999,2007,2009,2011 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
@@ -24,6 +24,8 @@
 
 /* These definitions from linux/timex.h as of 2.6.30.  */
 
+#include <bits/timex.h>
+
 #define NTP_API	4	/* NTP API version */
 
 struct ntptimeval
@@ -38,90 +40,6 @@
   long int __unused3;
   long int __unused4;
 };
-
-struct timex
-{
-  unsigned int modes;	/* mode selector */
-  long int offset;	/* time offset (usec) */
-  long int freq;	/* frequency offset (scaled ppm) */
-  long int maxerror;	/* maximum error (usec) */
-  long int esterror;	/* estimated error (usec) */
-  int status;		/* clock command/status */
-  long int constant;	/* pll time constant */
-  long int precision;	/* clock precision (usec) (read only) */
-  long int tolerance;	/* clock frequency tolerance (ppm) (read only) */
-  struct timeval time;	/* (read only) */
-  long int tick;	/* (modified) usecs between clock ticks */
-
-  long int ppsfreq;	/* pps frequency (scaled ppm) (ro) */
-  long int jitter;	/* pps jitter (us) (ro) */
-  int shift;		/* interval duration (s) (shift) (ro) */
-  long int stabil;	/* pps stability (scaled ppm) (ro) */
-  long int jitcnt;	/* jitter limit exceeded (ro) */
-  long int calcnt;	/* calibration intervals (ro) */
-  long int errcnt;	/* calibration errors (ro) */
-  long int stbcnt;	/* stability limit exceeded (ro) */
-
-  int tai;		/* TAI offset (ro) */
-
-  /* ??? */
-  int  :32; int  :32; int  :32; int  :32;
-  int  :32; int  :32; int  :32; int  :32;
-  int  :32; int  :32; int  :32;
-};
-
-/* Mode codes (timex.mode) */
-#define ADJ_OFFSET		0x0001	/* time offset */
-#define ADJ_FREQUENCY		0x0002	/* frequency offset */
-#define ADJ_MAXERROR		0x0004	/* maximum time error */
-#define ADJ_ESTERROR		0x0008	/* estimated time error */
-#define ADJ_STATUS		0x0010	/* clock status */
-#define ADJ_TIMECONST		0x0020	/* pll time constant */
-#define ADJ_TAI			0x0080	/* set TAI offset */
-#define ADJ_MICRO		0x1000	/* select microsecond resolution */
-#define ADJ_NANO		0x2000	/* select nanosecond resolution */
-#define ADJ_TICK		0x4000	/* tick value */
-#define ADJ_OFFSET_SINGLESHOT	0x8001	/* old-fashioned adjtime */
-#define ADJ_OFFSET_SS_READ	0xa001	/* read-only adjtime */
-
-/* xntp 3.4 compatibility names */
-#define MOD_OFFSET	ADJ_OFFSET
-#define MOD_FREQUENCY	ADJ_FREQUENCY
-#define MOD_MAXERROR	ADJ_MAXERROR
-#define MOD_ESTERROR	ADJ_ESTERROR
-#define MOD_STATUS	ADJ_STATUS
-#define MOD_TIMECONST	ADJ_TIMECONST
-#define MOD_CLKB	ADJ_TICK
-#define MOD_CLKA	ADJ_OFFSET_SINGLESHOT /* 0x8000 in original */
-#define MOD_TAI		ADJ_TAI
-#define MOD_MICRO	ADJ_MICRO
-#define MOD_NANO	ADJ_NANO
-
-
-/* Status codes (timex.status) */
-#define STA_PLL		0x0001	/* enable PLL updates (rw) */
-#define STA_PPSFREQ	0x0002	/* enable PPS freq discipline (rw) */
-#define STA_PPSTIME	0x0004	/* enable PPS time discipline (rw) */
-#define STA_FLL		0x0008	/* select frequency-lock mode (rw) */
-
-#define STA_INS		0x0010	/* insert leap (rw) */
-#define STA_DEL		0x0020	/* delete leap (rw) */
-#define STA_UNSYNC	0x0040	/* clock unsynchronized (rw) */
-#define STA_FREQHOLD	0x0080	/* hold frequency (rw) */
-
-#define STA_PPSSIGNAL	0x0100	/* PPS signal present (ro) */
-#define STA_PPSJITTER	0x0200	/* PPS signal jitter exceeded (ro) */
-#define STA_PPSWANDER	0x0400	/* PPS signal wander exceeded (ro) */
-#define STA_PPSERROR	0x0800	/* PPS signal calibration error (ro) */
-
-#define STA_CLOCKERR	0x1000	/* clock hardware fault (ro) */
-#define STA_NANO	0x2000	/* resolution (0 = us, 1 = ns) (ro) */
-#define STA_MODE	0x4000	/* mode (0 = PLL, 1 = FLL) (ro) */
-#define STA_CLK		0x8000	/* clock source (0 = A, 1 = B) (ro) */
-
-/* Read-only bits */
-#define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \
-    STA_PPSERROR | STA_CLOCKERR | STA_NANO | STA_MODE | STA_CLK)
 
 /* Clock states (time_state) */
 #define TIME_OK		0	/* clock synchronized, no leap second */

Modified: trunk/libc/sysdeps/unix/sysv/linux/syscalls.list
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/syscalls.list (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/syscalls.list Fri Apr  1 12:43:08 2011
@@ -4,6 +4,7 @@
 bdflush		EXTRA	bdflush		i:ii	bdflush
 capget		EXTRA	capget		i:pp	capget
 capset		EXTRA	capset		i:pp	capset
+clock_adjtime	EXTRA	clock_adjtime	i:ip	clock_adjtime
 creat		-	creat		Ci:si	__libc_creat creat
 create_module	EXTRA	create_module	3	create_module
 delete_module	EXTRA	delete_module	3	delete_module
@@ -103,3 +104,6 @@
 timerfd_gettime	EXTRA	timerfd_gettime	i:ip	timerfd_gettime
 
 fanotify_init	EXTRA	fanotify_init	i:ii	fanotify_init
+
+name_to_handle_at EXTRA	name_to_handle_at i:isppi name_to_handle_at
+open_by_handle_at EXTRA	open_by_handle_at Ci:ipi  open_by_handle_at

Modified: trunk/libc/sysdeps/unix/sysv/linux/wordsize-64/fallocate.c
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/wordsize-64/fallocate.c (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/wordsize-64/fallocate.c Fri Apr  1 12:43:08 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2007, 2009, 2011 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
@@ -18,7 +18,7 @@
 
 #include <errno.h>
 #include <fcntl.h>
-#include <sysdep.h>
+#include <sysdep-cancel.h>
 
 
 /* Reserve storage for the data of the file associated with FD.  */
@@ -26,7 +26,17 @@
 fallocate (int fd, int mode, __off_t offset, __off_t len)
 {
 #ifdef __NR_fallocate
-  return INLINE_SYSCALL (fallocate, 4, fd, mode, offset, len);
+  if (SINGLE_THREAD_P)
+    return INLINE_SYSCALL (fallocate, 4, fd, mode, offset, len);
+
+  int result;
+  int oldtype = LIBC_CANCEL_ASYNC ();
+
+  result = INLINE_SYSCALL (fallocate, 4, fd, mode, offset, len);
+
+  LIBC_CANCEL_RESET (oldtype);
+
+  return result;
 #else
   __set_errno (ENOSYS);
   return -1;

Modified: trunk/libc/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list Fri Apr  1 12:43:08 2011
@@ -14,7 +14,7 @@
 setrlimit	-	setrlimit	i:ip	__setrlimit	setrlimit setrlimit64
 readahead	-	readahead	i:iii	__readahead	readahead
 sendfile	-	sendfile	i:iipi	sendfile	sendfile64
-sync_file_range	-	sync_file_range	i:iiii	sync_file_range
+sync_file_range	-	sync_file_range	Ci:iiii	sync_file_range
 creat		-	creat		Ci:si	__libc_creat	creat creat64
 open		-	open		Ci:siv	__libc_open	__open open __open64 open64
 prlimit		EXTRA	prlimit64	i:iipp	prlimit		prlimit64

Modified: trunk/libc/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h Fri Apr  1 12:43:08 2011
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux/x86-64.
-   Copyright (C) 2001,2002,2004,2006,2007,2009,2010
+   Copyright (C) 2001,2002,2004,2006,2007,2009,2010,2011
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -54,6 +54,7 @@
 #ifdef __USE_GNU
 # define O_DIRECT	 040000	/* Direct disk access.	*/
 # define O_NOATIME     01000000 /* Do not set atime.  */
+# define O_PATH	      010000000 /* Resolve pathname but do not open file.  */
 #endif
 
 /* For now Linux has synchronisity options for data and read operations.
@@ -247,6 +248,19 @@
 					   we splice from/to).  */
 # define SPLICE_F_MORE		4	/* Expect more data.  */
 # define SPLICE_F_GIFT		8	/* Pages passed in are a gift.  */
+
+
+/* File handle structure.  */
+struct file_handle
+{
+  unsigned int handle_bytes;
+  int handle_type;
+  /* File identifier.  */
+  unsigned char f_handle[0];
+};
+
+/* Maximum handle size (for now).  */
+# define MAX_HANDLE_SZ	128
 #endif
 
 __BEGIN_DECLS
@@ -258,25 +272,40 @@
     __THROW;
 
 
-/* Selective file content synch'ing.  */
+/* Selective file content synch'ing.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count,
 			    unsigned int __flags);
 
 
-/* Splice address range into a pipe.  */
+/* Splice address range into a pipe.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
 			 size_t __count, unsigned int __flags);
 
-/* Splice two files together.  */
+/* Splice two files together.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
 		       __off64_t *__offout, size_t __len,
 		       unsigned int __flags);
 
-/* In-kernel implementation of tee for pipe buffers.  */
+/* In-kernel implementation of tee for pipe buffers.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 extern ssize_t tee (int __fdin, int __fdout, size_t __len,
 		    unsigned int __flags);
 
-/* Reserve storage for the data of the file associated with FD.  */
+/* Reserve storage for the data of the file associated with FD.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 # ifndef __USE_FILE_OFFSET64
 extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len);
 # else
@@ -292,6 +321,20 @@
 extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
 			__off64_t __len);
 # endif
-#endif
+
+
+/* Map file name to file handle.  */
+extern int name_to_handle_at (int __dfd, const char *__name,
+			      struct file_handle *__handle, int *__mnt_id,
+			      int __flags) __THROW;
+
+/* Open file using the file handle.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
+extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle,
+			      int __flags);
+
+#endif	/* use GNU */
 
 __END_DECLS

Modified: trunk/libc/sysdeps/x86_64/cacheinfo.c
==============================================================================
--- trunk/libc/sysdeps/x86_64/cacheinfo.c (original)
+++ trunk/libc/sysdeps/x86_64/cacheinfo.c Fri Apr  1 12:43:08 2011
@@ -226,6 +226,8 @@
 		  assert (offset == 2);
 		  return (ebx & 0xfff) + 1;
 		}
+
+	      ++round;
 	    }
 	  /* There is no other cache information anywhere else.  */
 	  break;

Modified: trunk/libc/time/time.h
==============================================================================
--- trunk/libc/time/time.h (original)
+++ trunk/libc/time/time.h Fri Apr  1 12:43:08 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2003,2006,2009 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2003,2006,2009,2011 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
@@ -385,7 +385,7 @@
      6  memory allication failed (not enough memory available),
      7  there is no line in the template that matches the input,
      8  invalid input specification Example: February 31 or a time is
-        specified that can not be represented in a time_t (representing
+	specified that can not be represented in a time_t (representing
 	the time in seconds since 00:00:00 UTC, January 1, 1970) */
 extern int getdate_err;
 
@@ -394,7 +394,7 @@
    the environment variable DATEMSK are used.  In case of an error
    `getdate_err' is set.
 
-   This function is a possible cancellation points and therefore not
+   This function is a possible cancellation point and therefore not
    marked with __THROW.  */
 extern struct tm *getdate (__const char *__string);
 # endif

Modified: trunk/libc/wcsmbs/wchar.h
==============================================================================
--- trunk/libc/wcsmbs/wchar.h (original)
+++ trunk/libc/wcsmbs/wchar.h Fri Apr  1 12:43:08 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2008, 2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2008, 2009, 2010, 2011 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
@@ -758,7 +758,7 @@
 
 /* Write a character to stdout.
 
-   This function is a possible cancellation points and therefore not
+   This function is a possible cancellation point and therefore not
    marked with __THROW.  */
 extern wint_t putwchar (wchar_t __wc);
 
@@ -766,14 +766,14 @@
 /* Get a newline-terminated wide character string of finite length
    from STREAM.
 
-   This function is a possible cancellation points and therefore not
+   This function is a possible cancellation point and therefore not
    marked with __THROW.  */
 extern wchar_t *fgetws (wchar_t *__restrict __ws, int __n,
 			__FILE *__restrict __stream);
 
 /* Write a string to STREAM.
 
-   This function is a possible cancellation points and therefore not
+   This function is a possible cancellation point and therefore not
    marked with __THROW.  */
 extern int fputws (__const wchar_t *__restrict __ws,
 		   __FILE *__restrict __stream);
@@ -781,7 +781,7 @@
 
 /* Push a character back onto the input buffer of STREAM.
 
-   This function is a possible cancellation points and therefore not
+   This function is a possible cancellation point and therefore not
    marked with __THROW.  */
 extern wint_t ungetwc (wint_t __wc, __FILE *__stream);
 __END_NAMESPACE_STD

Modified: trunk/ports/ChangeLog.alpha
==============================================================================
--- trunk/ports/ChangeLog.alpha (original)
+++ trunk/ports/ChangeLog.alpha Fri Apr  1 12:43:08 2011
@@ -1,3 +1,8 @@
+2011-03-28  Aurelien Jarno  <aurelien@xxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/alpha/____longjmp_chk.S(____longjmp_chk):
+	Fix wrong register in stack pointer comparison.
+
 2011-03-01  Aurelien Jarno  <aurelien@xxxxxxxxxxx>
 
 	* sysdeps/alpha/fpu/feupdateenv.c (feupdateenv): Add libm_hidden_def.

Modified: trunk/ports/ChangeLog.arm
==============================================================================
--- trunk/ports/ChangeLog.arm (original)
+++ trunk/ports/ChangeLog.arm Fri Apr  1 12:43:08 2011
@@ -1,3 +1,61 @@
+2011-04-01  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/arm/bits/fcntl.h: Rename open_by_handle
+	to open_by_handle_at.
+
+2011-04-01  Ryosei Takagi  <ryosei@xxxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/arm/eabi/____longjmp_chk.S:
+	Save and restore r7, and also adjust sp.
+
+2011-04-01  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/arm/bits/fcntl.h (O_PATH): Define.
+
+2011-04-01  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/arm/bits/fcntl.h: Define struct
+	file_handle and MAX_HANDLE_SZ.  Declare name_to_handle_at and
+	open_by_handle.  Augment a few comments.
+
+2011-03-21  Ulrich Weigand  <ulrich.weigand@xxxxxxxxxx>
+
+	* sysdeps/arm/linuxthreads: Remove directory.
+	* sysdeps/unix/sysv/linux/arm/linuxthreads: Likewise.
+	* sysdeps/unix/sysv/linux/arm/eabi/linuxthreads: Likewise.
+
+2011-03-21  Ulrich Weigand  <ulrich.weigand@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/arm/eabi/nptl/sysdep-cancel.h (PSEUDO): Add
+	missing "cmn r0, $4096" for _nocancel system call stubs.
+
+2011-03-21  Ulrich Weigand  <ulrich.weigand@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/arm/eabi/sysdep.h (DO_CALL): Do not save/restore
+	r7 into IP.
+	(DOARGS_0, UNDOARGS_0): Redefine to save/restore r7 to the stack.
+	Create appropriate ARM unwind record.
+	(DOARGS_1, UNDOARGS_1): Likewise.
+	(DOARGS_2, UNDOARGS_2): Likewise.
+	(DOARGS_3, UNDOARGS_3): Likewise.
+	(DOARGS_4, UNDOARGS_4): Likewise.
+	(DOARGS_5, UNDOARGS_5): Likewise.
+	(DOARGS_6, UNDOARGS_6): Likewise.
+	(DOARGS_7, UNDOARGS_7): Likewise.
+	* sysdeps/unix/sysv/arm/eabi/nptl/sysdep-cancel.h (PSEUDO): Adapt to
+	DO_CALL/DOARGS_xxx/UNDOARGS_xxx changes.
+	(RESTART_UNWIND): Likewise.
+	(DOCARGS_0, RESTORE_LR_0): Likewise.
+	(DOCARGS_1): Likewise.
+	(DOCARGS_2): Likewise.
+	(DOCARGS_3): Likewise.
+	(DOCARGS_4): Likewise.
+	(DOCARGS_5, UNDOCARGS_5, RESTORE_LR_5): Likewise.
+	(DOCARGS_6, UNDOCARGS_6): Likewise.
+	* sysdeps/unix/sysv/linux/arm/vfork.S (__vfork): Do no use DO_CALL to
+	call vfork.  In the __ARM_EABI__ case, save r7 both to IP (to restore
+	from) and the stack (to create an ARM unwind record).
+
 2011-03-21  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
 
 	* sysdeps/arm/eabi/__longjmp.S, sysdeps/arm/eabi/bits/fenv.h,

Modified: trunk/ports/ChangeLog.mips
==============================================================================
--- trunk/ports/ChangeLog.mips (original)
+++ trunk/ports/ChangeLog.mips Fri Apr  1 12:43:08 2011
@@ -1,3 +1,38 @@
+2011-04-01  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/mips/bits/fcntl.h: Rename open_by_handle
+	to open_by_handle_at.
+
+2011-04-01  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/mips/bits/fcntl.h (O_PATH): Define.
+
+2011-04-01  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/mips/bits/fcntl.h: Define struct
+	file_handle and MAX_HANDLE_SZ.  Declare name_to_handle_at and
+	open_by_handle.  Augment a few comments.
+
+2011-04-01  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c: Make
+	cancelable.
+	* sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate.c: Likewise.
+	* sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate64.c: Likewise.
+	* sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list: Mark
+	sync_file_range as cancellation point.
+	* sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list: Mark
+	sync_file_range as cancellation point.
+
+2011-04-01  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list: Add
+	sync_file_range.
+
+2011-03-22  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/mips/dl-lookup.c: Update from generic version.
+
 2011-01-25  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/mips/bits/mman.h (MADV_HUGEPAGE,

Modified: trunk/ports/sysdeps/mips/dl-lookup.c
==============================================================================
--- trunk/ports/sysdeps/mips/dl-lookup.c (original)
+++ trunk/ports/sysdeps/mips/dl-lookup.c Fri Apr  1 12:43:08 2011
@@ -1,7 +1,6 @@
 /* Look up a symbol in the loaded objects.
    MIPS/Linux version - special handling of non-PIC undefined symbol rules.
-   Copyright (C) 1995-2005, 2006, 2007, 2009, 2010
-   Free Software Foundation, Inc.
+   Copyright (C) 1995-2007, 2009, 2010, 2011 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
@@ -381,8 +380,19 @@
 		      if (entries[idx].hashval == new_hash
 			  && strcmp (entries[idx].name, undef_name) == 0)
 			{
-			  result->s = entries[idx].sym;
-			  result->m = (struct link_map *) entries[idx].map;
+			  if ((type_class & ELF_RTYPE_CLASS_COPY) != 0)
+			    {
+			      /* We possibly have to initialize the central
+				 copy from the copy addressed through the
+				 relocation.  */
+			      result->s = sym;
+			      result->m = (struct link_map *) map;
+			    }
+			  else
+			    {
+			      result->s = entries[idx].sym;
+			      result->m = (struct link_map *) entries[idx].map;
+			    }
 			  __rtld_lock_unlock_recursive (tab->lock);
 			  return 1;
 			}

Modified: trunk/ports/sysdeps/unix/sysv/linux/alpha/____longjmp_chk.S
==============================================================================
--- trunk/ports/sysdeps/unix/sysv/linux/alpha/____longjmp_chk.S (original)
+++ trunk/ports/sysdeps/unix/sysv/linux/alpha/____longjmp_chk.S Fri Apr  1 12:43:08 2011
@@ -1,4 +1,5 @@
-/* Copyright (C) 1992, 1994, 1997, 2006, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1994, 1997, 2006, 2010, 2011
+   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
@@ -58,11 +59,17 @@
 	PTR_DEMANGLE2(s3, t1)
 	PTR_DEMANGLE2(fp, t1)
 #endif
-	cmpule	t0, sp, t1
-	bne	t1, .Lfail
+	/* ??? While this is a proper test for detecting a longjmp to an
+	   invalid frame within any given stack, the main thread stack is
+	   located *below* almost everything in the address space.  Which
+	   means that the test at Lfail vs the signal stack will almost
+	   certainly never pass.  We ought bounds check top and bottom of
+	   the current thread's stack.  */
+	cmpule	s3, sp, t1
+	bne	t1, $Lfail
 
 	.align	4
-.Lok:
+$Lok:
 	mov	s0, a0
 	mov	s1, v0
 	mov	s3, t0
@@ -103,7 +110,7 @@
 	ret
 
 	.align	4
-.Lfail:
+$Lfail:
 	cfi_restore_state
 	lda	v0, __NR_sigaltstack
 	lda	a0, 0
@@ -118,13 +125,13 @@
 	cfi_adjust_cfa_offset(-32)
 
 	/* Without working sigaltstack we cannot perform the test.  */
-	bne	a3, .Lok
+	bne	a3, $Lok
 
 	addq	t0, t2, t0	/* t0 = ss_sp + ss_size */
 	subq	t0, s3, t0	/* t0 = (ss_sp + ss_size) - new_sp */
 	cmpule	t2, t0, t0	/* t0 = (t0 >= ss_size) */
 	and	t0, t1, t0	/* t0 = (t0 >= ss_size) & (ss_flags & SS_ONSTACK) */
-	bne	t0, .Lok
+	bne	t0, $Lok
 
 	ldah	a0, longjmp_msg(gp)	!gprelhigh
 	lda	a0, longjmp_msg(a0)	!gprellow

Modified: trunk/ports/sysdeps/unix/sysv/linux/arm/bits/fcntl.h
==============================================================================
--- trunk/ports/sysdeps/unix/sysv/linux/arm/bits/fcntl.h (original)
+++ trunk/ports/sysdeps/unix/sysv/linux/arm/bits/fcntl.h Fri Apr  1 12:43:08 2011
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux.
-   Copyright (C) 1995-1998, 2000, 2004, 2006, 2007, 2009, 2010
+   Copyright (C) 1995-1998, 2000, 2004, 2006, 2007, 2009, 2010, 2011
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -53,6 +53,7 @@
 #ifdef __USE_GNU
 # define O_DIRECT	0200000	/* Direct disk access.	*/
 # define O_NOATIME     01000000 /* Do not set atime.  */
+# define O_PATH	      010000000 /* Resolve pathname but do not open file.  */
 #endif
 
 /* For now Linux has synchronisity options for data and read operations.
@@ -232,6 +233,19 @@
 					   we splice from/to).  */
 # define SPLICE_F_MORE		4	/* Expect more data.  */
 # define SPLICE_F_GIFT		8	/* Pages passed in are a gift.  */
+
+
+/* File handle structure.  */
+struct file_handle
+{
+  unsigned int handle_bytes;
+  int handle_type;
+  /* File identifier.  */
+  unsigned char f_handle[0];
+};
+
+/* Maximum handle size (for now).  */
+# define MAX_HANDLE_SZ	128
 #endif
 
 __BEGIN_DECLS
@@ -248,20 +262,32 @@
 			    unsigned int __flags);
 
 
-/* Splice address range into a pipe.  */
+/* Splice address range into a pipe.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
 			 size_t __count, unsigned int __flags);
 
-/* Splice two files together.  */
+/* Splice two files together.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
 		       __off64_t *__offout, size_t __len,
 		       unsigned int __flags);
 
-/* In-kernel implementation of tee for pipe buffers.  */
+/* In-kernel implementation of tee for pipe buffers.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 extern ssize_t tee (int __fdin, int __fdout, size_t __len,
 		    unsigned int __flags);
 
-/* Reserve storage for the data of the file associated with FD.  */
+/* Reserve storage for the data of the file associated with FD.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 # ifndef __USE_FILE_OFFSET64
 extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len);
 # else
@@ -278,6 +304,19 @@
 			__off64_t __len);
 # endif
 
+
+/* Map file name to file handle.  */
+extern int name_to_handle_at (int __dfd, const char *__name,
+			      struct file_handle *__handle, int *__mnt_id,
+			      int __flags) __THROW;
+
+/* Open file using the file handle.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
+extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle,
+			      int __flags);
+
 #endif
 
 __END_DECLS

Modified: trunk/ports/sysdeps/unix/sysv/linux/arm/eabi/____longjmp_chk.S
==============================================================================
--- trunk/ports/sysdeps/unix/sysv/linux/arm/eabi/____longjmp_chk.S (original)
+++ trunk/ports/sysdeps/unix/sysv/linux/arm/eabi/____longjmp_chk.S Fri Apr  1 12:43:08 2011
@@ -52,13 +52,15 @@
 	cfi_remember_state;			\
 	cmp	sp, reg;			\
 	bls	.Lok;				\
+	str	r7, [sp, #-4]!;			\
+	cfi_adjust_cfa_offset (4);		\
+	cfi_rel_offset (r7, 0);			\
 	mov	r5, r0;				\
 	cfi_undefined (r5);			\
 	mov	r7, #SYS_ify(sigaltstack);	\
-	cfi_undefined (r7);			\
 	mov	r0, #0;				\
-	sub	sp, sp, #16; /* >= sizeof (stack_t) */ \
-	cfi_adjust_cfa_offset (16);		\
+	sub	sp, sp, #12; /* == sizeof (stack_t) */ \
+	cfi_adjust_cfa_offset (12);		\
 	cfi_remember_state;			\
 	mov	r1, sp;				\
 	swi	#0;				\
@@ -74,6 +76,11 @@
 	cmp	r2, r3;				\
 	bhi	.Lok2;				\
 .Lfail:						\
+	add	sp, sp, #12;			\
+	cfi_adjust_cfa_offset (-12);		\
+	ldr	r7, [sp], #4;			\
+	cfi_adjust_cfa_offset (-4);		\
+	cfi_restore (r7);			\
 	CALL_FAIL				\
 	cfi_restore_state;			\
 .Lok2:						\

Modified: trunk/ports/sysdeps/unix/sysv/linux/arm/eabi/nptl/sysdep-cancel.h
==============================================================================
--- trunk/ports/sysdeps/unix/sysv/linux/arm/eabi/nptl/sysdep-cancel.h (original)
+++ trunk/ports/sysdeps/unix/sysv/linux/arm/eabi/nptl/sysdep-cancel.h Fri Apr  1 12:43:08 2011
@@ -39,6 +39,7 @@
     .cfi_sections .debug_frame;						\
     cfi_startproc;							\
     DO_CALL (syscall_name, args);					\
+    cmn r0, $4096;							\
     PSEUDO_RET;								\
     cfi_endproc;							\
   .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel;	\
@@ -47,20 +48,20 @@
     DOARGS_##args;							\
     bne .Lpseudo_cancel;						\
     cfi_remember_state;							\
-    DO_CALL (syscall_name, 0);						\
+    ldr r7, =SYS_ify (syscall_name);					\
+    swi 0x0;								\
     UNDOARGS_##args;							\
     cmn r0, $4096;							\
     PSEUDO_RET;								\
     cfi_restore_state;							\
   .Lpseudo_cancel:							\
-    .fnstart;								\
+    .fnstart;		/* matched by the .fnend in UNDOARGS below.  */	\
     DOCARGS_##args;	/* save syscall args etc. around CENABLE.  */	\
     CENABLE;								\
     mov ip, r0;		/* put mask in safe place.  */			\
     UNDOCARGS_##args;	/* restore syscall args.  */			\
     ldr r7, =SYS_ify (syscall_name);					\
     swi 0x0;		/* do the call.  */				\
-    .fnend;		/* Past here we can't easily unwind.  */	\
     mov r7, r0;		/* save syscall return value.  */		\
     mov r0, ip;		/* get mask back.  */				\
     CDISABLE;								\
@@ -69,34 +70,34 @@
     UNDOARGS_##args;							\
     cmn r0, $4096
 
-/* DOARGS pushes four bytes on the stack for five arguments, eight bytes for
-   six arguments, and nothing for fewer.  In order to preserve doubleword
+/* DOARGS pushes eight bytes on the stack for five arguments, twelve bytes for
+   six arguments, and four bytes for fewer.  In order to preserve doubleword
    alignment, sometimes we must save an extra register.  */
 
 # define RESTART_UNWIND \
   .fnend; \
   .fnstart; \
-  .save {r7, lr}
+  .save {r7}; \
+  .save {lr}
 
 # define DOCARGS_0 \
-  stmfd sp!, {r7, lr}; \
-  cfi_adjust_cfa_offset (8); \
-  cfi_rel_offset (r7, 0); \
-  cfi_rel_offset (lr, 4); \
-  .save {r7, lr}
+  .save {r7}; \
+  str lr, [sp, #-4]!; \
+  cfi_adjust_cfa_offset (4); \
+  cfi_rel_offset (lr, 0); \
+  .save {lr}
 # define UNDOCARGS_0
 # define RESTORE_LR_0 \
-  ldmfd sp!, {r7, lr}; \
-  cfi_adjust_cfa_offset (-8); \
-  cfi_restore (r7); \
+  ldr lr, [sp], #4; \
+  cfi_adjust_cfa_offset (-4); \
   cfi_restore (lr)
 
 # define DOCARGS_1 \
-  stmfd sp!, {r0, r1, r7, lr}; \
-  cfi_adjust_cfa_offset (16); \
-  cfi_rel_offset (r7, 8); \
-  cfi_rel_offset (lr, 12); \
-  .save {r7, lr}; \
+  .save {r7}; \
+  stmfd sp!, {r0, r1, lr}; \
+  cfi_adjust_cfa_offset (12); \
+  cfi_rel_offset (lr, 8); \
+  .save {lr}; \
   .pad #8
 # define UNDOCARGS_1 \
   ldr r0, [sp], #8; \
@@ -106,11 +107,11 @@
   RESTORE_LR_0
 
 # define DOCARGS_2 \
-  stmfd sp!, {r0, r1, r7, lr}; \
-  cfi_adjust_cfa_offset (16); \
-  cfi_rel_offset (r7, 8); \
-  cfi_rel_offset (lr, 12); \
-  .save {r7, lr}; \
+  .save {r7}; \
+  stmfd sp!, {r0, r1, lr}; \
+  cfi_adjust_cfa_offset (12); \
+  cfi_rel_offset (lr, 8); \
+  .save {lr}; \
   .pad #8
 # define UNDOCARGS_2 \
   ldmfd sp!, {r0, r1}; \
@@ -120,11 +121,11 @@
   RESTORE_LR_0
 
 # define DOCARGS_3 \
-  stmfd sp!, {r0, r1, r2, r3, r7, lr}; \
-  cfi_adjust_cfa_offset (24); \
-  cfi_rel_offset (r7, 16); \
-  cfi_rel_offset (lr, 20); \
-  .save {r7, lr}; \
+  .save {r7}; \
+  stmfd sp!, {r0, r1, r2, r3, lr}; \
+  cfi_adjust_cfa_offset (20); \
+  cfi_rel_offset (lr, 16); \
+  .save {lr}; \
   .pad #16
 # define UNDOCARGS_3 \
   ldmfd sp!, {r0, r1, r2, r3}; \
@@ -134,11 +135,11 @@
   RESTORE_LR_0
 
 # define DOCARGS_4 \
-  stmfd sp!, {r0, r1, r2, r3, r7, lr}; \
-  cfi_adjust_cfa_offset (24); \
-  cfi_rel_offset (r7, 16); \
-  cfi_rel_offset (lr, 20); \
-  .save {r7, lr}; \
+  .save {r7}; \
+  stmfd sp!, {r0, r1, r2, r3, lr}; \
+  cfi_adjust_cfa_offset (20); \
+  cfi_rel_offset (lr, 16); \
+  .save {lr}; \
   .pad #16
 # define UNDOCARGS_4 \
   ldmfd sp!, {r0, r1, r2, r3}; \
@@ -149,43 +150,40 @@
 
 /* r4 is only stmfd'ed for correct stack alignment.  */
 # define DOCARGS_5 \
-  .save {r4}; \
-  stmfd sp!, {r0, r1, r2, r3, r4, r7, lr}; \
-  cfi_adjust_cfa_offset (28); \
-  cfi_rel_offset (r7, 20); \
-  cfi_rel_offset (lr, 24); \
-  .save {r7, lr}; \
+  .save {r4, r7}; \
+  stmfd sp!, {r0, r1, r2, r3, r4, lr}; \
+  cfi_adjust_cfa_offset (24); \
+  cfi_rel_offset (lr, 20); \
+  .save {lr}; \
   .pad #20
 # define UNDOCARGS_5 \
   ldmfd sp!, {r0, r1, r2, r3}; \
   cfi_adjust_cfa_offset (-16); \
   .fnend; \
   .fnstart; \
-  .save {r4}; \
-  .save {r7, lr}; \
+  .save {r4, r7}; \
+  .save {lr}; \
   .pad #4
 # define RESTORE_LR_5 \
-  ldmfd sp!, {r4, r7, lr}; \
-  cfi_adjust_cfa_offset (-12); \
+  ldmfd sp!, {r4, lr}; \
+  cfi_adjust_cfa_offset (-8); \
   /* r4 will be marked as restored later.  */ \
-  cfi_restore (r7); \
   cfi_restore (lr)
 
 # define DOCARGS_6 \
-  .save {r4, r5}; \
-  stmfd sp!, {r0, r1, r2, r3, r7, lr}; \
-  cfi_adjust_cfa_offset (24); \
-  cfi_rel_offset (r7, 16); \
-  cfi_rel_offset (lr, 20); \
-  .save {r7, lr}; \
+  .save {r4, r5, r7}; \
+  stmfd sp!, {r0, r1, r2, r3, lr}; \
+  cfi_adjust_cfa_offset (20); \
+  cfi_rel_offset (lr, 16); \
+  .save {lr}; \
   .pad #16
 # define UNDOCARGS_6 \
   ldmfd sp!, {r0, r1, r2, r3}; \
   cfi_adjust_cfa_offset (-16); \
   .fnend; \
   .fnstart; \
-  .save {r4, r5}; \
-  .save {r7, lr}
+  .save {r4, r5, r7}; \
+  .save {lr};
 # define RESTORE_LR_6 \
   RESTORE_LR_0
 

Modified: trunk/ports/sysdeps/unix/sysv/linux/arm/eabi/sysdep.h
==============================================================================
--- trunk/ports/sysdeps/unix/sysv/linux/arm/eabi/sysdep.h (original)
+++ trunk/ports/sysdeps/unix/sysv/linux/arm/eabi/sysdep.h Fri Apr  1 12:43:08 2011
@@ -106,12 +106,95 @@
 #undef	DO_CALL
 #define DO_CALL(syscall_name, args)		\
     DOARGS_##args;				\
-    mov ip, r7;					\
-    cfi_register (r7, ip);			\
     ldr r7, =SYS_ify (syscall_name);		\
     swi 0x0;					\
-    mov r7, ip;					\
-    cfi_restore (r7);				\
     UNDOARGS_##args
 
+#undef  DOARGS_0
+#define DOARGS_0 \
+  .fnstart; \
+  str r7, [sp, #-4]!; \
+  cfi_adjust_cfa_offset (4); \
+  cfi_rel_offset (r7, 0); \
+  .save { r7 }
+#undef  DOARGS_1
+#define DOARGS_1 DOARGS_0
+#undef  DOARGS_2
+#define DOARGS_2 DOARGS_0
+#undef  DOARGS_3
+#define DOARGS_3 DOARGS_0
+#undef  DOARGS_4
+#define DOARGS_4 DOARGS_0
+#undef  DOARGS_5
+#define DOARGS_5 \
+  .fnstart; \
+  stmfd sp!, {r4, r7}; \
+  cfi_adjust_cfa_offset (8); \
+  cfi_rel_offset (r4, 0); \
+  cfi_rel_offset (r7, 4); \
+  .save { r4, r7 }; \
+  ldr r4, [sp, #8]
+#undef  DOARGS_6
+#define DOARGS_6 \
+  .fnstart; \
+  mov ip, sp; \
+  stmfd sp!, {r4, r5, r7}; \
+  cfi_adjust_cfa_offset (12); \
+  cfi_rel_offset (r4, 0); \
+  cfi_rel_offset (r5, 4); \
+  cfi_rel_offset (r7, 8); \
+  .save { r4, r5, r7 }; \
+  ldmia ip, {r4, r5}
+#undef  DOARGS_7
+#define DOARGS_7 \
+  .fnstart; \
+  mov ip, sp; \
+  stmfd sp!, {r4, r5, r6, r7}; \
+  cfi_adjust_cfa_offset (16); \
+  cfi_rel_offset (r4, 0); \
+  cfi_rel_offset (r5, 4); \
+  cfi_rel_offset (r6, 8); \
+  cfi_rel_offset (r7, 12); \
+  .save { r4, r5, r6, r7 }; \
+  ldmia ip, {r4, r5, r6}
+
+#undef  UNDOARGS_0
+#define UNDOARGS_0 \
+  ldr r7, [sp], #4; \
+  cfi_adjust_cfa_offset (-4); \
+  cfi_restore (r7); \
+  .fnend
+#undef  UNDOARGS_1
+#define UNDOARGS_1 UNDOARGS_0
+#undef  UNDOARGS_2
+#define UNDOARGS_2 UNDOARGS_0
+#undef  UNDOARGS_3
+#define UNDOARGS_3 UNDOARGS_0
+#undef  UNDOARGS_4
+#define UNDOARGS_4 UNDOARGS_0
+#undef  UNDOARGS_5
+#define UNDOARGS_5 \
+  ldmfd sp!, {r4, r7}; \
+  cfi_adjust_cfa_offset (-8); \
+  cfi_restore (r4); \
+  cfi_restore (r7); \
+  .fnend
+#undef  UNDOARGS_6
+#define UNDOARGS_6 \
+  ldmfd sp!, {r4, r5, r7}; \
+  cfi_adjust_cfa_offset (-12); \
+  cfi_restore (r4); \
+  cfi_restore (r5); \
+  cfi_restore (r7); \
+  .fnend
+#undef  UNDOARGS_7
+#define UNDOARGS_7 \
+  ldmfd sp!, {r4, r5, r6, r7}; \
+  cfi_adjust_cfa_offset (-16); \
+  cfi_restore (r4); \
+  cfi_restore (r5); \
+  cfi_restore (r6); \
+  cfi_restore (r7); \
+  .fnend
+
 #endif /* _LINUX_ARM_EABI_SYSDEP_H */

Modified: trunk/ports/sysdeps/unix/sysv/linux/arm/vfork.S
==============================================================================
--- trunk/ports/sysdeps/unix/sysv/linux/arm/vfork.S (original)
+++ trunk/ports/sysdeps/unix/sysv/linux/arm/vfork.S Fri Apr  1 12:43:08 2011
@@ -33,7 +33,28 @@
 #ifdef SAVE_PID
 	SAVE_PID
 #endif
-	DO_CALL (vfork, 0)
+#ifdef __ARM_EABI__
+	/* The DO_CALL macro saves r7 on the stack, to enable generation
+	   of ARM unwind info.  Since the stack is initially shared between
+	   parent and child of vfork, that saved value could be corrupted.
+	   To avoid this problem, we save r7 into ip as well, and restore
+	   from there.  */
+	mov	ip, r7
+	cfi_register (r7, ip)
+	.fnstart
+	str r7, [sp, #-4]!
+	cfi_adjust_cfa_offset (4)
+	.save { r7 }
+	ldr	r7, =SYS_ify (vfork)
+	swi	0x0
+	.fnend
+	add	sp, sp, #4
+	cfi_adjust_cfa_offset (-4)
+	mov	r7, ip
+	cfi_restore (r7);
+#else
+	swi	SYS_ify(vfork)
+#endif
 #ifdef RESTORE_PID
 	RESTORE_PID
 #endif

Modified: trunk/ports/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
==============================================================================
--- trunk/ports/sysdeps/unix/sysv/linux/mips/bits/fcntl.h (original)
+++ trunk/ports/sysdeps/unix/sysv/linux/mips/bits/fcntl.h Fri Apr  1 12:43:08 2011
@@ -1,6 +1,6 @@
 /* O_*, F_*, FD_* bit values for Linux.
    Copyright (C) 1995, 1996, 1997, 1998, 2000, 2002, 2003, 2004, 2006,
-   2007, 2009, 2010 Free Software Foundation, Inc.
+   2007, 2009, 2010, 2011 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
@@ -54,6 +54,7 @@
 #ifdef __USE_GNU
 # define O_DIRECT	0x8000	/* Direct disk access hint.  */
 # define O_NOATIME	0x40000	/* Do not set atime.  */
+# define O_PATH	      010000000 /* Resolve pathname but do not open file.  */
 #endif
 
 /* For now Linux has no synchronisity options for data and read operations.
@@ -245,6 +246,19 @@
 					   we splice from/to).  */
 # define SPLICE_F_MORE		4	/* Expect more data.  */
 # define SPLICE_F_GIFT		8	/* Pages passed in are a gift.  */
+
+
+/* File handle structure.  */
+struct file_handle
+{
+  unsigned int handle_bytes;
+  int handle_type;
+  /* File identifier.  */
+  unsigned char f_handle[0];
+};
+
+/* Maximum handle size (for now).  */
+# define MAX_HANDLE_SZ	128
 #endif
 
 __BEGIN_DECLS
@@ -261,20 +275,32 @@
 			    unsigned int __flags);
 
 
-/* Splice address range into a pipe.  */
+/* Splice address range into a pipe.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
 			 size_t __count, unsigned int __flags);
 
-/* Splice two files together.  */
+/* Splice two files together.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
 		       __off64_t *__offout, size_t __len,
 		       unsigned int __flags);
 
-/* In-kernel implementation of tee for pipe buffers.  */
+/* In-kernel implementation of tee for pipe buffers.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 extern ssize_t tee (int __fdin, int __fdout, size_t __len,
 		    unsigned int __flags);
 
-/* Reserve storage for the data of the file associated with FD.  */
+/* Reserve storage for the data of the file associated with FD.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 # ifndef __USE_FILE_OFFSET64
 extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len);
 # else
@@ -291,6 +317,19 @@
 			__off64_t __len);
 # endif
 
+
+/* Map file name to file handle.  */
+extern int name_to_handle_at (int __dfd, const char *__name,
+			      struct file_handle *__handle, int *__mnt_id,
+			      int __flags) __THROW;
+
+/* Open file using the file handle.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
+extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle,
+			      int __flags);
+
 #endif
 
 __END_DECLS

Modified: trunk/ports/sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c
==============================================================================
--- trunk/ports/sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c (original)
+++ trunk/ports/sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c Fri Apr  1 12:43:08 2011
@@ -1,5 +1,5 @@
 /* Selective file content synch'ing.
-   Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2007, 2011 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
@@ -21,7 +21,7 @@
 #include <fcntl.h>
 #include <sys/types.h>
 
-#include <sysdep.h>
+#include <sysdep-cancel.h>
 #include <sys/syscall.h>
 
 
@@ -29,10 +29,23 @@
 int
 sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
 {
-  return INLINE_SYSCALL (sync_file_range, 7, fd, 0,
-			 __LONG_LONG_PAIR ((long) (from >> 32), (long) from),
-			 __LONG_LONG_PAIR ((long) (to >> 32), (long) to),
-			 flags);
+  if (SINGLE_THREAD_P)
+    return INLINE_SYSCALL (sync_file_range, 7, fd, 0,
+			   __LONG_LONG_PAIR ((long) (from >> 32), (long) from),
+			   __LONG_LONG_PAIR ((long) (to >> 32), (long) to),
+			   flags);
+
+  int result;
+  int oldtype = LIBC_CANCEL_ASYNC ();
+
+  result = INLINE_SYSCALL (sync_file_range, 7, fd, 0,
+			   __LONG_LONG_PAIR ((long) (from >> 32), (long) from),
+			   __LONG_LONG_PAIR ((long) (to >> 32), (long) to),
+			   flags);
+
+  LIBC_CANCEL_RESET (oldtype);
+
+  return result;
 }
 #else
 int

Modified: trunk/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate.c
==============================================================================
--- trunk/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate.c (original)
+++ trunk/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate.c Fri Apr  1 12:43:08 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2007, 2009, 2011 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
@@ -18,7 +18,7 @@
 
 #include <errno.h>
 #include <fcntl.h>
-#include <sysdep.h>
+#include <sysdep-cancel.h>
 
 
 /* Reserve storage for the data of the file associated with FD.  */
@@ -26,7 +26,17 @@
 fallocate (int fd, int mode, __off_t offset, __off_t len)
 {
 #ifdef __NR_fallocate
-  return INLINE_SYSCALL (fallocate, 4, fd, mode, offset, len);
+  if (SINGLE_THREAD_P)
+    return INLINE_SYSCALL (fallocate, 4, fd, mode, offset, len);
+
+  int result;
+  int oldtype = LIBC_CANCEL_ASYNC ();
+
+  result = INLINE_SYSCALL (fallocate, 4, fd, mode, offset, len);
+
+  LIBC_CANCEL_RESET (oldtype);
+
+  return result;
 #else
   __set_errno (ENOSYS);
   return -1;

Modified: trunk/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate64.c
==============================================================================
--- trunk/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate64.c (original)
+++ trunk/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate64.c Fri Apr  1 12:43:08 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2007, 2009, 2011 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
@@ -18,7 +18,7 @@
 
 #include <errno.h>
 #include <fcntl.h>
-#include <sysdep.h>
+#include <sysdep-cancel.h>
 
 
 /* Reserve storage for the data of the file associated with FD.  */
@@ -26,7 +26,17 @@
 fallocate64 (int fd, int mode, __off64_t offset, __off64_t len)
 {
 #ifdef __NR_fallocate
-  return INLINE_SYSCALL (fallocate, 4, fd, mode, offset, len);
+  if (SINGLE_THREAD_P)
+    return INLINE_SYSCALL (fallocate, 4, fd, mode, offset, len);
+
+  int result;
+  int oldtype = LIBC_CANCEL_ASYNC ();
+
+  result = INLINE_SYSCALL (fallocate, 4, fd, mode, offset, len);
+
+  LIBC_CANCEL_RESET (oldtype);
+
+  return result;
 #else
   __set_errno (ENOSYS);
   return -1;

Modified: trunk/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list
==============================================================================
--- trunk/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list (original)
+++ trunk/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list Fri Apr  1 12:43:08 2011
@@ -1,7 +1,7 @@
 # File name	Caller	Syscall name	# args	Strong name	Weak names
 
 readahead	-	readahead	i:iii	__readahead	readahead
-sync_file_range	-	sync_file_range	i:iiii	sync_file_range
+sync_file_range	-	sync_file_range	Ci:iiii	sync_file_range
 ftruncate	-	ftruncate	i:ii	__ftruncate	ftruncate ftruncate64 __ftruncate64
 truncate	-	truncate	i:si	truncate	truncate64
 

Modified: trunk/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list
==============================================================================
--- trunk/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list (original)
+++ trunk/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list Fri Apr  1 12:43:08 2011
@@ -1,4 +1,6 @@
 # File name	Caller	Syscall name	# args	Strong name	Weak names
+
+sync_file_range	-	sync_file_range	Ci:iiii	sync_file_range
 
 prlimit		EXTRA	prlimit64	i:iipp	prlimit		prlimit64