Print this page
6564 F_FLOCKW and F_FLOCK are undefined symbols in SPARC build
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/libbc/inc/include/sys/fcntlcom.h
+++ new/usr/src/lib/libbc/inc/include/sys/fcntlcom.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
↓ open down ↓ |
12 lines elided |
↑ open up ↑ |
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 + * Copyright 2016 Gary Mills
23 24 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
24 25 * Use is subject to license terms.
25 26 */
26 27
27 28 /*
28 29 * Copyright (c) 1983 Regents of the University of California.
29 30 * All rights reserved. The Berkeley software License Agreement
30 31 * specifies the terms and conditions for redistribution.
31 32 */
32 33
33 34 #ifndef __SYS_FCNTLCOM_H
34 35 #define __SYS_FCNTLCOM_H
35 36
36 37 #ifdef __cplusplus
37 38 extern "C" {
38 39 #endif
39 40
40 41 /*
41 42 * Rewack the FXXXXX values as _FXXXX so that _POSIX_SOURCE works.
42 43 */
43 44 #define _FOPEN (-1) /* from sys/file.h, kernel use only */
44 45 #define _FREAD 0x0001 /* read enabled */
45 46 #define _FWRITE 0x0002 /* write enabled */
46 47 #define _FNDELAY 0x0004 /* non blocking I/O (4.2 style) */
47 48 #define _FAPPEND 0x0008 /* append (writes guaranteed at the end) */
48 49 #define _FMARK 0x0010 /* internal; mark during gc() */
49 50 #define _FDEFER 0x0020 /* internal; defer for next gc pass */
50 51 #define _FASYNC 0x0040 /* signal pgrp when data ready */
51 52 #define _FSHLOCK 0x0080 /* BSD flock() shared lock present */
52 53 #define _FEXLOCK 0x0100 /* BSD flock() exclusive lock present */
53 54 #define _FCREAT 0x0200 /* open with file create */
54 55 #define _FTRUNC 0x0400 /* open with truncation */
55 56 #define _FEXCL 0x0800 /* error on open if file exists */
56 57 #define _FNBIO 0x1000 /* non blocking I/O (sys5 style) */
57 58 #define _FSYNC 0x2000 /* do all writes synchronously */
58 59 #define _FNONBLOCK 0x4000 /* non blocking I/O (POSIX style) */
59 60 #define _FNOCTTY 0x8000 /* don't assign a ctty on this open */
60 61
61 62 #define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
62 63
63 64 /*
64 65 * Flag values for open(2) and fcntl(2)
65 66 * The kernel adds 1 to the open modes to turn it into some
66 67 * combination of FREAD and FWRITE.
67 68 */
68 69 #define O_RDONLY 0 /* +1 == FREAD */
69 70 #define O_WRONLY 1 /* +1 == FWRITE */
70 71 #define O_RDWR 2 /* +1 == FREAD|FWRITE */
71 72 #define O_APPEND _FAPPEND
72 73 #define O_CREAT _FCREAT
73 74 #define O_TRUNC _FTRUNC
74 75 #define O_EXCL _FEXCL
75 76 /* O_SYNC _FSYNC not posix, defined below */
76 77 /* O_NDELAY _FNDELAY set in include/fcntl.h */
77 78 /* O_NDELAY _FNBIO set in 5include/fcntl.h */
78 79 #define O_NONBLOCK _FNONBLOCK
79 80 #define O_NOCTTY _FNOCTTY
80 81
81 82 #ifndef _POSIX_SOURCE
82 83
83 84 #define O_SYNC _FSYNC
84 85
85 86 /*
86 87 * Flags that work for fcntl(fd, F_SETFL, FXXXX)
87 88 */
88 89 #define FAPPEND _FAPPEND
89 90 #define FSYNC _FSYNC
90 91 #define FASYNC _FASYNC
91 92 #define FNBIO _FNBIO
92 93 #define FNONBIO _FNONBLOCK /* XXX fix to be NONBLOCK everywhere */
93 94 #define FNDELAY _FNDELAY
94 95
95 96 /*
96 97 * Flags that are disallowed for fcntl's (FCNTLCANT);
97 98 * used for opens, internal state, or locking.
98 99 */
99 100 #define FREAD _FREAD
100 101 #define FWRITE _FWRITE
101 102 #define FMARK _FMARK
102 103 #define FDEFER _FDEFER
103 104 #define FSHLOCK _FSHLOCK
104 105 #define FEXLOCK _FEXLOCK
105 106
106 107 /*
107 108 * The rest of the flags, used only for opens
108 109 */
109 110 #define FOPEN _FOPEN
110 111 #define FCREAT _FCREAT
111 112 #define FTRUNC _FTRUNC
112 113 #define FEXCL _FEXCL
113 114 #define FNOCTTY _FNOCTTY
114 115
115 116 #endif /* !_POSIX_SOURCE */
116 117
117 118 /* XXX close on exec request; must match UF_EXCLOSE in user.h */
118 119 #define FD_CLOEXEC 1 /* posix */
119 120
120 121 /* fcntl(2) requests */
121 122 #define F_DUPFD 0 /* Duplicate fildes */
122 123 #define F_GETFD 1 /* Get fildes flags (close on exec) */
123 124 #define F_SETFD 2 /* Set fildes flags (close on exec) */
124 125 #define F_GETFL 3 /* Get file flags */
125 126 #define F_SETFL 4 /* Set file flags */
126 127 #ifndef _POSIX_SOURCE
↓ open down ↓ |
94 lines elided |
↑ open up ↑ |
127 128 #define F_GETOWN 5 /* Get owner - for ASYNC */
128 129 #define F_SETOWN 6 /* Set owner - for ASYNC */
129 130 #endif /* !_POSIX_SOURCE */
130 131 #define F_GETLK 7 /* Get record-locking information */
131 132 #define F_SETLK 8 /* Set or Clear a record-lock (Non-Blocking) */
132 133 #define F_SETLKW 9 /* Set or Clear a record-lock (Blocking) */
133 134 #ifndef _POSIX_SOURCE
134 135 #define F_CNVT 12 /* Convert a fhandle to an open fd */
135 136 #endif /* !_POSIX_SOURCE */
136 137
138 +/* Needed by flock.c */
139 +#define F_FLOCKW F_SETLKW
140 +#define F_FLOCK F_SETLK
141 +
137 142 /* fcntl(2) flags (l_type field of flock structure) */
138 143 #define F_RDLCK 1 /* read lock */
139 144 #define F_WRLCK 2 /* write lock */
140 145 #define F_UNLCK 3 /* remove lock(s) */
141 146 #ifndef _POSIX_SOURCE
142 147 #define F_UNLKSYS 4 /* remove remote locks for a given system */
143 148 #endif /* !_POSIX_SOURCE */
144 149
145 150 /* needed for _syscall(SYS_openat, AT_FDCWD, ...) */
146 151 #define AT_FDCWD 0xffd19553
147 152 #define AT_SYMLINK_NOFOLLOW 0x1000
148 153 #define AT_REMOVEDIR 0x1
149 154
150 155 #include <sys/stdtypes.h>
151 156
152 157 /* file segment locking set data type - information passed to system by user */
153 158 struct flock {
154 159 short l_type; /* F_RDLCK, F_WRLCK, or F_UNLCK */
155 160 short l_whence; /* flag to choose starting offset */
156 161 long l_start; /* relative offset, in bytes */
157 162 long l_len; /* length, in bytes; 0 means lock to EOF */
158 163 short l_pid; /* returned with F_GETLK */
159 164 short l_xxx; /* reserved for future use */
160 165 };
161 166
162 167 #ifndef _POSIX_SOURCE
163 168 /* extended file segment locking set data type */
164 169 struct eflock {
165 170 short l_type; /* F_RDLCK, F_WRLCK, or F_UNLCK */
166 171 short l_whence; /* flag to choose starting offset */
167 172 long l_start; /* relative offset, in bytes */
168 173 long l_len; /* length, in bytes; 0 means lock to EOF */
169 174 short l_pid; /* returned with F_GETLK */
170 175 short l_xxx; /* reserved for future use */
171 176 long l_rpid; /* Remote process id wanting this lock */
172 177 long l_rsys; /* Remote system id wanting this lock */
173 178 };
174 179 #endif /* !_POSIX_SOURCE */
175 180
176 181 #ifndef KERNEL
177 182 #include <sys/stat.h> /* sigh. for the mode bits for open/creat */
178 183
179 184 int open(/* char *path, int flags, mode_t modes */);
180 185 int creat(/* char *path, mode_t modes */);
181 186 int fcntl(/* int fd, cmd, ... */);
182 187 #endif /* !KERNEL */
183 188
184 189 #ifdef __cplusplus
185 190 }
186 191 #endif
187 192
188 193 #endif /* __SYS_FCNTLCOM_H */
↓ open down ↓ |
42 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX