diff options
Diffstat (limited to 'io/sys')
-rw-r--r-- | io/sys/poll.h | 26 | ||||
-rw-r--r-- | io/sys/sendfile.h | 6 | ||||
-rw-r--r-- | io/sys/stat.h | 100 |
3 files changed, 126 insertions, 6 deletions
diff --git a/io/sys/poll.h b/io/sys/poll.h index 89a27eab2b..4085b785ee 100644 --- a/io/sys/poll.h +++ b/io/sys/poll.h @@ -1,5 +1,5 @@ /* Compatibility definitions for System V `poll' interface. - Copyright (C) 1994,96,97,98,99,2000,2001,2004 Free Software Foundation, Inc. + Copyright (C) 1994,1996-2001,2004,2005,2006 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,13 @@ /* Get the platform dependent bits of `poll'. */ #include <bits/poll.h> +#ifdef __USE_GNU +/* Get the __sigset_t definition. */ +# include <bits/sigset.h> +/* Get the timespec definition. */ +# define __need_timespec +# include <time.h> +#endif /* Type used for the number of file descriptors. */ @@ -44,9 +51,24 @@ __BEGIN_DECLS FDS. If TIMEOUT is nonzero and not -1, allow TIMEOUT milliseconds for an event to occur; if TIMEOUT is -1, block until an event occurs. Returns the number of file descriptors with events, zero if timed out, - or -1 for errors. */ + or -1 for errors. + + This function is a cancellation point and therefore not marked with + __THROW. */ extern int poll (struct pollfd *__fds, nfds_t __nfds, int __timeout); +#ifdef __USE_GNU +/* Like poll, but before waiting the threads signal mask is replaced + with that specified in the fourth parameter. For better usability, + the timeout value is specified using a TIMESPEC object. + + This function is a cancellation point and therefore not marked with + __THROW. */ +extern int ppoll (struct pollfd *__fds, nfds_t __nfds, + __const struct timespec *__timeout, + __const __sigset_t *__ss); +#endif + __END_DECLS #endif /* sys/poll.h */ diff --git a/io/sys/sendfile.h b/io/sys/sendfile.h index 24256b5414..4c1367b6be 100644 --- a/io/sys/sendfile.h +++ b/io/sys/sendfile.h @@ -32,19 +32,19 @@ __BEGIN_DECLS case of error. */ #ifndef __USE_FILE_OFFSET64 extern ssize_t sendfile (int __out_fd, int __in_fd, off_t *__offset, - size_t __count) __THROW __nonnull ((3)); + size_t __count) __THROW; #else # ifdef __REDIRECT_NTH extern ssize_t __REDIRECT_NTH (sendfile, (int __out_fd, int __in_fd, __off64_t *__offset, - size_t __count), sendfile64) __nonnull ((3)); + size_t __count), sendfile64); # else # define sendfile sendfile64 # endif #endif #ifdef __USE_LARGEFILE64 extern ssize_t sendfile64 (int __out_fd, int __in_fd, __off64_t *__offset, - size_t __count) __THROW __nonnull ((3)); + size_t __count) __THROW; #endif __END_DECLS diff --git a/io/sys/stat.h b/io/sys/stat.h index 7075003922..4cc0b429a2 100644 --- a/io/sys/stat.h +++ b/io/sys/stat.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991,1992,1995-2002,2003,2004 Free Software Foundation, Inc. +/* Copyright (C) 1991,1992,1995-2004,2005,2006 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 @@ -228,6 +228,30 @@ extern int stat64 (__const char *__restrict __file, extern int fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2)); #endif +#ifdef __USE_ATFILE +/* Similar to stat, get the attributes for FILE and put them in BUF. + Relative path names are interpreted relative to FD unless FD is + AT_FDCWD. */ +# ifndef __USE_FILE_OFFSET64 +extern int fstatat (int __fd, __const char *__restrict __file, + struct stat *__restrict __buf, int __flag) + __THROW __nonnull ((2, 3)); +# else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (fstatat, (int __fd, __const char *__restrict __file, + struct stat *__restrict __buf, + int __flag), + fstatat64) __nonnull ((2, 3)); +# else +# define fstatat fstatat64 +# endif +# endif + +extern int fstatat64 (int __fd, __const char *__restrict __file, + struct stat64 *__restrict __buf, int __flag) + __THROW __nonnull ((2, 3)); +#endif + #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED # ifndef __USE_FILE_OFFSET64 /* Get file attributes about FILE and put them in BUF. @@ -269,6 +293,14 @@ extern int lchmod (__const char *__file, __mode_t __mode) extern int fchmod (int __fd, __mode_t __mode) __THROW; #endif +#ifdef __USE_ATFILE +/* Set file access permissions of FILE relative to + the directory FD is open on. */ +extern int fchmodat (int __fd, __const char *__file, __mode_t mode, int __flag) + __THROW __nonnull ((2)) __wur; +#endif /* Use ATFILE. */ + + /* Set the file creation mask of the current process to MASK, and return the old creation mask. */ @@ -284,6 +316,14 @@ extern __mode_t getumask (void) __THROW; extern int mkdir (__const char *__path, __mode_t __mode) __THROW __nonnull ((1)); +#ifdef __USE_ATFILE +/* 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). */ @@ -292,10 +332,26 @@ extern int mknod (__const char *__path, __mode_t __mode, __dev_t __dev) __THROW __nonnull ((1)); #endif +#ifdef __USE_ATFILE +/* 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_ATFILE +/* 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, @@ -327,6 +383,9 @@ extern int __xstat (int __ver, __const char *__filename, struct stat *__stat_buf) __THROW __nonnull ((2, 3)); extern int __lxstat (int __ver, __const char *__filename, struct stat *__stat_buf) __THROW __nonnull ((2, 3)); +extern int __fxstatat (int __ver, int __fildes, __const char *__filename, + struct stat *__stat_buf, int __flag) + __THROW __nonnull ((3, 4)); #else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (__fxstat, (int __ver, int __fildes, @@ -338,6 +397,10 @@ extern int __REDIRECT_NTH (__xstat, (int __ver, __const char *__filename, extern int __REDIRECT_NTH (__lxstat, (int __ver, __const char *__filename, struct stat *__stat_buf), __lxstat64) __nonnull ((2, 3)); +extern int __REDIRECT_NTH (__fxstatat, (int __ver, int __fildes, + __const char *__filename, + struct stat *__stat_buf, int __flag), + __fxstatat64) __nonnull ((3, 4)); # else # define __fxstat __fxstat64 @@ -353,10 +416,17 @@ extern int __xstat64 (int __ver, __const char *__filename, struct stat64 *__stat_buf) __THROW __nonnull ((2, 3)); extern int __lxstat64 (int __ver, __const char *__filename, struct stat64 *__stat_buf) __THROW __nonnull ((2, 3)); +extern int __fxstatat64 (int __ver, int __fildes, __const char *__filename, + struct stat64 *__stat_buf, int __flag) + __THROW __nonnull ((3, 4)); #endif 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. */ @@ -380,6 +450,15 @@ __NTH (fstat (int __fd, struct stat *__statbuf)) return __fxstat (_STAT_VER, __fd, __statbuf); } +# ifdef __USE_ATFILE +extern __inline__ int +__NTH (fstatat (int __fd, __const char *__filename, struct stat *__statbuf, + int __flag)) +{ + return __fxstatat (_STAT_VER, __fd, __filename, __statbuf, __flag); +} +# endif + # if defined __USE_MISC || defined __USE_BSD extern __inline__ int __NTH (mknod (__const char *__path, __mode_t __mode, __dev_t __dev)) @@ -388,6 +467,15 @@ __NTH (mknod (__const char *__path, __mode_t __mode, __dev_t __dev)) } # endif +# ifdef __USE_ATFILE +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__)) @@ -410,6 +498,16 @@ __NTH (fstat64 (int __fd, struct stat64 *__statbuf)) { return __fxstat64 (_STAT_VER, __fd, __statbuf); } + +# ifdef __USE_GNU +extern __inline__ int +__NTH (fstatat64 (int __fd, __const char *__filename, struct stat64 *__statbuf, + int __flag)) +{ + return __fxstatat64 (_STAT_VER, __fd, __filename, __statbuf, __flag); +} +# endif + # endif #endif |