diff options
Diffstat (limited to 'sysdeps/unix/sysv/linux/alpha/bits/fcntl.h')
-rw-r--r-- | sysdeps/unix/sysv/linux/alpha/bits/fcntl.h | 79 |
1 files changed, 51 insertions, 28 deletions
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h b/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h index b70502f21a..14840649ea 100644 --- a/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h @@ -18,7 +18,7 @@ Boston, MA 02111-1307, USA. */ #ifndef _FCNTL_H -#error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead." +# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead." #endif @@ -27,8 +27,8 @@ /* In GNU, read and write are bits (unlike BSD). */ #ifdef __USE_GNU -#define O_READ O_RDONLY /* Open for reading. */ -#define O_WRITE O_WRONLY /* Open for writing. */ +# define O_READ O_RDONLY /* Open for reading. */ +# define O_WRITE O_WRONLY /* Open for writing. */ #endif /* open/fcntl - O_SYNC is only implemented on blocks devices and on files located on an ext2 file system */ @@ -48,25 +48,36 @@ #define O_FSYNC O_SYNC #define O_ASYNC 020000 /* fcntl, for BSD compatibility */ -#define F_DUPFD 0 /* dup */ -#define F_GETFD 1 /* get f_flags */ -#define F_SETFD 2 /* set f_flags */ -#define F_GETFL 3 /* more flags (cloexec) */ -#define F_SETFL 4 -#define F_GETLK 7 -#define F_SETLK 8 -#define F_SETLKW 9 - -#define F_SETOWN 5 /* for sockets. */ -#define F_GETOWN 6 /* for sockets. */ +/* XXX missing */ +#define O_LARGEFILE 0 + +/* Values for the second argument to `fcntl'. */ +#define F_DUPFD 0 /* Duplicate file descriptor. */ +#define F_GETFD 1 /* Get file descriptor flags. */ +#define F_SETFD 2 /* Set file descriptor flags. */ +#define F_GETFL 3 /* Get file status flags. */ +#define F_SETFL 4 /* Set file status flags. */ +#define F_GETLK 7 /* Get record locking info. */ +#define F_SETLK 8 /* Set record locking info (non-blocking). */ +#define F_SETLKW 9 /* Set record locking info (blocking). */ + +/* XXX missing */ +#define F_GETLK64 7 /* Get record locking info. */ +#define F_SETLK64 8 /* Set record locking info (non-blocking). */ +#define F_SETLKW64 9 /* Set record locking info (blocking). */ + +#ifdef __USE_BSD +# define F_SETOWN 5 /* Get owner of socket (receiver of SIGIO). */ +# define F_GETOWN 6 /* Set owner of socket (receiver of SIGIO). */ +#endif /* for F_[GET|SET]FL */ #define FD_CLOEXEC 1 /* actually anything with low bit set goes */ -/* for posix fcntl() and lockf() */ -#define F_RDLCK 1 -#define F_WRLCK 2 -#define F_UNLCK 8 +/* For posix fcntl() and `l_type' field of a `struct flock' for lockf() */ +#define F_RDLCK 1 /* Read lock. */ +#define F_WRLCK 2 /* Write lock. */ +#define F_UNLCK 8 /* Remove lock. */ /* for old implementation of bsd flock () */ #define F_EXLCK 16 /* or 3 */ @@ -79,22 +90,34 @@ blocking */ #define LOCK_UN 8 /* remove lock */ +/* We don't need to support __USE_FILE_OFFSET64. */ struct flock { - short int l_type; - short int l_whence; - __off_t l_start; - __off_t l_len; - __pid_t l_pid; + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ + __off_t l_start; /* Offset where the lock begins. */ + __off_t l_len; /* Size of the locked area; zero means until EOF. */ + __pid_t l_pid; /* Process holding the lock. */ + }; + +#ifdef __USE_LARGEFILE64 +struct flock64 + { + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ + __off64_t l_start; /* Offset where the lock begins. */ + __off64_t l_len; /* Size of the locked area; zero means until EOF. */ + __pid_t l_pid; /* Process holding the lock. */ }; +#endif /* Define some more compatibility macros to be backward compatible with BSD systems which did not managed to hide these kernel macros. */ #ifdef __USE_BSD -#define FAPPEND O_APPEND -#define FFSYNC O_FSYNC -#define FASYNC O_ASYNC -#define FNONBLOCK O_NONBLOCK -#define FNDELAY O_NDELAY +# define FAPPEND O_APPEND +# define FFSYNC O_FSYNC +# define FASYNC O_ASYNC +# define FNONBLOCK O_NONBLOCK +# define FNDELAY O_NDELAY #endif /* Use BSD. */ |