blob: aeb1ac6dae8ddfaee05d824652118c1801829ba0 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
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
Ben Cheng655a7c02013-10-16 16:09:24 -070023#define O_RDONLY 00000000
24#define O_WRONLY 00000001
25#define O_RDWR 00000002
26#ifndef O_CREAT
Ben Cheng655a7c02013-10-16 16:09:24 -070027#define O_CREAT 00000100
28#endif
29#ifndef O_EXCL
30#define O_EXCL 00000200
Ben Cheng655a7c02013-10-16 16:09:24 -070031#endif
32#ifndef O_NOCTTY
33#define O_NOCTTY 00000400
34#endif
Ben Cheng655a7c02013-10-16 16:09:24 -070035#ifndef O_TRUNC
36#define O_TRUNC 00001000
37#endif
38#ifndef O_APPEND
Ben Cheng655a7c02013-10-16 16:09:24 -070039#define O_APPEND 00002000
40#endif
41#ifndef O_NONBLOCK
42#define O_NONBLOCK 00004000
Ben Cheng655a7c02013-10-16 16:09:24 -070043#endif
44#ifndef O_DSYNC
45#define O_DSYNC 00010000
46#endif
Ben Cheng655a7c02013-10-16 16:09:24 -070047#ifndef FASYNC
48#define FASYNC 00020000
49#endif
50#ifndef O_DIRECT
Ben Cheng655a7c02013-10-16 16:09:24 -070051#define O_DIRECT 00040000
52#endif
53#ifndef O_LARGEFILE
54#define O_LARGEFILE 00100000
Ben Cheng655a7c02013-10-16 16:09:24 -070055#endif
56#ifndef O_DIRECTORY
57#define O_DIRECTORY 00200000
58#endif
Ben Cheng655a7c02013-10-16 16:09:24 -070059#ifndef O_NOFOLLOW
60#define O_NOFOLLOW 00400000
61#endif
62#ifndef O_NOATIME
Ben Cheng655a7c02013-10-16 16:09:24 -070063#define O_NOATIME 01000000
64#endif
65#ifndef O_CLOEXEC
66#define O_CLOEXEC 02000000
Ben Cheng655a7c02013-10-16 16:09:24 -070067#endif
68#ifndef O_SYNC
69#define __O_SYNC 04000000
Tao Baod7db5942015-01-28 10:07:51 -080070#define O_SYNC (__O_SYNC | O_DSYNC)
Ben Cheng655a7c02013-10-16 16:09:24 -070071#endif
72#ifndef O_PATH
73#define O_PATH 010000000
74#endif
Christopher Ferris38062f92014-07-09 15:33:25 -070075#ifndef __O_TMPFILE
76#define __O_TMPFILE 020000000
77#endif
78#define O_TMPFILE (__O_TMPFILE | O_DIRECTORY)
Christopher Ferris38062f92014-07-09 15:33:25 -070079#define O_TMPFILE_MASK (__O_TMPFILE | O_DIRECTORY | O_CREAT)
Ben Cheng655a7c02013-10-16 16:09:24 -070080#ifndef O_NDELAY
81#define O_NDELAY O_NONBLOCK
82#endif
Christopher Ferris38062f92014-07-09 15:33:25 -070083#define F_DUPFD 0
Ben Cheng655a7c02013-10-16 16:09:24 -070084#define F_GETFD 1
85#define F_SETFD 2
86#define F_GETFL 3
Christopher Ferris38062f92014-07-09 15:33:25 -070087#define F_SETFL 4
Ben Cheng655a7c02013-10-16 16:09:24 -070088#ifndef F_GETLK
89#define F_GETLK 5
90#define F_SETLK 6
Christopher Ferris38062f92014-07-09 15:33:25 -070091#define F_SETLKW 7
Ben Cheng655a7c02013-10-16 16:09:24 -070092#endif
93#ifndef F_SETOWN
94#define F_SETOWN 8
Christopher Ferris38062f92014-07-09 15:33:25 -070095#define F_GETOWN 9
Ben Cheng655a7c02013-10-16 16:09:24 -070096#endif
97#ifndef F_SETSIG
98#define F_SETSIG 10
Christopher Ferris38062f92014-07-09 15:33:25 -070099#define F_GETSIG 11
Ben Cheng655a7c02013-10-16 16:09:24 -0700100#endif
Elliott Hughes9195a252014-04-08 10:15:06 -0700101#ifndef __LP64__
Ben Cheng655a7c02013-10-16 16:09:24 -0700102#ifndef F_GETLK64
Christopher Ferris38062f92014-07-09 15:33:25 -0700103#define F_GETLK64 12
Elliott Hughes9195a252014-04-08 10:15:06 -0700104#define F_SETLK64 13
Ben Cheng655a7c02013-10-16 16:09:24 -0700105#define F_SETLKW64 14
106#endif
Christopher Ferris38062f92014-07-09 15:33:25 -0700107#endif
Ben Cheng655a7c02013-10-16 16:09:24 -0700108#ifndef F_SETOWN_EX
Ben Cheng655a7c02013-10-16 16:09:24 -0700109#define F_SETOWN_EX 15
110#define F_GETOWN_EX 16
Christopher Ferris38062f92014-07-09 15:33:25 -0700111#endif
Ben Cheng655a7c02013-10-16 16:09:24 -0700112#ifndef F_GETOWNER_UIDS
Ben Cheng655a7c02013-10-16 16:09:24 -0700113#define F_GETOWNER_UIDS 17
114#endif
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700115#define F_OFD_GETLK 36
116#define F_OFD_SETLK 37
117#define F_OFD_SETLKW 38
Christopher Ferris38062f92014-07-09 15:33:25 -0700118#define F_OWNER_TID 0
Ben Cheng655a7c02013-10-16 16:09:24 -0700119#define F_OWNER_PID 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700120#define F_OWNER_PGRP 2
121struct f_owner_ex {
Tao Baod7db5942015-01-28 10:07:51 -0800122 int type;
Tao Baod7db5942015-01-28 10:07:51 -0800123 __kernel_pid_t pid;
Ben Cheng655a7c02013-10-16 16:09:24 -0700124};
125#define FD_CLOEXEC 1
Christopher Ferris38062f92014-07-09 15:33:25 -0700126#ifndef F_RDLCK
Ben Cheng655a7c02013-10-16 16:09:24 -0700127#define F_RDLCK 0
Ben Cheng655a7c02013-10-16 16:09:24 -0700128#define F_WRLCK 1
129#define F_UNLCK 2
Christopher Ferris38062f92014-07-09 15:33:25 -0700130#endif
Ben Cheng655a7c02013-10-16 16:09:24 -0700131#ifndef F_EXLCK
Ben Cheng655a7c02013-10-16 16:09:24 -0700132#define F_EXLCK 4
133#define F_SHLCK 8
Christopher Ferris38062f92014-07-09 15:33:25 -0700134#endif
Ben Cheng655a7c02013-10-16 16:09:24 -0700135#define LOCK_SH 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700136#define LOCK_EX 2
137#define LOCK_NB 4
Christopher Ferris38062f92014-07-09 15:33:25 -0700138#define LOCK_UN 8
Ben Cheng655a7c02013-10-16 16:09:24 -0700139#define LOCK_MAND 32
Ben Cheng655a7c02013-10-16 16:09:24 -0700140#define LOCK_READ 64
141#define LOCK_WRITE 128
Christopher Ferris38062f92014-07-09 15:33:25 -0700142#define LOCK_RW 192
Ben Cheng655a7c02013-10-16 16:09:24 -0700143#define F_LINUX_SPECIFIC_BASE 1024
Ben Cheng655a7c02013-10-16 16:09:24 -0700144#ifndef HAVE_ARCH_STRUCT_FLOCK
145#ifndef __ARCH_FLOCK_PAD
Christopher Ferris38062f92014-07-09 15:33:25 -0700146#define __ARCH_FLOCK_PAD
Ben Cheng655a7c02013-10-16 16:09:24 -0700147#endif
Ben Cheng655a7c02013-10-16 16:09:24 -0700148struct flock {
Tao Baod7db5942015-01-28 10:07:51 -0800149 short l_type;
150 short l_whence;
Tao Baod7db5942015-01-28 10:07:51 -0800151 __kernel_off_t l_start;
152 __kernel_off_t l_len;
153 __kernel_pid_t l_pid;
154 __ARCH_FLOCK_PAD
Ben Cheng655a7c02013-10-16 16:09:24 -0700155};
Ben Cheng655a7c02013-10-16 16:09:24 -0700156#endif
Christopher Ferris38062f92014-07-09 15:33:25 -0700157#ifndef HAVE_ARCH_STRUCT_FLOCK64
Ben Cheng655a7c02013-10-16 16:09:24 -0700158#ifndef __ARCH_FLOCK64_PAD
159#define __ARCH_FLOCK64_PAD
Ben Cheng655a7c02013-10-16 16:09:24 -0700160#endif
Christopher Ferris38062f92014-07-09 15:33:25 -0700161struct flock64 {
Tao Baod7db5942015-01-28 10:07:51 -0800162 short l_type;
Tao Baod7db5942015-01-28 10:07:51 -0800163 short l_whence;
164 __kernel_loff_t l_start;
165 __kernel_loff_t l_len;
166 __kernel_pid_t l_pid;
Tao Baod7db5942015-01-28 10:07:51 -0800167 __ARCH_FLOCK64_PAD
Ben Cheng655a7c02013-10-16 16:09:24 -0700168};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700169#endif
170#endif