aboutsummaryrefslogtreecommitdiff
path: root/io
diff options
context:
space:
mode:
Diffstat (limited to 'io')
-rw-r--r--io/Makefile13
-rw-r--r--io/Versions1
-rw-r--r--io/sys/stat.h37
3 files changed, 45 insertions, 6 deletions
diff --git a/io/Makefile b/io/Makefile
index 9339ffe..76e6072 100644
--- a/io/Makefile
+++ b/io/Makefile
@@ -28,13 +28,14 @@ headers := sys/stat.h bits/stat.h sys/statfs.h bits/statfs.h sys/vfs.h \
routines := \
utime \
- mkfifo \
- stat fstat lstat mknod stat64 fstat64 lstat64 fstatat fstatat64 \
- xstat fxstat lxstat xmknod xstat64 fxstat64 lxstat64 \
+ mkfifo mkfifoat \
+ stat fstat lstat stat64 fstat64 lstat64 fstatat fstatat64 \
+ xstat fxstat lxstat xstat64 fxstat64 lxstat64 \
+ mknod mknodat xmknod xmknodat \
fxstatat fxstatat64 \
statfs fstatfs statfs64 fstatfs64 \
statvfs fstatvfs statvfs64 fstatvfs64 \
- umask chmod fchmod lchmod mkdir \
+ umask chmod fchmod lchmod mkdir mkdirat \
open open64 openat openat64 close \
read write lseek lseek64 access euidaccess \
fcntl flock lockf lockf64 \
@@ -54,8 +55,8 @@ routines := \
# These routines will be omitted from the libc shared object.
# Instead the static object files will be included in a special archive
# linked against when the shared library will be used.
-static-only-routines = stat fstat lstat mknod stat64 fstat64 lstat64 \
- fstatat fstatat64
+static-only-routines = stat fstat lstat stat64 fstat64 lstat64 \
+ fstatat fstatat64 mknod mknodat
others := pwd
test-srcs := ftwtest
diff --git a/io/Versions b/io/Versions
index 65ee771..05b9bfc 100644
--- a/io/Versions
+++ b/io/Versions
@@ -100,6 +100,7 @@ libc {
GLIBC_2.4 {
fchownat;
__fxstatat; __fxstatat64;
+ mkdirat; mkfifoat; __xmknodat;
openat; openat64;
unlinkat;
}
diff --git a/io/sys/stat.h b/io/sys/stat.h
index 0315299..d164645 100644
--- a/io/sys/stat.h
+++ b/io/sys/stat.h
@@ -305,6 +305,14 @@ extern __mode_t getumask (void) __THROW;
extern int mkdir (__const char *__path, __mode_t __mode)
__THROW __nonnull ((1));
+#ifdef __USE_GNU
+/* Like mkdir, create a new directory with permission bits MODE. But
+ interpret relative PATH names relative to the directory associated
+ with FD. */
+extern int mkdirat (int __fd, __const char *__path, __mode_t __mode)
+ __THROW __nonnull ((2));
+#endif
+
/* Create a device file named PATH, with permission and special bits MODE
and device number DEV (which can be constructed from major and minor
device numbers with the `makedev' macro above). */
@@ -313,10 +321,26 @@ extern int mknod (__const char *__path, __mode_t __mode, __dev_t __dev)
__THROW __nonnull ((1));
#endif
+#ifdef __USE_GNU
+/* Like mknod, create a new device file with permission bits MODE and
+ device number DEV. But interpret relative PATH names relative to
+ the directory associated with FD. */
+extern int mknodat (int __fd, __const char *__path, __mode_t __mode,
+ __dev_t __dev) __THROW __nonnull ((2));
+#endif
+
/* Create a new FIFO named PATH, with permission bits MODE. */
extern int mkfifo (__const char *__path, __mode_t __mode)
__THROW __nonnull ((1));
+
+#ifdef __USE_GNU
+/* Like mkfifo, create a new FIFO with permission bits MODE. But
+ interpret relative PATH names relative to the directory associated
+ with FD. */
+extern int mkfifoat (int __fd, __const char *__path, __mode_t __mode)
+ __THROW __nonnull ((2));
+#endif
/* To allow the `struct stat' structure and the file type `mode_t'
bits to vary without changing shared library major version number,
@@ -388,6 +412,10 @@ extern int __fxstatat64 (int __ver, int __fildes, __const char *__filename,
extern int __xmknod (int __ver, __const char *__path, __mode_t __mode,
__dev_t *__dev) __THROW __nonnull ((2, 4));
+extern int __xmknodat (int __ver, int __fd, __const char *__path,
+ __mode_t __mode, __dev_t *__dev)
+ __THROW __nonnull ((3, 5));
+
#if defined __GNUC__ && __GNUC__ >= 2
/* Inlined versions of the real stat and mknod functions. */
@@ -428,6 +456,15 @@ __NTH (mknod (__const char *__path, __mode_t __mode, __dev_t __dev))
}
# endif
+# ifdef __USE_GNU
+extern __inline__ int
+__NTH (mknodat (int __fd, __const char *__path, __mode_t __mode,
+ __dev_t __dev))
+{
+ return __xmknodat (_MKNOD_VER, __fd, __path, __mode, &__dev);
+}
+# endif
+
# if defined __USE_LARGEFILE64 \
&& (! defined __USE_FILE_OFFSET64 \
|| (defined __REDIRECT_NTH && defined __OPTIMIZE__))