Merge remote-tracking branch 'remotes/kraxel/tags/ui-20190121-pull-request' into...
[qemu/ar7.git] / linux-user / generic / fcntl.h
bloba775a491e9e097000d5316d2fbe90b86695b2e7d
1 /*
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.
6 */
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 */
18 #endif
19 #ifndef TARGET_O_EXCL
20 #define TARGET_O_EXCL 0200 /* not fcntl */
21 #endif
22 #ifndef TARGET_O_NOCTTY
23 #define TARGET_O_NOCTTY 0400 /* not fcntl */
24 #endif
25 #ifndef TARGET_O_TRUNC
26 #define TARGET_O_TRUNC 01000 /* not fcntl */
27 #endif
28 #ifndef TARGET_O_APPEND
29 #define TARGET_O_APPEND 02000
30 #endif
31 #ifndef TARGET_O_NONBLOCK
32 #define TARGET_O_NONBLOCK 04000
33 #endif
34 #ifndef TARGET_O_DSYNC
35 #define TARGET_O_DSYNC 010000
36 #endif
37 #ifndef TARGET_FASYNC
38 #define TARGET_FASYNC 020000 /* fcntl, for BSD compatibility */
39 #endif
40 #ifndef TARGET_O_DIRECT
41 #define TARGET_O_DIRECT 040000 /* direct disk access hint */
42 #endif
43 #ifndef TARGET_O_LARGEFILE
44 #define TARGET_O_LARGEFILE 0100000
45 #endif
46 #ifndef TARGET_O_DIRECTORY
47 #define TARGET_O_DIRECTORY 0200000 /* must be a directory */
48 #endif
49 #ifndef TARGET_O_NOFOLLOW
50 #define TARGET_O_NOFOLLOW 0400000 /* don't follow links */
51 #endif
52 #ifndef TARGET_O_NOATIME
53 #define TARGET_O_NOATIME 01000000
54 #endif
55 #ifndef TARGET_O_CLOEXEC
56 #define TARGET_O_CLOEXEC 02000000
57 #endif
58 #ifndef TARGET___O_SYNC
59 #define TARGET___O_SYNC 04000000
60 #endif
61 #ifndef TARGET_O_PATH
62 #define TARGET_O_PATH 010000000
63 #endif
64 #ifndef TARGET___O_TMPFILE
65 #define TARGET___O_TMPFILE 020000000
66 #endif
67 #ifndef TARGET_O_TMPFILE
68 #define TARGET_O_TMPFILE (TARGET___O_TMPFILE | TARGET_O_DIRECTORY)
69 #endif
70 #ifndef TARGET_O_NDELAY
71 #define TARGET_O_NDELAY TARGET_O_NONBLOCK
72 #endif
73 #ifndef TARGET_O_SYNC
74 #define TARGET_O_SYNC (TARGET___O_SYNC | TARGET_O_DSYNC)
75 #endif
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
86 #endif
87 #ifndef TARGET_F_SETOWN
88 #define TARGET_F_SETOWN 8 /* for sockets. */
89 #define TARGET_F_GETOWN 9 /* for sockets. */
90 #endif
91 #ifndef TARGET_F_SETSIG
92 #define TARGET_F_SETSIG 10 /* for sockets. */
93 #define TARGET_F_GETSIG 11 /* for sockets. */
94 #endif
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
100 #endif
102 #ifndef TARGET_F_SETOWN_EX
103 #define TARGET_F_SETOWN_EX 15
104 #define TARGET_F_GETOWN_EX 16
105 #endif
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
116 #endif
118 #ifndef TARGET_F_EXLCK
119 #define TARGET_F_EXLCK 4
120 #define TARGET_F_SHLCK 8
121 #endif
123 #ifndef TARGET_ARCH_FLOCK_PAD
124 #define TARGET_ARCH_FLOCK_PAD
125 #endif
127 struct target_flock {
128 short l_type;
129 short l_whence;
130 abi_long l_start;
131 abi_long l_len;
132 #if defined(TARGET_MIPS)
133 abi_long l_sysid;
134 #endif
135 int l_pid;
136 TARGET_ARCH_FLOCK_PAD
139 #ifndef TARGET_ARCH_FLOCK64_PAD
140 #define TARGET_ARCH_FLOCK64_PAD
141 #endif
143 struct target_flock64 {
144 abi_short l_type;
145 abi_short l_whence;
146 abi_llong l_start;
147 abi_llong l_len;
148 abi_int l_pid;
149 TARGET_ARCH_FLOCK64_PAD
151 #endif