1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 /* 22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 23 * Use is subject to license terms. 24 */ 25 26 #ifndef _SYS_LX_FCNTL_H 27 #define _SYS_LX_FCNTL_H 28 29 #ifdef __cplusplus 30 extern "C" { 31 #endif 32 33 /* 34 * Lx open/fcntl flags 35 */ 36 #define LX_O_RDONLY 00 37 #define LX_O_WRONLY 01 38 #define LX_O_RDWR 02 39 #define LX_O_CREAT 0100 40 #define LX_O_EXCL 0200 41 #define LX_O_NOCTTY 0400 42 #define LX_O_TRUNC 01000 43 #define LX_O_APPEND 02000 44 #define LX_O_NONBLOCK 04000 45 #define LX_O_NDELAY LX_O_NONBLOCK 46 #define LX_O_SYNC 010000 47 #define LX_O_FSYNC LX_O_SYNC 48 #define LX_O_ASYNC 020000 49 #define LX_O_DIRECT 040000 50 #define LX_O_LARGEFILE 0100000 51 #define LX_O_DIRECTORY 0200000 52 #define LX_O_NOFOLLOW 0400000 53 54 #define LX_F_DUPFD 0 55 #define LX_F_GETFD 1 56 #define LX_F_SETFD 2 57 #define LX_F_GETFL 3 58 #define LX_F_SETFL 4 59 #define LX_F_GETLK 5 60 #define LX_F_SETLK 6 61 #define LX_F_SETLKW 7 62 #define LX_F_SETOWN 8 63 #define LX_F_GETOWN 9 64 #define LX_F_SETSIG 10 65 #define LX_F_GETSIG 11 66 67 #define LX_F_GETLK64 12 68 #define LX_F_SETLK64 13 69 #define LX_F_SETLKW64 14 70 71 #define LX_F_SETLEASE 1024 72 #define LX_F_GETLEASE 1025 73 #define LX_F_NOTIFY 1026 74 75 #define LX_F_RDLCK 0 76 #define LX_F_WRLCK 1 77 #define LX_F_UNLCK 2 78 79 /* 80 * Lx flock codes. 81 */ 82 #define LX_NAME_MAX 255 83 #define LX_LOCK_SH 1 /* shared */ 84 #define LX_LOCK_EX 2 /* exclusive */ 85 #define LX_LOCK_NB 4 /* non-blocking */ 86 #define LX_LOCK_UN 8 /* unlock */ 87 88 #define LX_AT_FDCWD -100 89 #define LX_AT_EACCESS 512 90 #define LX_AT_REMOVEDIR 512 91 #define LX_AT_SYMLINK_NOFOLLOW 256 92 #define LX_AT_SYMLINK_FOLLOW 1024 93 94 struct lx_flock { 95 short l_type; 96 short l_whence; 97 long l_start; 98 long l_len; 99 int l_pid; 100 }; 101 102 struct lx_flock64 { 103 short l_type; 104 short l_whence; 105 long long l_start; 106 long long l_len; 107 int l_pid; 108 }; 109 110 #ifdef __cplusplus 111 } 112 #endif 113 114 #endif /* _SYS_LX_FCNTL_H */