2 * This file came from the m68k port.
4 * Copyright (C) 2004 Microtronix Datacom Ltd.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
16 * NON INFRINGEMENT. See the GNU General Public License for more
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #ifndef _NIOS2_FCNTL_H
25 #define _NIOS2_FCNTL_H
27 /* open/fcntl - O_SYNC is only implemented on blocks devices and on files
28 located on an ext2 file system */
29 #define O_ACCMODE 0003
33 #define O_CREAT 0100 /* not fcntl */
34 #define O_EXCL 0200 /* not fcntl */
35 #define O_NOCTTY 0400 /* not fcntl */
36 #define O_TRUNC 01000 /* not fcntl */
37 #define O_APPEND 02000
38 #define O_NONBLOCK 04000
39 #define O_NDELAY O_NONBLOCK
41 #define FASYNC 020000 /* fcntl, for BSD compatibility */
42 #define O_DIRECTORY 040000 /* must be a directory */
43 #define O_NOFOLLOW 0100000 /* don't follow links */
44 #define O_DIRECT 0200000 /* direct disk access hint - currently ignored */
45 #define O_LARGEFILE 0400000
46 #define O_NOATIME 01000000
48 #define F_DUPFD 0 /* dup */
49 #define F_GETFD 1 /* get close_on_exec */
50 #define F_SETFD 2 /* set/clear close_on_exec */
51 #define F_GETFL 3 /* get file->f_flags */
52 #define F_SETFL 4 /* set file->f_flags */
57 #define F_SETOWN 8 /* for sockets. */
58 #define F_GETOWN 9 /* for sockets. */
59 #define F_SETSIG 10 /* for sockets. */
60 #define F_GETSIG 11 /* for sockets. */
62 #define F_GETLK64 12 /* using 'struct flock64' */
66 /* for F_[GET|SET]FL */
67 #define FD_CLOEXEC 1 /* actually anything with low bit set goes */
69 /* for posix fcntl() and lockf() */
74 /* for old implementation of bsd flock () */
75 #define F_EXLCK 4 /* or 3 */
76 #define F_SHLCK 8 /* or 4 */
79 #define F_INPROGRESS 16
81 /* operations for bsd flock(), also used by the kernel implementation */
82 #define LOCK_SH 1 /* shared lock */
83 #define LOCK_EX 2 /* exclusive lock */
84 #define LOCK_NB 4 /* or'd with one of the above to prevent
86 #define LOCK_UN 8 /* remove lock */
88 #define LOCK_MAND 32 /* This is a mandatory flock */
89 #define LOCK_READ 64 /* ... Which allows concurrent read operations */
90 #define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
91 #define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
109 #define F_LINUX_SPECIFIC_BASE 1024
110 #endif /* _NIOS2_FCNTL_H */