Elliott Hughes | 180edef | 2023-11-02 00:08:05 +0000 | [diff] [blame] | 1 | /* |
2 | * This file is auto-generated. Modifications will be lost. | ||||
3 | * | ||||
4 | * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/ | ||||
5 | * for more information. | ||||
6 | */ | ||||
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 7 | #ifndef _ASM_GENERIC_FCNTL_H |
8 | #define _ASM_GENERIC_FCNTL_H | ||||
Elliott Hughes | 09e77f3 | 2020-01-29 19:20:45 -0800 | [diff] [blame] | 9 | #include <bits/flock64.h> |
10 | #include <bits/flock.h> | ||||
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 11 | #include <linux/types.h> |
12 | #define O_ACCMODE 00000003 | ||||
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 13 | #define O_RDONLY 00000000 |
14 | #define O_WRONLY 00000001 | ||||
15 | #define O_RDWR 00000002 | ||||
16 | #ifndef O_CREAT | ||||
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 17 | #define O_CREAT 00000100 |
18 | #endif | ||||
19 | #ifndef O_EXCL | ||||
20 | #define O_EXCL 00000200 | ||||
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 21 | #endif |
22 | #ifndef O_NOCTTY | ||||
23 | #define O_NOCTTY 00000400 | ||||
24 | #endif | ||||
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 25 | #ifndef O_TRUNC |
26 | #define O_TRUNC 00001000 | ||||
27 | #endif | ||||
28 | #ifndef O_APPEND | ||||
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 29 | #define O_APPEND 00002000 |
30 | #endif | ||||
31 | #ifndef O_NONBLOCK | ||||
32 | #define O_NONBLOCK 00004000 | ||||
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 33 | #endif |
34 | #ifndef O_DSYNC | ||||
35 | #define O_DSYNC 00010000 | ||||
36 | #endif | ||||
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 37 | #ifndef FASYNC |
38 | #define FASYNC 00020000 | ||||
39 | #endif | ||||
40 | #ifndef O_DIRECT | ||||
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 41 | #define O_DIRECT 00040000 |
42 | #endif | ||||
43 | #ifndef O_LARGEFILE | ||||
44 | #define O_LARGEFILE 00100000 | ||||
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 45 | #endif |
46 | #ifndef O_DIRECTORY | ||||
47 | #define O_DIRECTORY 00200000 | ||||
48 | #endif | ||||
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 49 | #ifndef O_NOFOLLOW |
50 | #define O_NOFOLLOW 00400000 | ||||
51 | #endif | ||||
52 | #ifndef O_NOATIME | ||||
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 53 | #define O_NOATIME 01000000 |
54 | #endif | ||||
55 | #ifndef O_CLOEXEC | ||||
56 | #define O_CLOEXEC 02000000 | ||||
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 57 | #endif |
58 | #ifndef O_SYNC | ||||
59 | #define __O_SYNC 04000000 | ||||
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 60 | #define O_SYNC (__O_SYNC | O_DSYNC) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 61 | #endif |
62 | #ifndef O_PATH | ||||
63 | #define O_PATH 010000000 | ||||
64 | #endif | ||||
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 65 | #ifndef __O_TMPFILE |
66 | #define __O_TMPFILE 020000000 | ||||
67 | #endif | ||||
68 | #define O_TMPFILE (__O_TMPFILE | O_DIRECTORY) | ||||
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 69 | #ifndef O_NDELAY |
70 | #define O_NDELAY O_NONBLOCK | ||||
71 | #endif | ||||
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 72 | #define F_DUPFD 0 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 73 | #define F_GETFD 1 |
74 | #define F_SETFD 2 | ||||
75 | #define F_GETFL 3 | ||||
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 76 | #define F_SETFL 4 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 77 | #ifndef F_GETLK |
78 | #define F_GETLK 5 | ||||
79 | #define F_SETLK 6 | ||||
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 80 | #define F_SETLKW 7 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 81 | #endif |
82 | #ifndef F_SETOWN | ||||
83 | #define F_SETOWN 8 | ||||
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 84 | #define F_GETOWN 9 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 85 | #endif |
86 | #ifndef F_SETSIG | ||||
87 | #define F_SETSIG 10 | ||||
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 88 | #define F_GETSIG 11 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 89 | #endif |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame] | 90 | #if __BITS_PER_LONG == 32 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 91 | #ifndef F_GETLK64 |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 92 | #define F_GETLK64 12 |
Elliott Hughes | 9195a25 | 2014-04-08 10:15:06 -0700 | [diff] [blame] | 93 | #define F_SETLK64 13 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 94 | #define F_SETLKW64 14 |
95 | #endif | ||||
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 96 | #endif |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 97 | #ifndef F_SETOWN_EX |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 98 | #define F_SETOWN_EX 15 |
99 | #define F_GETOWN_EX 16 | ||||
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 100 | #endif |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 101 | #ifndef F_GETOWNER_UIDS |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 102 | #define F_GETOWNER_UIDS 17 |
103 | #endif | ||||
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 104 | #define F_OFD_GETLK 36 |
105 | #define F_OFD_SETLK 37 | ||||
106 | #define F_OFD_SETLKW 38 | ||||
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 107 | #define F_OWNER_TID 0 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 108 | #define F_OWNER_PID 1 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 109 | #define F_OWNER_PGRP 2 |
110 | struct f_owner_ex { | ||||
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 111 | int type; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 112 | __kernel_pid_t pid; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 113 | }; |
114 | #define FD_CLOEXEC 1 | ||||
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 115 | #ifndef F_RDLCK |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 116 | #define F_RDLCK 0 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 117 | #define F_WRLCK 1 |
118 | #define F_UNLCK 2 | ||||
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 119 | #endif |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 120 | #ifndef F_EXLCK |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 121 | #define F_EXLCK 4 |
122 | #define F_SHLCK 8 | ||||
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 123 | #endif |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 124 | #define LOCK_SH 1 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 125 | #define LOCK_EX 2 |
126 | #define LOCK_NB 4 | ||||
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 127 | #define LOCK_UN 8 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 128 | #define LOCK_MAND 32 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 129 | #define LOCK_READ 64 |
130 | #define LOCK_WRITE 128 | ||||
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 131 | #define LOCK_RW 192 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 132 | #define F_LINUX_SPECIFIC_BASE 1024 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 133 | #ifndef HAVE_ARCH_STRUCT_FLOCK |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 134 | #endif |
135 | #endif |