[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[commits] r13345 - in /fsf/trunk/libc: ./ iconv/ io/ libio/ misc/ posix/ stdlib/ sysdeps/unix/ sysdeps/unix/sysv/linux/ sysdeps/unix/s...
- To: commits@xxxxxxxxxx
- Subject: [commits] r13345 - in /fsf/trunk/libc: ./ iconv/ io/ libio/ misc/ posix/ stdlib/ sysdeps/unix/ sysdeps/unix/sysv/linux/ sysdeps/unix/s...
- From: eglibc@xxxxxxxxxx
- Date: Fri, 01 Apr 2011 19:24:24 -0000
Author: eglibc
Date: Fri Apr 1 12:24:22 2011
New Revision: 13345
Log:
Import glibc-mainline for 2011-04-01
Added:
fsf/trunk/libc/misc/syncfs.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/call_sync_file_range.S
fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/sync_file_range.c
Removed:
fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/sync_file_range.S
Modified:
fsf/trunk/libc/ChangeLog
fsf/trunk/libc/NEWS
fsf/trunk/libc/iconv/iconv.h
fsf/trunk/libc/io/Makefile
fsf/trunk/libc/io/fcntl.h
fsf/trunk/libc/libio/stdio.h
fsf/trunk/libc/misc/Makefile
fsf/trunk/libc/misc/Versions
fsf/trunk/libc/posix/spawn.h
fsf/trunk/libc/posix/unistd.h
fsf/trunk/libc/stdlib/stdlib.h
fsf/trunk/libc/sysdeps/unix/syscalls.list
fsf/trunk/libc/sysdeps/unix/sysv/linux/Makefile
fsf/trunk/libc/sysdeps/unix/sysv/linux/Versions
fsf/trunk/libc/sysdeps/unix/sysv/linux/fallocate.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/fallocate64.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/Makefile
fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/bits/fcntl.h
fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/fallocate.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/fallocate64.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h
fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h
fsf/trunk/libc/sysdeps/unix/sysv/linux/s390/bits/fcntl.h
fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/bits/fcntl.h
fsf/trunk/libc/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
fsf/trunk/libc/sysdeps/unix/sysv/linux/sync_file_range.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/syscalls.list
fsf/trunk/libc/sysdeps/unix/sysv/linux/wordsize-64/fallocate.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list
fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h
fsf/trunk/libc/time/time.h
fsf/trunk/libc/wcsmbs/wchar.h
Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Fri Apr 1 12:24:22 2011
@@ -1,3 +1,81 @@
+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.
Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Fri Apr 1 12:24:22 2011
@@ -1,4 +1,4 @@
-GNU C Library NEWS -- history of user-visible changes. 2011-3-30
+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.
@@ -7,7 +7,7 @@
Version 2.14
-* New Linux interfaces: clock_adjtime
+* New Linux interfaces: clock_adjtime, name_to_handle_at, open_by_handle_at
* The following bugs are resolved with this release:
Modified: fsf/trunk/libc/iconv/iconv.h
==============================================================================
--- fsf/trunk/libc/iconv/iconv.h (original)
+++ fsf/trunk/libc/iconv/iconv.h Fri Apr 1 12:24:22 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: fsf/trunk/libc/io/Makefile
==============================================================================
--- fsf/trunk/libc/io/Makefile (original)
+++ fsf/trunk/libc/io/Makefile Fri Apr 1 12:24:22 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
@@ -90,6 +90,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: fsf/trunk/libc/io/fcntl.h
==============================================================================
--- fsf/trunk/libc/io/fcntl.h (original)
+++ fsf/trunk/libc/io/fcntl.h Fri Apr 1 12:24:22 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: fsf/trunk/libc/libio/stdio.h
==============================================================================
--- fsf/trunk/libc/libio/stdio.h (original)
+++ fsf/trunk/libc/libio/stdio.h Fri Apr 1 12:24:22 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: fsf/trunk/libc/misc/Makefile
==============================================================================
--- fsf/trunk/libc/misc/Makefile (original)
+++ fsf/trunk/libc/misc/Makefile Fri Apr 1 12:24:22 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
@@ -41,7 +41,7 @@
getdtsz \
gethostname sethostname getdomain setdomain \
select pselect \
- acct chroot fsync sync fdatasync reboot \
+ acct chroot fsync sync fdatasync syncfs reboot \
gethostid sethostid \
revoke vhangup \
swapon swapoff mktemp mkstemp mkstemp64 mkdtemp \
Modified: fsf/trunk/libc/misc/Versions
==============================================================================
--- fsf/trunk/libc/misc/Versions (original)
+++ fsf/trunk/libc/misc/Versions Fri Apr 1 12:24:22 2011
@@ -143,4 +143,7 @@
GLIBC_2.11 {
mkstemps; mkstemps64; mkostemps; mkostemps64;
}
+ GLIBC_2.14 {
+ syncfs;
+ }
}
Added: fsf/trunk/libc/misc/syncfs.c
==============================================================================
--- fsf/trunk/libc/misc/syncfs.c (added)
+++ fsf/trunk/libc/misc/syncfs.c Fri Apr 1 12:24:22 2011
@@ -1,0 +1,33 @@
+/* Copyright (C) 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <errno.h>
+#include <unistd.h>
+
+/* Make all changes done to all files on the file system associated
+ with FD actually appear on disk. */
+int
+syncfs (int fd)
+{
+ __set_errno (ENOSYS);
+ return -1;
+}
+
+
+stub_warning (syncfs)
+#include <stub-tag.h>
Modified: fsf/trunk/libc/posix/spawn.h
==============================================================================
--- fsf/trunk/libc/posix/spawn.h (original)
+++ fsf/trunk/libc/posix/spawn.h Fri Apr 1 12:24:22 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: fsf/trunk/libc/posix/unistd.h
==============================================================================
--- fsf/trunk/libc/posix/unistd.h (original)
+++ fsf/trunk/libc/posix/unistd.h Fri Apr 1 12:24:22 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: fsf/trunk/libc/stdlib/stdlib.h
==============================================================================
--- fsf/trunk/libc/stdlib/stdlib.h (original)
+++ fsf/trunk/libc/stdlib/stdlib.h Fri Apr 1 12:24:22 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: fsf/trunk/libc/sysdeps/unix/syscalls.list
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/syscalls.list (original)
+++ fsf/trunk/libc/sysdeps/unix/syscalls.list Fri Apr 1 12:24:22 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: fsf/trunk/libc/sysdeps/unix/sysv/linux/Makefile
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/Makefile (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/Makefile Fri Apr 1 12:24:22 2011
@@ -95,7 +95,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: fsf/trunk/libc/sysdeps/unix/sysv/linux/Versions
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/Versions (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/Versions Fri Apr 1 12:24:22 2011
@@ -156,6 +156,8 @@
}
GLIBC_2.14 {
clock_adjtime;
+
+ name_to_handle_at; open_by_handle_at;
}
GLIBC_PRIVATE {
# functions used in other libraries
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/fallocate.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/fallocate.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/fallocate.c Fri Apr 1 12:24:22 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: fsf/trunk/libc/sysdeps/unix/sysv/linux/fallocate64.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/fallocate64.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/fallocate64.c Fri Apr 1 12:24:22 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: fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/Makefile
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/Makefile (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/Makefile Fri Apr 1 12:24:22 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: fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/bits/fcntl.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/bits/fcntl.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/bits/fcntl.h Fri Apr 1 12:24:22 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
Added: fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/call_sync_file_range.S
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/call_sync_file_range.S (added)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/call_sync_file_range.S Fri Apr 1 12:24:22 2011
@@ -1,0 +1,72 @@
+/* Selective file content synch'ing.
+ 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <sysdep.h>
+#define _ERRNO_H 1
+#include <bits/errno.h>
+
+
+ .text
+ENTRY (__call_sync_file_range)
+#ifdef __NR_sync_file_range
+ pushl %ebx
+ cfi_adjust_cfa_offset (4)
+ pushl %esi
+ cfi_adjust_cfa_offset (4)
+ pushl %edi
+ cfi_adjust_cfa_offset (4)
+ pushl %ebp
+ cfi_adjust_cfa_offset (4)
+
+ movl 20(%esp), %ebx
+ cfi_rel_offset (ebx, 12)
+ movl 24(%esp), %ecx
+ movl 28(%esp), %edx
+ movl 32(%esp), %esi
+ cfi_rel_offset (esi, 8)
+ movl 36(%esp), %edi
+ cfi_rel_offset (edi, 4)
+ movl 40(%esp), %ebp
+ cfi_rel_offset (ebp, 0)
+
+ movl $SYS_ify(sync_file_range), %eax
+ ENTER_KERNEL
+
+ popl %ebp
+ cfi_adjust_cfa_offset (-4)
+ cfi_restore (ebp)
+ popl %edi
+ cfi_adjust_cfa_offset (-4)
+ cfi_restore (edi)
+ popl %esi
+ cfi_adjust_cfa_offset (-4)
+ cfi_restore (esi)
+ popl %ebx
+ cfi_adjust_cfa_offset (-4)
+ cfi_restore (ebx)
+
+ cmpl $-4095, %eax
+ jae SYSCALL_ERROR_LABEL
+#else
+ movl $-ENOSYS, %eax
+ jmp SYSCALL_ERROR_LABEL
+#endif
+L(pseudo_end):
+ ret
+PSEUDO_END (__call_sync_file_range)
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/fallocate.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/fallocate.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/fallocate.c Fri Apr 1 12:24:22 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: fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/fallocate64.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/fallocate64.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/fallocate64.c Fri Apr 1 12:24:22 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);
Added: fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/sync_file_range.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/sync_file_range.c (added)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/sync_file_range.c Fri Apr 1 12:24:22 2011
@@ -1,0 +1,44 @@
+/* Selective file content synch'ing.
+ 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <sysdep-cancel.h>
+
+
+extern int __call_sync_file_range (int fd, off64_t offset, off64_t nbytes,
+ unsigned int flags)
+ attribute_hidden;
+
+
+int
+sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
+{
+ if (SINGLE_THREAD_P)
+ return __call_sync_file_range (fd, from, to, flags);
+
+ int result;
+ int oldtype = LIBC_CANCEL_ASYNC ();
+
+ result = __call_sync_file_range (fd, from, to, flags);
+
+ LIBC_CANCEL_RESET (oldtype);
+
+ return result;
+}
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h Fri Apr 1 12:24:22 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: fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h Fri Apr 1 12:24:22 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: fsf/trunk/libc/sysdeps/unix/sysv/linux/s390/bits/fcntl.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/s390/bits/fcntl.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/s390/bits/fcntl.h Fri Apr 1 12:24:22 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: fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/bits/fcntl.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/bits/fcntl.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/bits/fcntl.h Fri Apr 1 12:24:22 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: fsf/trunk/libc/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h Fri Apr 1 12:24:22 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: fsf/trunk/libc/sysdeps/unix/sysv/linux/sync_file_range.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/sync_file_range.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/sync_file_range.c Fri Apr 1 12:24:22 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: fsf/trunk/libc/sysdeps/unix/sysv/linux/syscalls.list
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/syscalls.list (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/syscalls.list Fri Apr 1 12:24:22 2011
@@ -104,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: fsf/trunk/libc/sysdeps/unix/sysv/linux/wordsize-64/fallocate.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/wordsize-64/fallocate.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/wordsize-64/fallocate.c Fri Apr 1 12:24:22 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: fsf/trunk/libc/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list Fri Apr 1 12:24:22 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: fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h Fri Apr 1 12:24:22 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: fsf/trunk/libc/time/time.h
==============================================================================
--- fsf/trunk/libc/time/time.h (original)
+++ fsf/trunk/libc/time/time.h Fri Apr 1 12:24:22 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: fsf/trunk/libc/wcsmbs/wchar.h
==============================================================================
--- fsf/trunk/libc/wcsmbs/wchar.h (original)
+++ fsf/trunk/libc/wcsmbs/wchar.h Fri Apr 1 12:24:22 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