MOXA linux-2.6.x / linux-2.6.19-uc1 from UC-7110-LX-BOOTLOADER-1.9_VERSION-4.2.tgz
[linux-2.6.19-moxart.git] / include / asm-nios2nommu / fcntl.h
blob8b210445d67b8abebd83acf25f1d16b0b28fb798
1 /*
2 * This file came from the m68k port.
4 * Copyright (C) 2004 Microtronix Datacom Ltd.
6 * All rights reserved.
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
17 * details.
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
30 #define O_RDONLY 00
31 #define O_WRONLY 01
32 #define O_RDWR 02
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
40 #define O_SYNC 010000
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 */
53 #define F_GETLK 5
54 #define F_SETLK 6
55 #define F_SETLKW 7
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' */
63 #define F_SETLK64 13
64 #define F_SETLKW64 14
66 /* for F_[GET|SET]FL */
67 #define FD_CLOEXEC 1 /* actually anything with low bit set goes */
69 /* for posix fcntl() and lockf() */
70 #define F_RDLCK 0
71 #define F_WRLCK 1
72 #define F_UNLCK 2
74 /* for old implementation of bsd flock () */
75 #define F_EXLCK 4 /* or 3 */
76 #define F_SHLCK 8 /* or 4 */
78 /* for leases */
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
85 blocking */
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 */
93 struct flock {
94 short l_type;
95 short l_whence;
96 off_t l_start;
97 off_t l_len;
98 pid_t l_pid;
101 struct flock64 {
102 short l_type;
103 short l_whence;
104 loff_t l_start;
105 loff_t l_len;
106 pid_t l_pid;
109 #define F_LINUX_SPECIFIC_BASE 1024
110 #endif /* _NIOS2_FCNTL_H */