The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame^] | 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 | **************************************************************************** |
| 11 | ****************************************************************************/ |
| 12 | #ifndef _ASM_GENERIC_FCNTL_H |
| 13 | #define _ASM_GENERIC_FCNTL_H |
| 14 | |
| 15 | #include <linux/types.h> |
| 16 | |
| 17 | #define O_ACCMODE 00000003 |
| 18 | #define O_RDONLY 00000000 |
| 19 | #define O_WRONLY 00000001 |
| 20 | #define O_RDWR 00000002 |
| 21 | #ifndef O_CREAT |
| 22 | #define O_CREAT 00000100 |
| 23 | #endif |
| 24 | #ifndef O_EXCL |
| 25 | #define O_EXCL 00000200 |
| 26 | #endif |
| 27 | #ifndef O_NOCTTY |
| 28 | #define O_NOCTTY 00000400 |
| 29 | #endif |
| 30 | #ifndef O_TRUNC |
| 31 | #define O_TRUNC 00001000 |
| 32 | #endif |
| 33 | #ifndef O_APPEND |
| 34 | #define O_APPEND 00002000 |
| 35 | #endif |
| 36 | #ifndef O_NONBLOCK |
| 37 | #define O_NONBLOCK 00004000 |
| 38 | #endif |
| 39 | #ifndef O_SYNC |
| 40 | #define O_SYNC 00010000 |
| 41 | #endif |
| 42 | #ifndef FASYNC |
| 43 | #define FASYNC 00020000 |
| 44 | #endif |
| 45 | #ifndef O_DIRECT |
| 46 | #define O_DIRECT 00040000 |
| 47 | #endif |
| 48 | #ifndef O_LARGEFILE |
| 49 | #define O_LARGEFILE 00100000 |
| 50 | #endif |
| 51 | #ifndef O_DIRECTORY |
| 52 | #define O_DIRECTORY 00200000 |
| 53 | #endif |
| 54 | #ifndef O_NOFOLLOW |
| 55 | #define O_NOFOLLOW 00400000 |
| 56 | #endif |
| 57 | #ifndef O_NOATIME |
| 58 | #define O_NOATIME 01000000 |
| 59 | #endif |
| 60 | #ifndef O_NDELAY |
| 61 | #define O_NDELAY O_NONBLOCK |
| 62 | #endif |
| 63 | |
| 64 | #define F_DUPFD 0 |
| 65 | #define F_GETFD 1 |
| 66 | #define F_SETFD 2 |
| 67 | #define F_GETFL 3 |
| 68 | #define F_SETFL 4 |
| 69 | #ifndef F_GETLK |
| 70 | #define F_GETLK 5 |
| 71 | #define F_SETLK 6 |
| 72 | #define F_SETLKW 7 |
| 73 | #endif |
| 74 | #ifndef F_SETOWN |
| 75 | #define F_SETOWN 8 |
| 76 | #define F_GETOWN 9 |
| 77 | #endif |
| 78 | #ifndef F_SETSIG |
| 79 | #define F_SETSIG 10 |
| 80 | #define F_GETSIG 11 |
| 81 | #endif |
| 82 | |
| 83 | #define FD_CLOEXEC 1 |
| 84 | |
| 85 | #ifndef F_RDLCK |
| 86 | #define F_RDLCK 0 |
| 87 | #define F_WRLCK 1 |
| 88 | #define F_UNLCK 2 |
| 89 | #endif |
| 90 | |
| 91 | #ifndef F_EXLCK |
| 92 | #define F_EXLCK 4 |
| 93 | #define F_SHLCK 8 |
| 94 | #endif |
| 95 | |
| 96 | #ifndef F_INPROGRESS |
| 97 | #define F_INPROGRESS 16 |
| 98 | #endif |
| 99 | |
| 100 | #define LOCK_SH 1 |
| 101 | #define LOCK_EX 2 |
| 102 | #define LOCK_NB 4 |
| 103 | #define LOCK_UN 8 |
| 104 | |
| 105 | #define LOCK_MAND 32 |
| 106 | #define LOCK_READ 64 |
| 107 | #define LOCK_WRITE 128 |
| 108 | #define LOCK_RW 192 |
| 109 | |
| 110 | #define F_LINUX_SPECIFIC_BASE 1024 |
| 111 | |
| 112 | #ifndef HAVE_ARCH_STRUCT_FLOCK |
| 113 | #ifndef __ARCH_FLOCK_PAD |
| 114 | #define __ARCH_FLOCK_PAD |
| 115 | #endif |
| 116 | |
| 117 | struct flock { |
| 118 | short l_type; |
| 119 | short l_whence; |
| 120 | off_t l_start; |
| 121 | off_t l_len; |
| 122 | pid_t l_pid; |
| 123 | __ARCH_FLOCK_PAD |
| 124 | }; |
| 125 | #endif |
| 126 | |
| 127 | #ifndef F_GETLK64 |
| 128 | #define F_GETLK64 12 |
| 129 | #define F_SETLK64 13 |
| 130 | #define F_SETLKW64 14 |
| 131 | #endif |
| 132 | |
| 133 | #ifndef HAVE_ARCH_STRUCT_FLOCK64 |
| 134 | #ifndef __ARCH_FLOCK64_PAD |
| 135 | #define __ARCH_FLOCK64_PAD |
| 136 | #endif |
| 137 | |
| 138 | struct flock64 { |
| 139 | short l_type; |
| 140 | short l_whence; |
| 141 | loff_t l_start; |
| 142 | loff_t l_len; |
| 143 | pid_t l_pid; |
| 144 | __ARCH_FLOCK64_PAD |
| 145 | }; |
| 146 | #endif |
| 147 | |
| 148 | #endif |