1 /* 2 * Copyright 2012, The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef _FCNTL_PORTABLE_H_ 18 #define _FCNTL_PORTABLE_H_ 19 20 /* Derived from development/ndk/platforms/android-3/arch-arm/include/asm/fcntl.h */ 21 /* NB x86 does not have these and only uses the generic definitions */ 22 #define O_DIRECTORY_PORTABLE 040000 23 #define O_NOFOLLOW_PORTABLE 0100000 24 #define O_DIRECT_PORTABLE 0200000 25 #define O_LARGEFILE_PORTABLE 0400000 26 27 /* Derived from development/ndk/platforms/android-3/include/asm-generic/fcntl.h */ 28 #define O_ACCMODE_PORTABLE 00000003 29 #define O_RDONLY_PORTABLE 00000000 30 #define O_WRONLY_PORTABLE 00000001 31 #define O_RDWR_PORTABLE 00000002 32 #ifndef O_CREAT_PORTABLE 33 #define O_CREAT_PORTABLE 00000100 34 #endif 35 #ifndef O_EXCL_PORTABLE 36 #define O_EXCL_PORTABLE 00000200 37 #endif 38 #ifndef O_NOCTTY_PORTABLE 39 #define O_NOCTTY_PORTABLE 00000400 40 #endif 41 #ifndef O_TRUNC_PORTABLE 42 #define O_TRUNC_PORTABLE 00001000 43 #endif 44 #ifndef O_APPEND_PORTABLE 45 #define O_APPEND_PORTABLE 00002000 46 #endif 47 #ifndef O_NONBLOCK_PORTABLE 48 #define O_NONBLOCK_PORTABLE 00004000 49 #endif 50 #ifndef O_SYNC_PORTABLE 51 #define O_SYNC_PORTABLE 00010000 52 #endif 53 #ifndef FASYNC_PORTABLE 54 #define FASYNC_PORTABLE 00020000 55 #endif 56 #ifndef O_DIRECT_PORTABLE 57 #define O_DIRECT_PORTABLE 00040000 58 #endif 59 #ifndef O_LARGEFILE_PORTABLE 60 #define O_LARGEFILE_PORTABLE 00100000 61 #endif 62 #ifndef O_DIRECTORY_PORTABLE 63 #define O_DIRECTORY_PORTABLE 00200000 64 #endif 65 #ifndef O_NOFOLLOW_PORTABLE 66 #define O_NOFOLLOW_PORTABLE 00400000 67 #endif 68 #ifndef O_NOATIME_PORTABLE 69 #define O_NOATIME_PORTABLE 01000000 70 #endif 71 #ifndef O_NDELAY_PORTABLE 72 #define O_NDELAY_PORTABLE O_NONBLOCK_PORTABLE 73 #endif 74 75 struct flock64_portable { 76 short l_type; 77 short l_whence; 78 unsigned char __padding[4]; 79 loff_t l_start; 80 loff_t l_len; 81 pid_t l_pid; 82 __ARCH_FLOCK64_PAD 83 }; 84 85 /* 86 The X86 Version is 87 88 struct flock64 { 89 short l_type; 90 short l_whence; 91 loff_t l_start; 92 loff_t l_len; 93 pid_t l_pid; 94 __ARCH_FLOCK64_PAD 95 }; 96 */ 97 98 #ifndef F_GETLK_PORTABLE 99 #define F_GETLK_PORTABLE 5 100 #define F_SETLK_PORTABLE 6 101 #define F_SETLKW_PORTABLE 7 102 #endif 103 #ifndef F_SETOWN_PORTABLE 104 #define F_SETOWN_PORTABLE 8 105 #define F_GETOWN_PORTABLE 9 106 #endif 107 108 #ifndef F_GETLK64_PORTABLE 109 #define F_GETLK64_PORTABLE 12 110 #define F_SETLK64_PORTABLE 13 111 #define F_SETLKW64_PORTABLE 14 112 #endif 113 114 #endif /* _FCNTL_PORTABLE_H */ 115