2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License version 2 as
4 * published by the Free Software Foundation, or (at your option) any
5 * later version. See the COPYING file in the top-level directory.
8 #ifndef GENERIC_FCNTL_H
9 #define GENERIC_FCNTL_H
11 /* <asm-generic/fcntl.h> values follow. */
12 #define TARGET_O_ACCMODE 0003
13 #define TARGET_O_RDONLY 00
14 #define TARGET_O_WRONLY 01
15 #define TARGET_O_RDWR 02
16 #ifndef TARGET_O_CREAT
17 #define TARGET_O_CREAT 0100 /* not fcntl */
20 #define TARGET_O_EXCL 0200 /* not fcntl */
22 #ifndef TARGET_O_NOCTTY
23 #define TARGET_O_NOCTTY 0400 /* not fcntl */
25 #ifndef TARGET_O_TRUNC
26 #define TARGET_O_TRUNC 01000 /* not fcntl */
28 #ifndef TARGET_O_APPEND
29 #define TARGET_O_APPEND 02000
31 #ifndef TARGET_O_NONBLOCK
32 #define TARGET_O_NONBLOCK 04000
34 #ifndef TARGET_O_DSYNC
35 #define TARGET_O_DSYNC 010000
38 #define TARGET_FASYNC 020000 /* fcntl, for BSD compatibility */
40 #ifndef TARGET_O_DIRECT
41 #define TARGET_O_DIRECT 040000 /* direct disk access hint */
43 #ifndef TARGET_O_LARGEFILE
44 #define TARGET_O_LARGEFILE 0100000
46 #ifndef TARGET_O_DIRECTORY
47 #define TARGET_O_DIRECTORY 0200000 /* must be a directory */
49 #ifndef TARGET_O_NOFOLLOW
50 #define TARGET_O_NOFOLLOW 0400000 /* don't follow links */
52 #ifndef TARGET_O_NOATIME
53 #define TARGET_O_NOATIME 01000000
55 #ifndef TARGET_O_CLOEXEC
56 #define TARGET_O_CLOEXEC 02000000
58 #ifndef TARGET___O_SYNC
59 #define TARGET___O_SYNC 04000000
62 #define TARGET_O_PATH 010000000
64 #ifndef TARGET___O_TMPFILE
65 #define TARGET___O_TMPFILE 020000000
67 #ifndef TARGET_O_TMPFILE
68 #define TARGET_O_TMPFILE (TARGET___O_TMPFILE | TARGET_O_DIRECTORY)
70 #ifndef TARGET_O_NDELAY
71 #define TARGET_O_NDELAY TARGET_O_NONBLOCK
74 #define TARGET_O_SYNC (TARGET___O_SYNC | TARGET_O_DSYNC)
77 #define TARGET_F_DUPFD 0 /* dup */
78 #define TARGET_F_GETFD 1 /* get close_on_exec */
79 #define TARGET_F_SETFD 2 /* set/clear close_on_exec */
80 #define TARGET_F_GETFL 3 /* get file->f_flags */
81 #define TARGET_F_SETFL 4 /* set file->f_flags */
82 #ifndef TARGET_F_GETLK
83 #define TARGET_F_GETLK 5
84 #define TARGET_F_SETLK 6
85 #define TARGET_F_SETLKW 7
87 #ifndef TARGET_F_SETOWN
88 #define TARGET_F_SETOWN 8 /* for sockets. */
89 #define TARGET_F_GETOWN 9 /* for sockets. */
91 #ifndef TARGET_F_SETSIG
92 #define TARGET_F_SETSIG 10 /* for sockets. */
93 #define TARGET_F_GETSIG 11 /* for sockets. */
96 #ifndef TARGET_F_GETLK64
97 #define TARGET_F_GETLK64 12 /* using 'struct flock64' */
98 #define TARGET_F_SETLK64 13
99 #define TARGET_F_SETLKW64 14
102 #ifndef TARGET_F_SETOWN_EX
103 #define TARGET_F_SETOWN_EX 15
104 #define TARGET_F_GETOWN_EX 16
107 struct target_f_owner_ex
{
108 int type
; /* Owner type of ID. */
109 int pid
; /* ID of owner. */
112 #ifndef TARGET_F_RDLCK
113 #define TARGET_F_RDLCK 0
114 #define TARGET_F_WRLCK 1
115 #define TARGET_F_UNLCK 2
118 #ifndef TARGET_F_EXLCK
119 #define TARGET_F_EXLCK 4
120 #define TARGET_F_SHLCK 8
123 #ifndef TARGET_ARCH_FLOCK_PAD
124 #define TARGET_ARCH_FLOCK_PAD
127 struct target_flock
{
132 #if defined(TARGET_MIPS)
136 TARGET_ARCH_FLOCK_PAD
139 #ifndef TARGET_ARCH_FLOCK64_PAD
140 #define TARGET_ARCH_FLOCK64_PAD
143 struct target_flock64
{
149 TARGET_ARCH_FLOCK64_PAD