1/****************************************************************************
2 ****************************************************************************
3 ***
4 ***   This header was automatically generated from a Linux kernel header
5 ***   of the same name, to make information necessary for userspace to
6 ***   call into the kernel available to libc.  It contains only constants,
7 ***   structures, and macros generated from the original header, and thus,
8 ***   contains no copyrightable information.
9 ***
10 ***   To edit the content of this header, modify the corresponding
11 ***   source file (e.g. under external/kernel-headers/original/) then
12 ***   run bionic/libc/kernel/tools/update_all.py
13 ***
14 ***   Any manual change here will be lost the next time this script will
15 ***   be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _ASM_GENERIC_FCNTL_H
20#define _ASM_GENERIC_FCNTL_H
21#include <linux/types.h>
22#define O_ACCMODE 00000003
23#define O_RDONLY 00000000
24#define O_WRONLY 00000001
25#define O_RDWR 00000002
26#ifndef O_CREAT
27#define O_CREAT 00000100
28#endif
29#ifndef O_EXCL
30#define O_EXCL 00000200
31#endif
32#ifndef O_NOCTTY
33#define O_NOCTTY 00000400
34#endif
35#ifndef O_TRUNC
36#define O_TRUNC 00001000
37#endif
38#ifndef O_APPEND
39#define O_APPEND 00002000
40#endif
41#ifndef O_NONBLOCK
42#define O_NONBLOCK 00004000
43#endif
44#ifndef O_DSYNC
45#define O_DSYNC 00010000
46#endif
47#ifndef FASYNC
48#define FASYNC 00020000
49#endif
50#ifndef O_DIRECT
51#define O_DIRECT 00040000
52#endif
53#ifndef O_LARGEFILE
54#define O_LARGEFILE 00100000
55#endif
56#ifndef O_DIRECTORY
57#define O_DIRECTORY 00200000
58#endif
59#ifndef O_NOFOLLOW
60#define O_NOFOLLOW 00400000
61#endif
62#ifndef O_NOATIME
63#define O_NOATIME 01000000
64#endif
65#ifndef O_CLOEXEC
66#define O_CLOEXEC 02000000
67#endif
68#ifndef O_SYNC
69#define __O_SYNC 04000000
70#define O_SYNC (__O_SYNC | O_DSYNC)
71#endif
72#ifndef O_PATH
73#define O_PATH 010000000
74#endif
75#ifndef __O_TMPFILE
76#define __O_TMPFILE 020000000
77#endif
78#define O_TMPFILE (__O_TMPFILE | O_DIRECTORY)
79#define O_TMPFILE_MASK (__O_TMPFILE | O_DIRECTORY | O_CREAT)
80#ifndef O_NDELAY
81#define O_NDELAY O_NONBLOCK
82#endif
83#define F_DUPFD 0
84#define F_GETFD 1
85#define F_SETFD 2
86#define F_GETFL 3
87#define F_SETFL 4
88#ifndef F_GETLK
89#define F_GETLK 5
90#define F_SETLK 6
91#define F_SETLKW 7
92#endif
93#ifndef F_SETOWN
94#define F_SETOWN 8
95#define F_GETOWN 9
96#endif
97#ifndef F_SETSIG
98#define F_SETSIG 10
99#define F_GETSIG 11
100#endif
101#ifndef __LP64__
102#ifndef F_GETLK64
103#define F_GETLK64 12
104#define F_SETLK64 13
105#define F_SETLKW64 14
106#endif
107#endif
108#ifndef F_SETOWN_EX
109#define F_SETOWN_EX 15
110#define F_GETOWN_EX 16
111#endif
112#ifndef F_GETOWNER_UIDS
113#define F_GETOWNER_UIDS 17
114#endif
115#define F_OFD_GETLK 36
116#define F_OFD_SETLK 37
117#define F_OFD_SETLKW 38
118#define F_OWNER_TID 0
119#define F_OWNER_PID 1
120#define F_OWNER_PGRP 2
121struct f_owner_ex {
122  int type;
123  __kernel_pid_t pid;
124};
125#define FD_CLOEXEC 1
126#ifndef F_RDLCK
127#define F_RDLCK 0
128#define F_WRLCK 1
129#define F_UNLCK 2
130#endif
131#ifndef F_EXLCK
132#define F_EXLCK 4
133#define F_SHLCK 8
134#endif
135#define LOCK_SH 1
136#define LOCK_EX 2
137#define LOCK_NB 4
138#define LOCK_UN 8
139#define LOCK_MAND 32
140#define LOCK_READ 64
141#define LOCK_WRITE 128
142#define LOCK_RW 192
143#define F_LINUX_SPECIFIC_BASE 1024
144#ifndef HAVE_ARCH_STRUCT_FLOCK
145#ifndef __ARCH_FLOCK_PAD
146#define __ARCH_FLOCK_PAD
147#endif
148struct flock {
149  short l_type;
150  short l_whence;
151  __kernel_off_t l_start;
152  __kernel_off_t l_len;
153  __kernel_pid_t l_pid;
154  __ARCH_FLOCK_PAD
155};
156#endif
157#ifndef HAVE_ARCH_STRUCT_FLOCK64
158#ifndef __ARCH_FLOCK64_PAD
159#define __ARCH_FLOCK64_PAD
160#endif
161struct flock64 {
162  short l_type;
163  short l_whence;
164  __kernel_loff_t l_start;
165  __kernel_loff_t l_len;
166  __kernel_pid_t l_pid;
167  __ARCH_FLOCK64_PAD
168};
169#endif
170#endif
171