update from main archive 960107
[glibc.git] / sysdeps / unix / sysv / linux / alpha / fcntlbits.h
blobe8697d989834426c18d5e4c59a2483013c29c153
1 /* O_*, F_*, FD_* bit values for Linux.
2 Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public
16 License along with the GNU C Library; see the file COPYING.LIB. If not,
17 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. */
20 #ifndef _FCNTLBITS_H
21 #define _FCNTLBITS_H 1
23 #include <sys/types.h>
26 /* open/fcntl - O_SYNC is only implemented on blocks devices and on files
27 located on an ext2 file system */
28 #define O_ACCMODE 0003
29 #define O_RDONLY 00
30 #define O_WRONLY 01
31 #define O_RDWR 02
32 #define O_CREAT 01000 /* not fcntl */
33 #define O_TRUNC 02000 /* not fcntl */
34 #define O_EXCL 04000 /* not fcntl */
35 #define O_NOCTTY 010000 /* not fcntl */
37 #define O_NONBLOCK 00004
38 #define O_APPEND 00010
39 #define O_NDELAY O_NONBLOCK
40 #define O_SYNC 040000
41 #define FASYNC 020000 /* fcntl, for BSD compatibility */
43 #define F_DUPFD 0 /* dup */
44 #define F_GETFD 1 /* get f_flags */
45 #define F_SETFD 2 /* set f_flags */
46 #define F_GETFL 3 /* more flags (cloexec) */
47 #define F_SETFL 4
48 #define F_GETLK 7
49 #define F_SETLK 8
50 #define F_SETLKW 9
52 #define F_SETOWN 5 /* for sockets. */
53 #define F_GETOWN 6 /* for sockets. */
55 /* for F_[GET|SET]FL */
56 #define FD_CLOEXEC 1 /* actually anything with low bit set goes */
58 /* for posix fcntl() and lockf() */
59 #define F_RDLCK 1
60 #define F_WRLCK 2
61 #define F_UNLCK 8
63 /* for old implementation of bsd flock () */
64 #define F_EXLCK 16 /* or 3 */
65 #define F_SHLCK 32 /* or 4 */
67 /* operations for bsd flock(), also used by the kernel implementation */
68 #define LOCK_SH 1 /* shared lock */
69 #define LOCK_EX 2 /* exclusive lock */
70 #define LOCK_NB 4 /* or'd with one of the above to prevent
71 blocking */
72 #define LOCK_UN 8 /* remove lock */
74 struct flock
76 short int l_type;
77 short int l_whence;
78 __off_t l_start;
79 __off_t l_len;
80 __pid_t l_pid;
84 /* Define some more compatibility macros to be backward compatible with
85 BSD systems which did not managed to hide these kernel macros. */
86 #ifdef __USE_BSD
87 #define FAPPEND O_APPEND
88 #define FFSYNC O_FSYNC
89 #define FNONBLOCK O_NONBLOCK
90 #define FNDELAY O_NDELAY
91 #endif /* Use BSD. */
93 #endif /* fcntlbits.h */