diff options
author | Ulrich Drepper <drepper@redhat.com> | 2005-12-02 21:55:54 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2005-12-02 21:55:54 +0000 |
commit | e186c703dc073b8be95d0bf893bb8ebb127fe02b (patch) | |
tree | bcb3f09e881383811b00aa8359cb2f71391b116b /io/sys | |
parent | 975407d507f2e8ad6cbf366e22e0f41d598ddcee (diff) | |
download | glibc-e186c703dc073b8be95d0bf893bb8ebb127fe02b.zip glibc-e186c703dc073b8be95d0bf893bb8ebb127fe02b.tar.gz glibc-e186c703dc073b8be95d0bf893bb8ebb127fe02b.tar.bz2 |
* io/Makefile (routines): Add mknodat, xmknodat, mkdirat, mkfifoat.
(static-only-routines): Add mknodat.
* io/Versions [GLIBC_2.4]: Add mkdirat, mkfifoat, __xmknodat.
* io/sys/stat.h: Declare mkditat, mknodat, mkfifoat, __xmknodat.
Define mknodat inline function.
* include/sys/stat.h: Add hidden proto for __xmknodat.
* sysdeps/generic/mkdirat.c: New file.
* sysdeps/generic/mkfifoat.c: New file.
* sysdeps/generic/mknodat.c: New file.
* sysdeps/generic/xmknodat.c: New file.
* sysdeps/unix/mkfifoat.c: New file.
* sysdeps/unix/sysv/linux/mkdirat.c: New file.
* sysdeps/unix/sysv/linux/xmknodat.c: New file.
* sysdeps/generic/xmknod.c: Add one more parameter check.
Diffstat (limited to 'io/sys')
-rw-r--r-- | io/sys/stat.h | 37 |
1 files changed, 37 insertions, 0 deletions
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__)) |