This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
name_to_handle_at, open_by_handle etc.
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: libc-ports at sourceware dot org
- Date: Fri, 1 Apr 2011 16:22:26 +0000 (UTC)
- Subject: name_to_handle_at, open_by_handle etc.
I've applied this patch to update the ARM and MIPS bits/fcntl.h headers
for the recent addition of name_to_handle_at, open_by_handle etc. (O_PATH
will come in separate patches).
Port maintainers (M68K, HPPA, Alpha, ...) should note that all ports will
need corresponding updates. This one is a straightforward matter of
applying the same patch to all versions, while O_PATH requires checking
the correct value used by the kernel for each target.
diff --git a/ChangeLog.arm b/ChangeLog.arm
index 805ab1a..a55e6a0 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,9 @@
+2011-04-01 Joseph Myers <joseph@codesourcery.com>
+
+ * 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@linaro.org>
* sysdeps/arm/linuxthreads: Remove directory.
diff --git a/ChangeLog.mips b/ChangeLog.mips
index 04cab0c..b88dbca 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,5 +1,11 @@
2011-04-01 Joseph Myers <joseph@codesourcery.com>
+ * 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@codesourcery.com>
+
* sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c: Make
cancelable.
* sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate.c: Likewise.
diff --git a/sysdeps/unix/sysv/linux/arm/bits/fcntl.h b/sysdeps/unix/sysv/linux/arm/bits/fcntl.h
index 952ae05..6a5f89a 100644
--- a/sysdeps/unix/sysv/linux/arm/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/arm/bits/fcntl.h
@@ -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.
@@ -232,6 +232,19 @@ struct f_owner_ex
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 +261,32 @@ 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
@@ -278,6 +303,19 @@ extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
__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 (int __mountdirfd, struct file_handle *__handle,
+ int __flags);
+
#endif
__END_DECLS
diff --git a/sysdeps/unix/sysv/linux/mips/bits/fcntl.h b/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
index 31cb861..e285567 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
@@ -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
@@ -245,6 +245,19 @@ struct f_owner_ex
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 +274,32 @@ 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
@@ -291,6 +316,19 @@ extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
__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 (int __mountdirfd, struct file_handle *__handle,
+ int __flags);
+
#endif
__END_DECLS
--
Joseph S. Myers
joseph@codesourcery.com