blob: ea8c108191d9e5a74ff10ae5a12bc40d9806710a [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
Elliott Hughes09e77f32020-01-29 19:20:45 -080021#include <bits/flock64.h>
22#include <bits/flock.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070023#include <linux/types.h>
24#define O_ACCMODE 00000003
Ben Cheng655a7c02013-10-16 16:09:24 -070025#define O_RDONLY 00000000
26#define O_WRONLY 00000001
27#define O_RDWR 00000002
28#ifndef O_CREAT
Ben Cheng655a7c02013-10-16 16:09:24 -070029#define O_CREAT 00000100
30#endif
31#ifndef O_EXCL
32#define O_EXCL 00000200
Ben Cheng655a7c02013-10-16 16:09:24 -070033#endif
34#ifndef O_NOCTTY
35#define O_NOCTTY 00000400
36#endif
Ben Cheng655a7c02013-10-16 16:09:24 -070037#ifndef O_TRUNC
38#define O_TRUNC 00001000
39#endif
40#ifndef O_APPEND
Ben Cheng655a7c02013-10-16 16:09:24 -070041#define O_APPEND 00002000
42#endif
43#ifndef O_NONBLOCK
44#define O_NONBLOCK 00004000
Ben Cheng655a7c02013-10-16 16:09:24 -070045#endif
46#ifndef O_DSYNC
47#define O_DSYNC 00010000
48#endif
Ben Cheng655a7c02013-10-16 16:09:24 -070049#ifndef FASYNC
50#define FASYNC 00020000
51#endif
52#ifndef O_DIRECT
Ben Cheng655a7c02013-10-16 16:09:24 -070053#define O_DIRECT 00040000
54#endif
55#ifndef O_LARGEFILE
56#define O_LARGEFILE 00100000
Ben Cheng655a7c02013-10-16 16:09:24 -070057#endif
58#ifndef O_DIRECTORY
59#define O_DIRECTORY 00200000
60#endif
Ben Cheng655a7c02013-10-16 16:09:24 -070061#ifndef O_NOFOLLOW
62#define O_NOFOLLOW 00400000
63#endif
64#ifndef O_NOATIME
Ben Cheng655a7c02013-10-16 16:09:24 -070065#define O_NOATIME 01000000
66#endif
67#ifndef O_CLOEXEC
68#define O_CLOEXEC 02000000
Ben Cheng655a7c02013-10-16 16:09:24 -070069#endif
70#ifndef O_SYNC
71#define __O_SYNC 04000000
Tao Baod7db5942015-01-28 10:07:51 -080072#define O_SYNC (__O_SYNC | O_DSYNC)
Ben Cheng655a7c02013-10-16 16:09:24 -070073#endif
74#ifndef O_PATH
75#define O_PATH 010000000
76#endif
Christopher Ferris38062f92014-07-09 15:33:25 -070077#ifndef __O_TMPFILE
78#define __O_TMPFILE 020000000
79#endif
80#define O_TMPFILE (__O_TMPFILE | O_DIRECTORY)
Christopher Ferris38062f92014-07-09 15:33:25 -070081#define O_TMPFILE_MASK (__O_TMPFILE | O_DIRECTORY | O_CREAT)
Ben Cheng655a7c02013-10-16 16:09:24 -070082#ifndef O_NDELAY
83#define O_NDELAY O_NONBLOCK
84#endif
Christopher Ferris38062f92014-07-09 15:33:25 -070085#define F_DUPFD 0
Ben Cheng655a7c02013-10-16 16:09:24 -070086#define F_GETFD 1
87#define F_SETFD 2
88#define F_GETFL 3
Christopher Ferris38062f92014-07-09 15:33:25 -070089#define F_SETFL 4
Ben Cheng655a7c02013-10-16 16:09:24 -070090#ifndef F_GETLK
91#define F_GETLK 5
92#define F_SETLK 6
Christopher Ferris38062f92014-07-09 15:33:25 -070093#define F_SETLKW 7
Ben Cheng655a7c02013-10-16 16:09:24 -070094#endif
95#ifndef F_SETOWN
96#define F_SETOWN 8
Christopher Ferris38062f92014-07-09 15:33:25 -070097#define F_GETOWN 9
Ben Cheng655a7c02013-10-16 16:09:24 -070098#endif
99#ifndef F_SETSIG
100#define F_SETSIG 10
Christopher Ferris38062f92014-07-09 15:33:25 -0700101#define F_GETSIG 11
Ben Cheng655a7c02013-10-16 16:09:24 -0700102#endif
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700103#if __BITS_PER_LONG == 32
Ben Cheng655a7c02013-10-16 16:09:24 -0700104#ifndef F_GETLK64
Christopher Ferris38062f92014-07-09 15:33:25 -0700105#define F_GETLK64 12
Elliott Hughes9195a252014-04-08 10:15:06 -0700106#define F_SETLK64 13
Ben Cheng655a7c02013-10-16 16:09:24 -0700107#define F_SETLKW64 14
108#endif
Christopher Ferris38062f92014-07-09 15:33:25 -0700109#endif
Ben Cheng655a7c02013-10-16 16:09:24 -0700110#ifndef F_SETOWN_EX
Ben Cheng655a7c02013-10-16 16:09:24 -0700111#define F_SETOWN_EX 15
112#define F_GETOWN_EX 16
Christopher Ferris38062f92014-07-09 15:33:25 -0700113#endif
Ben Cheng655a7c02013-10-16 16:09:24 -0700114#ifndef F_GETOWNER_UIDS
Ben Cheng655a7c02013-10-16 16:09:24 -0700115#define F_GETOWNER_UIDS 17
116#endif
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700117#define F_OFD_GETLK 36
118#define F_OFD_SETLK 37
119#define F_OFD_SETLKW 38
Christopher Ferris38062f92014-07-09 15:33:25 -0700120#define F_OWNER_TID 0
Ben Cheng655a7c02013-10-16 16:09:24 -0700121#define F_OWNER_PID 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700122#define F_OWNER_PGRP 2
123struct f_owner_ex {
Tao Baod7db5942015-01-28 10:07:51 -0800124 int type;
Tao Baod7db5942015-01-28 10:07:51 -0800125 __kernel_pid_t pid;
Ben Cheng655a7c02013-10-16 16:09:24 -0700126};
127#define FD_CLOEXEC 1
Christopher Ferris38062f92014-07-09 15:33:25 -0700128#ifndef F_RDLCK
Ben Cheng655a7c02013-10-16 16:09:24 -0700129#define F_RDLCK 0
Ben Cheng655a7c02013-10-16 16:09:24 -0700130#define F_WRLCK 1
131#define F_UNLCK 2
Christopher Ferris38062f92014-07-09 15:33:25 -0700132#endif
Ben Cheng655a7c02013-10-16 16:09:24 -0700133#ifndef F_EXLCK
Ben Cheng655a7c02013-10-16 16:09:24 -0700134#define F_EXLCK 4
135#define F_SHLCK 8
Christopher Ferris38062f92014-07-09 15:33:25 -0700136#endif
Ben Cheng655a7c02013-10-16 16:09:24 -0700137#define LOCK_SH 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700138#define LOCK_EX 2
139#define LOCK_NB 4
Christopher Ferris38062f92014-07-09 15:33:25 -0700140#define LOCK_UN 8
Ben Cheng655a7c02013-10-16 16:09:24 -0700141#define LOCK_MAND 32
Ben Cheng655a7c02013-10-16 16:09:24 -0700142#define LOCK_READ 64
143#define LOCK_WRITE 128
Christopher Ferris38062f92014-07-09 15:33:25 -0700144#define LOCK_RW 192
Ben Cheng655a7c02013-10-16 16:09:24 -0700145#define F_LINUX_SPECIFIC_BASE 1024
Ben Cheng655a7c02013-10-16 16:09:24 -0700146#ifndef HAVE_ARCH_STRUCT_FLOCK
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700147#endif
148#endif