Print this page
3853 __cplusplus change and headers incompatipility with clang
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/head/unistd.h
+++ new/usr/src/head/unistd.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 *
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 23 * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
24 24 */
25 25
26 26 /* Copyright (c) 1988 AT&T */
27 27 /* All Rights Reserved */
28 28
29 29 /* Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved. */
30 30
31 31 #ifndef _UNISTD_H
32 32 #define _UNISTD_H
33 33
34 34 #include <sys/feature_tests.h>
35 35
36 36 #include <sys/types.h>
37 37 #include <sys/unistd.h>
38 38
39 39 #ifdef __cplusplus
40 40 extern "C" {
41 41 #endif
42 42
43 43 /* Symbolic constants for the "access" routine: */
44 44 #define R_OK 4 /* Test for Read permission */
45 45 #define W_OK 2 /* Test for Write permission */
46 46 #define X_OK 1 /* Test for eXecute permission */
47 47 #define F_OK 0 /* Test for existence of File */
48 48
49 49 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
50 50 #define F_ULOCK 0 /* Unlock a previously locked region */
51 51 #define F_LOCK 1 /* Lock a region for exclusive use */
52 52 #define F_TLOCK 2 /* Test and lock a region for exclusive use */
53 53 #define F_TEST 3 /* Test a region for other processes locks */
54 54 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
55 55
56 56 /* Symbolic constants for the "lseek" routine: */
57 57
58 58 #ifndef SEEK_SET
59 59 #define SEEK_SET 0 /* Set file pointer to "offset" */
60 60 #endif
61 61
62 62 #ifndef SEEK_CUR
63 63 #define SEEK_CUR 1 /* Set file pointer to current plus "offset" */
64 64 #endif
65 65
66 66 #ifndef SEEK_END
67 67 #define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
68 68 #endif
69 69
70 70 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
71 71 #ifndef SEEK_DATA
72 72 #define SEEK_DATA 3 /* Set file pointer to next data past offset */
73 73 #endif
74 74
75 75 #ifndef SEEK_HOLE
76 76 #define SEEK_HOLE 4 /* Set file pointer to next hole past offset */
77 77 #endif
78 78 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
79 79
80 80 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
81 81 /* Path names: */
82 82 #define GF_PATH "/etc/group" /* Path name of the "group" file */
83 83 #define PF_PATH "/etc/passwd" /* Path name of the "passwd" file */
84 84 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
85 85
86 86 /*
87 87 * compile-time symbolic constants,
88 88 * Support does not mean the feature is enabled.
89 89 * Use pathconf/sysconf to obtain actual configuration value.
90 90 */
91 91
92 92 /* Values unchanged in UNIX 03 */
93 93 #define _POSIX_ASYNC_IO 1
94 94 #define _POSIX_JOB_CONTROL 1
95 95 #define _POSIX_SAVED_IDS 1
96 96 #define _POSIX_SYNC_IO 1
97 97
98 98 /*
99 99 * POSIX.1b compile-time symbolic constants.
100 100 */
101 101 #if defined(_XPG6)
102 102 #define _POSIX_ASYNCHRONOUS_IO 200112L
103 103 #define _POSIX_FSYNC 200112L
104 104 #define _POSIX_MAPPED_FILES 200112L
105 105 #define _POSIX_MEMLOCK 200112L
106 106 #define _POSIX_MEMLOCK_RANGE 200112L
107 107 #define _POSIX_MEMORY_PROTECTION 200112L
108 108 #define _POSIX_MESSAGE_PASSING 200112L
109 109 #define _POSIX_PRIORITY_SCHEDULING 200112L
110 110 #define _POSIX_REALTIME_SIGNALS 200112L
111 111 #define _POSIX_SEMAPHORES 200112L
112 112 #define _POSIX_SHARED_MEMORY_OBJECTS 200112L
113 113 #define _POSIX_SYNCHRONIZED_IO 200112L
114 114 #else
115 115 #define _POSIX_ASYNCHRONOUS_IO 1
116 116 #define _POSIX_FSYNC 1
117 117 #define _POSIX_MAPPED_FILES 1
118 118 #define _POSIX_MEMLOCK 1
119 119 #define _POSIX_MEMLOCK_RANGE 1
120 120 #define _POSIX_MEMORY_PROTECTION 1
121 121 #define _POSIX_MESSAGE_PASSING 1
122 122 #define _POSIX_PRIORITY_SCHEDULING 1
123 123 #define _POSIX_REALTIME_SIGNALS 1
124 124 #define _POSIX_SEMAPHORES 1
125 125 #define _POSIX_SHARED_MEMORY_OBJECTS 1
126 126 #define _POSIX_SYNCHRONIZED_IO 1
127 127 #endif
128 128
129 129 /*
130 130 * POSIX.1c compile-time symbolic constants.
131 131 */
132 132 #if defined(_XPG6)
133 133 #define _POSIX_THREAD_SAFE_FUNCTIONS 200112L
134 134 #define _POSIX_THREADS 200112L
135 135 #define _POSIX_THREAD_ATTR_STACKADDR 200112L
136 136 #define _POSIX_THREAD_ATTR_STACKSIZE 200112L
137 137 #define _POSIX_THREAD_PROCESS_SHARED 200112L
138 138 #define _POSIX_THREAD_PRIORITY_SCHEDULING 200112L
139 139 #define _POSIX_TIMERS 200112L
140 140 #else
141 141 #define _POSIX_THREAD_SAFE_FUNCTIONS 1
142 142 #define _POSIX_THREADS 1
143 143 #define _POSIX_THREAD_ATTR_STACKADDR 1
144 144 #define _POSIX_THREAD_ATTR_STACKSIZE 1
145 145 #define _POSIX_THREAD_PROCESS_SHARED 1
146 146 #define _POSIX_THREAD_PRIORITY_SCHEDULING 1
147 147 #define _POSIX_TIMERS 1
148 148 #endif
149 149
150 150 /* New in UNIX 03 */
151 151 #define _POSIX_ADVISORY_INFO 200112L
152 152 #define _POSIX_BARRIERS 200112L
153 153 #define _POSIX_CLOCK_SELECTION 200112L
154 154 #define _POSIX_IPV6 200112L
155 155 #define _POSIX_MONOTONIC_CLOCK 200112L
156 156 #define _POSIX_RAW_SOCKETS 200112L
157 157 #define _POSIX_READER_WRITER_LOCKS 200112L
158 158 #define _POSIX_SPAWN 200112L
159 159 #define _POSIX_SPIN_LOCKS 200112L
160 160 #define _POSIX_TIMEOUTS 200112L
161 161
162 162 /*
163 163 * Support for the POSIX.1 mutex protocol attribute. For realtime applications
164 164 * which need mutexes to support priority inheritance/ceiling.
165 165 */
166 166 #if defined(_XPG6)
167 167 #define _POSIX_THREAD_PRIO_INHERIT 200112L
168 168 #define _POSIX_THREAD_PRIO_PROTECT 200112L
169 169 #else
170 170 #define _POSIX_THREAD_PRIO_INHERIT 1
171 171 #define _POSIX_THREAD_PRIO_PROTECT 1
172 172 #endif
173 173
174 174 #ifndef _POSIX_VDISABLE
175 175 #define _POSIX_VDISABLE 0
176 176 #endif
177 177
178 178 #ifndef NULL
179 179 #if defined(_LP64)
180 180 #define NULL 0L
181 181 #else
182 182 #define NULL 0
183 183 #endif
184 184 #endif
185 185
186 186 #define STDIN_FILENO 0
187 187 #define STDOUT_FILENO 1
188 188 #define STDERR_FILENO 2
189 189
190 190 /*
191 191 * Large File Summit-related announcement macros. The system supports both
192 192 * the additional and transitional Large File Summit interfaces. (The final
193 193 * two macros provide a finer granularity breakdown of _LFS64_LARGEFILE.)
194 194 */
195 195 #define _LFS_LARGEFILE 1
196 196 #define _LFS64_LARGEFILE 1
197 197 #define _LFS64_STDIO 1
198 198 #define _LFS64_ASYNCHRONOUS_IO 1
199 199
200 200 /* large file compilation environment setup */
201 201 #if !defined(_LP64) && _FILE_OFFSET_BITS == 64
202 202 #ifdef __PRAGMA_REDEFINE_EXTNAME
203 203 #pragma redefine_extname ftruncate ftruncate64
204 204 #pragma redefine_extname lseek lseek64
205 205 #pragma redefine_extname pread pread64
206 206 #pragma redefine_extname pwrite pwrite64
207 207 #pragma redefine_extname truncate truncate64
208 208 #pragma redefine_extname lockf lockf64
209 209 #pragma redefine_extname tell tell64
210 210 #else /* __PRAGMA_REDEFINE_EXTNAME */
211 211 #define ftruncate ftruncate64
212 212 #define lseek lseek64
213 213 #define pread pread64
214 214 #define pwrite pwrite64
215 215 #define truncate truncate64
216 216 #define lockf lockf64
217 217 #define tell tell64
218 218 #endif /* __PRAGMA_REDEFINE_EXTNAME */
219 219 #endif /* !_LP64 && _FILE_OFFSET_BITS == 64 */
220 220
221 221 /* In the LP64 compilation environment, the APIs are already large file */
222 222 #if defined(_LP64) && defined(_LARGEFILE64_SOURCE)
223 223 #ifdef __PRAGMA_REDEFINE_EXTNAME
224 224 #pragma redefine_extname ftruncate64 ftruncate
225 225 #pragma redefine_extname lseek64 lseek
226 226 #pragma redefine_extname pread64 pread
227 227 #pragma redefine_extname pwrite64 pwrite
228 228 #pragma redefine_extname truncate64 truncate
229 229 #pragma redefine_extname lockf64 lockf
230 230 #pragma redefine_extname tell64 tell
231 231 #else /* __PRAGMA_REDEFINE_EXTNAME */
232 232 #define ftruncate64 ftruncate
233 233 #define lseek64 lseek
234 234 #define pread64 pread
235 235 #define pwrite64 pwrite
236 236 #define truncate64 truncate
237 237 #define lockf64 lockf
238 238 #define tell64 tell
239 239 #endif /* __PRAGMA_REDEFINE_EXTNAME */
240 240 #endif /* _LP64 && _LARGEFILE64_SOURCE */
241 241
242 242 #if defined(__STDC__)
243 243
244 244 extern int access(const char *, int);
245 245 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
246 246 extern int acct(const char *);
247 247 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
248 248 extern unsigned alarm(unsigned);
249 249 /* Marked as LEGACY in SUSv2 and removed in SUSv3 */
250 250 #if !defined(__XOPEN_OR_POSIX) || (defined(_XPG4_2) && !defined(_XPG6)) || \
251 251 defined(__EXTENSIONS__)
252 252 extern int brk(void *);
253 253 #endif /* !defined(__XOPEN_OR_POSIX) || (defined(_XPG4_2)... */
254 254 extern int chdir(const char *);
255 255 extern int chown(const char *, uid_t, gid_t);
256 256 /* Marked as LEGACY in SUSv2 and removed in SUSv3 */
257 257 #if !defined(_POSIX_C_SOURCE) || (defined(_XOPEN_SOURCE) && \
258 258 !defined(_XPG6)) || defined(__EXTENSIONS__)
259 259 extern int chroot(const char *);
260 260 #endif /* !defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE))... */
261 261 extern int close(int);
262 262 #if defined(_XPG4) || defined(__EXTENSIONS__)
263 263 extern size_t confstr(int, char *, size_t);
264 264 extern char *crypt(const char *, const char *);
265 265 #endif /* defined(_XPG4) || defined(__EXTENSIONS__) */
266 266 #if !defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \
267 267 defined(__EXTENSIONS__)
268 268 extern char *ctermid(char *);
269 269 #endif /* (!defined(_POSIX_C_SOURCE) ... */
270 270 #if !defined(__XOPEN_OR_POSIX) || defined(_REENTRANT) || defined(__EXTENSIONS__)
271 271 extern char *ctermid_r(char *);
272 272 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_REENTRANT) ... */
273 273 /* Marked as LEGACY in SUSv2 and removed in SUSv3 */
274 274 #if !defined(_XPG6) || defined(__EXTENSIONS__)
275 275 extern char *cuserid(char *);
276 276 #endif
277 277 extern int dup(int);
278 278 extern int dup2(int, int);
279 279 extern int dup3(int, int, int);
280 280 #if defined(_XPG4) || defined(__EXTENSIONS__)
281 281 extern void encrypt(char *, int);
282 282 #endif /* defined(XPG4) || defined(__EXTENSIONS__) */
283 283 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
284 284 extern void endusershell(void);
285 285 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
286 286 extern int execl(const char *, const char *, ...);
287 287 extern int execle(const char *, const char *, ...);
288 288 extern int execlp(const char *, const char *, ...);
289 289 extern int execv(const char *, char *const *);
290 290 extern int execve(const char *, char *const *, char *const *);
291 291 extern int execvp(const char *, char *const *);
292 292 extern void _exit(int)
293 293 __NORETURN;
294 294 /*
295 295 * The following fattach prototype is duplicated in <stropts.h>. The
296 296 * duplication is necessitated by XPG4.2 which requires the prototype
297 297 * be defined in <stropts.h>.
298 298 */
299 299 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
300 300 extern int fattach(int, const char *);
301 301 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
302 302 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
303 303 extern int fchdir(int);
304 304 extern int fchown(int, uid_t, gid_t);
305 305 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
306 306 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
307 307 extern int fchroot(int);
308 308 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
309 309 #if !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE > 2) || \
310 310 defined(__EXTENSIONS__)
311 311 extern int fdatasync(int);
312 312 #endif /* !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE > 2)... */
313 313 /*
314 314 * The following fdetach prototype is duplicated in <stropts.h>. The
315 315 * duplication is necessitated by XPG4.2 which requires the prototype
316 316 * be defined in <stropts.h>.
317 317 */
318 318 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
319 319 extern int fdetach(const char *);
320 320 #endif /* !defined(__XOPEN_OR_POSIX)... */
321 321 extern pid_t fork(void);
322 322 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
323 323 extern pid_t fork1(void);
324 324 extern pid_t forkall(void);
325 325 #endif /* !defined(__XOPEN_OR_POSIX)... */
326 326 extern long fpathconf(int, int);
327 327 #if !defined(_POSIX_C_SOURCE) || (_POSIX_C_SOURCE > 2) || \
328 328 defined(__EXTENSIONS__)
329 329 extern int fsync(int);
330 330 #endif /* !defined(_POSIX_C_SOURCE) || (_POSIX_C_SOURCE > 2)... */
331 331 #if !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE > 2) || defined(_XPG4_2) || \
332 332 (defined(_LARGEFILE_SOURCE) && _FILE_OFFSET_BITS == 64) || \
333 333 defined(__EXTENSIONS__)
334 334 extern int ftruncate(int, off_t);
335 335 #endif /* !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE > 2)... */
336 336 extern char *getcwd(char *, size_t);
337 337 #if !defined(__XOPEN_OR_POSIX) || (defined(_XPG4_2) && !defined(_XPG6)) || \
338 338 defined(__EXTENSIONS__)
339 339 extern int getdtablesize(void);
340 340 #endif
341 341 extern gid_t getegid(void);
342 342 extern uid_t geteuid(void);
343 343 extern gid_t getgid(void);
344 344 extern int getgroups(int, gid_t *);
345 345 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
346 346 extern long gethostid(void);
347 347 #endif
348 348 #if defined(_XPG4_2)
349 349 extern int gethostname(char *, size_t);
350 350 #elif !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
351 351 extern int gethostname(char *, int);
352 352 #endif
353 353 extern char *getlogin(void);
354 354 #if defined(_XPG4) || defined(__EXTENSIONS__)
355 355 extern int getopt(int, char *const *, const char *);
356 356 extern char *optarg;
357 357 extern int opterr, optind, optopt;
358 358 /* Marked as LEGACY in SUSv2 and removed in SUSv3 */
359 359 #if !defined(_XPG6) || defined(__EXTENSIONS__)
360 360 extern char *getpass(const char *);
361 361 #endif
362 362 #endif /* defined(_XPG4) || defined(__EXTENSIONS__) */
363 363 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
364 364 /* Marked as LEGACY in SUSv2 and removed in SUSv3 */
365 365 #if !defined(_XPG6) || defined(__EXTENSIONS__)
366 366 extern int getpagesize(void);
367 367 #endif
368 368 extern pid_t getpgid(pid_t);
369 369 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
370 370 extern pid_t getpid(void);
371 371 extern pid_t getppid(void);
372 372 extern pid_t getpgrp(void);
373 373
374 374 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
375 375 char *gettxt(const char *, const char *);
376 376 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
377 377 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
378 378 extern pid_t getsid(pid_t);
379 379 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
380 380 extern uid_t getuid(void);
381 381 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
382 382 extern char *getusershell(void);
383 383 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
384 384 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
385 385 extern char *getwd(char *);
386 386 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
387 387 /*
388 388 * The following ioctl prototype is duplicated in <stropts.h>. The
389 389 * duplication is necessitated by XPG4.2 which requires the prototype
390 390 * be defined in <stropts.h>.
391 391 */
392 392 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
393 393 extern int ioctl(int, int, ...);
394 394 extern int isaexec(const char *, char *const *, char *const *);
395 395 extern int issetugid(void);
396 396 #endif
397 397 extern int isatty(int);
398 398 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
399 399 extern int lchown(const char *, uid_t, gid_t);
400 400 #endif
401 401 extern int link(const char *, const char *);
402 402 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
403 403 extern offset_t llseek(int, offset_t, int);
404 404 #endif
405 405 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || \
406 406 (defined(_LARGEFILE_SOURCE) && _FILE_OFFSET_BITS == 64) || \
407 407 defined(__EXTENSIONS__)
408 408 extern int lockf(int, int, off_t);
409 409 #endif
410 410 extern off_t lseek(int, off_t, int);
411 411 #if !defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \
412 412 defined(__EXTENSIONS__)
413 413 extern int nice(int);
414 414 #endif /* !defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)... */
415 415 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
416 416 extern int mincore(caddr_t, size_t, char *);
417 417 #endif
418 418 extern long pathconf(const char *, int);
419 419 extern int pause(void);
420 420 extern int pipe(int *);
421 421 extern int pipe2(int *, int);
422 422 #if !defined(_POSIX_C_SOURCE) || defined(_XPG5) || \
423 423 (defined(_LARGEFILE_SOURCE) && _FILE_OFFSET_BITS == 64) || \
424 424 defined(__EXTENSIONS__)
425 425 extern ssize_t pread(int, void *, size_t, off_t);
426 426 #endif
427 427 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
428 428 extern void profil(unsigned short *, size_t, unsigned long, unsigned int);
429 429 #endif
430 430 /*
431 431 * pthread_atfork() is also declared in <pthread.h> as per SUSv3. The
432 432 * declarations are identical. A change to either one may also require
433 433 * appropriate namespace updates in order to avoid redeclaration
434 434 * warnings in the case where both prototypes are exposed via inclusion
435 435 * of both <pthread.h> and <unistd.h>.
436 436 */
437 437 #if !defined(__XOPEN_OR_POSIX) || \
438 438 ((_POSIX_C_SOURCE > 2) && !defined(_XPG6)) || \
439 439 defined(__EXTENSIONS__)
440 440 extern int pthread_atfork(void (*) (void), void (*) (void), void (*) (void));
441 441 #endif /* !defined(__XOPEN_OR_POSIX) || ((_POSIX_C_SOURCE > 2) ... */
442 442 #if !defined(_LP64) && \
443 443 (!defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__))
444 444 extern int ptrace(int, pid_t, int, int);
445 445 #endif
446 446 #if !defined(_POSIX_C_SOURCE) || defined(_XPG5) || \
447 447 (defined(_LARGEFILE_SOURCE) && _FILE_OFFSET_BITS == 64) || \
448 448 defined(__EXTENSIONS__)
449 449 extern ssize_t pwrite(int, const void *, size_t, off_t);
450 450 #endif
451 451 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
452 452 /* per RFC 3542; This is also defined in netdb.h */
453 453 extern int rcmd_af(char **, unsigned short, const char *, const char *,
↓ open down ↓ |
453 lines elided |
↑ open up ↑ |
454 454 const char *, int *, int);
455 455 #endif
456 456 extern ssize_t read(int, void *, size_t);
457 457 #if !defined(__XOPEN_OR_POSIX) || \
458 458 defined(_XPG4_2) || defined(__EXTENSIONS__)
459 459 extern ssize_t readlink(const char *_RESTRICT_KYWD, char *_RESTRICT_KYWD,
460 460 size_t);
461 461 #endif
462 462 #if (!defined(__XOPEN_OR_POSIX) || (defined(_XPG3) && !defined(_XPG4))) || \
463 463 defined(__EXTENSIONS__)
464 +#if __cplusplus >= 199711L
465 +namespace std {
466 +#endif
464 467 extern int rename(const char *, const char *);
468 +#if __cplusplus >= 199711L
469 +} /* end of namespace std */
470 +
471 +using std::rename;
472 +#endif /* __cplusplus >= 199711L */
465 473 #endif /* (!defined(__XOPEN_OR_POSIX) || (defined(_XPG3)... */
466 474 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
467 475 extern int resolvepath(const char *, char *, size_t);
468 476 /* per RFC 3542; This is also defined in netdb.h */
469 477 extern int rexec_af(char **, unsigned short, const char *, const char *,
470 478 const char *, int *, int);
471 479 #endif /* !defined(__XOPEN_OR_POSIX)|| defined(__EXTENSIONS__) */
472 480 extern int rmdir(const char *);
473 481 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
474 482 /* per RFC 3542; This is also defined in netdb.h */
475 483 extern int rresvport_af(int *, int);
476 484 #endif
477 485
478 486 #if !defined(__XOPEN_OR_POSIX) || (defined(_XPG4_2) && !defined(_XPG6)) || \
479 487 defined(__EXTENSIONS__)
480 488 extern void *sbrk(intptr_t);
481 489 #endif /* !defined(__XOPEN_OR_POSIX) || (defined(_XPG4_2)... */
482 490 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || defined(__EXTENSIONS__)
483 491 extern int setegid(gid_t);
484 492 extern int seteuid(uid_t);
485 493 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG6) ... */
486 494 extern int setgid(gid_t);
487 495 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
488 496 extern int setgroups(int, const gid_t *);
489 497 extern int sethostname(char *, int);
490 498 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
491 499 extern int setpgid(pid_t, pid_t);
492 500 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
493 501 extern pid_t setpgrp(void);
494 502 extern int setregid(gid_t, gid_t);
495 503 extern int setreuid(uid_t, uid_t);
496 504 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
497 505 extern pid_t setsid(void);
498 506 extern int setuid(uid_t);
499 507 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
500 508 extern void setusershell(void);
501 509 #endif /* !defined(__XOPEN_OR_POSIX)|| defined(__EXTENSIONS__) */
502 510 extern unsigned sleep(unsigned);
503 511 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
504 512 extern int stime(const time_t *);
505 513 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
506 514 #if defined(_XPG4)
507 515 /* __EXTENSIONS__ makes the SVID Third Edition prototype in stdlib.h visible */
508 516 extern void swab(const void *_RESTRICT_KYWD, void *_RESTRICT_KYWD, ssize_t);
509 517 #endif /* defined(_XPG4) */
510 518 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
511 519 extern int symlink(const char *, const char *);
512 520 extern void sync(void);
513 521 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) */
514 522 #if defined(_XPG5) && !defined(_XPG6)
515 523 #ifdef __PRAGMA_REDEFINE_EXTNAME
516 524 #pragma redefine_extname sysconf __sysconf_xpg5
517 525 #else /* __PRAGMA_REDEFINE_EXTNAME */
518 526 #define sysconf __sysconf_xpg5
519 527 #endif /* __PRAGMA_REDEFINE_EXTNAME */
520 528 #endif /* defined(_XPG5) && !defined(_XPG6) */
521 529 extern long sysconf(int);
522 530 extern pid_t tcgetpgrp(int);
523 531 extern int tcsetpgrp(int, pid_t);
524 532 #if !defined(__XOPEN_OR_POSIX) || \
525 533 (defined(_LARGEFILE_SOURCE) && _FILE_OFFSET_BITS == 64) || \
526 534 defined(__EXTENSIONS__)
527 535 extern off_t tell(int);
528 536 #endif /* !defined(__XOPEN_OR_POSIX)... */
529 537 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || \
530 538 (defined(_LARGEFILE_SOURCE) && _FILE_OFFSET_BITS == 64) || \
531 539 defined(__EXTENSIONS__)
532 540 extern int truncate(const char *, off_t);
533 541 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
534 542 extern char *ttyname(int);
535 543 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
536 544 extern useconds_t ualarm(useconds_t, useconds_t);
537 545 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
538 546 extern int unlink(const char *);
539 547 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
540 548 extern int usleep(useconds_t);
541 549 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
542 550 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
543 551 extern pid_t vfork(void) __RETURNS_TWICE;
544 552 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
545 553 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
546 554 extern void vhangup(void);
547 555 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
548 556 extern ssize_t write(int, const void *, size_t);
549 557 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
550 558 extern void yield(void);
551 559 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
552 560
553 561 #if !defined(__XOPEN_OR_POSIX) || defined(_ATFILE_SOURCE) || \
554 562 defined(__EXTENSIONS__)
555 563 /* || defined(_XPG7) */
556 564 extern int faccessat(int, const char *, int, int);
557 565 extern int fchownat(int, const char *, uid_t, gid_t, int);
558 566 extern int linkat(int, const char *, int, const char *, int);
559 567 extern ssize_t readlinkat(int, const char *_RESTRICT_KYWD,
560 568 char *_RESTRICT_KYWD, size_t);
561 569 extern int renameat(int, const char *, int, const char *);
562 570 extern int symlinkat(const char *, int, const char *);
563 571 extern int unlinkat(int, const char *, int);
564 572 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_ATFILE_SOURCE)... */
565 573 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
566 574 extern int get_nprocs(void);
567 575 extern int get_nprocs_conf(void);
568 576 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
569 577
570 578 /* transitional large file interface versions */
571 579 #if defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
572 580 !defined(__PRAGMA_REDEFINE_EXTNAME))
573 581 extern int ftruncate64(int, off64_t);
574 582 extern off64_t lseek64(int, off64_t, int);
575 583 extern ssize_t pread64(int, void *, size_t, off64_t);
576 584 extern ssize_t pwrite64(int, const void *, size_t, off64_t);
577 585 extern off64_t tell64(int);
578 586 extern int truncate64(const char *, off64_t);
579 587 extern int lockf64(int, int, off64_t);
580 588 #endif /* _LARGEFILE64_SOURCE */
581 589
582 590 #else /* __STDC__ */
583 591
584 592 extern int access();
585 593 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
586 594 extern int acct();
587 595 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
588 596 extern unsigned alarm();
589 597 #if !defined(__XOPEN_OR_POSIX) || (defined(_XPG4_2) && !defined(_XPG6)) || \
590 598 defined(__EXTENSIONS__)
591 599 extern int brk();
592 600 #endif /* !defined(__XOPEN_OR_POSIX) || (defined(_XPG4_2)... */
593 601 extern int chdir();
594 602 extern int chown();
595 603 #if !defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \
596 604 defined(__EXTENSIONS__)
597 605 extern int chroot();
598 606 #endif /* (!defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)... */
599 607 extern int close();
600 608 #if defined(_XPG4) || defined(__EXTENSIONS__)
601 609 extern size_t confstr();
602 610 extern char *crypt();
603 611 #endif /* defined(XPG4) || defined(__EXTENSIONS__) */
604 612 #if !defined(_POSIX_C_SOURCE) || defined(_XPG3) || defined(__EXTENSIONS__)
605 613 extern char *ctermid();
606 614 #endif /* (!defined(_POSIX_C_SOURCE) || defined(_XPG3)... */
607 615 #if !defined(__XOPEN_OR_POSIX) || defined(_REENTRANT) || defined(__EXTENSIONS__)
608 616 extern char *ctermid_r();
609 617 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_REENTRANT) ... */
610 618 #if !defined(_XPG6) || defined(__EXTENSIONS__)
611 619 extern char *cuserid();
612 620 #endif
613 621 extern int dup();
614 622 extern int dup2();
615 623 extern int dup3();
616 624 #if defined(_XPG4) || defined(__EXTENSIONS__)
617 625 extern void encrypt();
618 626 #endif /* defined(_XPG4) || defined(__EXTENSIONS__) */
619 627 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
620 628 extern void endusershell();
621 629 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
622 630 extern int execl();
623 631 extern int execle();
624 632 extern int execlp();
625 633 extern int execv();
626 634 extern int execve();
627 635 extern int execvp();
628 636 extern void _exit();
629 637 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
630 638 extern int fattach();
631 639 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
632 640 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
633 641 extern int fchdir();
634 642 extern int fchown();
635 643 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
636 644 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
637 645 extern int fchroot();
638 646 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
639 647 #if !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE > 2) || \
640 648 defined(__EXTENSIONS__)
641 649 extern int fdatasync();
642 650 #endif /* !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE > 2)... */
643 651 #if !defined(__XOPEN_OR_POSIX)
644 652 extern int fdetach();
645 653 #endif /* !defined(__XOPEN_OR_POSIX) */
646 654 extern pid_t fork();
647 655 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
648 656 extern pid_t fork1();
649 657 extern pid_t forkall();
650 658 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
651 659 extern long fpathconf();
652 660 #if !defined(_POSIX_C_SOURCE) || (_POSIX_C_SOURCE > 2) || \
653 661 defined(__EXTENSIONS__)
654 662 extern int fsync();
655 663 #endif /* !defined(_POSIX_C_SOURCE) || (_POSIX_C_SOURCE > 2)... */
656 664 #if !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE > 2) || defined(_XPG4_2) || \
657 665 (defined(_LARGEFILE_SOURCE) && _FILE_OFFSET_BITS == 64) || \
658 666 defined(__EXTENSIONS__)
659 667 extern int ftruncate();
660 668 #endif /* !defined(__XOPEN_OR_POSIX) (_POSIX_C_SOURCE > 2)... */
661 669 extern char *getcwd();
662 670 #if !defined(__XOPEN_OR_POSIX) || (defined(_XPG4_2) && !defined(_XPG6)) || \
663 671 defined(__EXTENSIONS__)
664 672 extern int getdtablesize();
665 673 #endif
666 674 extern gid_t getegid();
667 675 extern uid_t geteuid();
668 676 extern gid_t getgid();
669 677 extern int getgroups();
670 678 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
671 679 extern long gethostid();
672 680 #endif
673 681 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
674 682 extern int gethostname();
675 683 #endif
676 684 extern char *getlogin();
677 685 #if defined(_XPG4) || defined(__EXTENSIONS__)
678 686 extern int getopt();
679 687 extern char *optarg;
680 688 extern int opterr, optind, optopt;
681 689 #if !defined(_XPG6) || defined(__EXTENSIONS__)
682 690 extern char *getpass();
683 691 #endif
684 692 #endif /* defined(_XPG4) || defined(__EXTENSIONS__) */
685 693 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
686 694 #if !defined(_XPG6) || defined(__EXTENSIONS__)
687 695 extern int getpagesize();
688 696 #endif
689 697 extern pid_t getpgid();
690 698 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
691 699 extern pid_t getpid();
692 700 extern pid_t getppid();
693 701 extern pid_t getpgrp();
694 702 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
695 703 char *gettxt();
696 704 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
697 705 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
698 706 extern pid_t getsid();
699 707 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) */
700 708 extern uid_t getuid();
701 709 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
702 710 extern char *getusershell();
703 711 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
704 712 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
705 713 extern char *getwd();
706 714 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
707 715 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
708 716 extern int ioctl();
709 717 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
710 718 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
711 719 extern int isaexec();
712 720 extern int issetugid();
713 721 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
714 722 extern int isatty();
715 723 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
716 724 extern int lchown();
717 725 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) */
718 726 extern int link();
719 727 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
720 728 extern offset_t llseek();
721 729 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
722 730 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || \
723 731 (defined(_LARGEFILE_SOURCE) && _FILE_OFFSET_BITS == 64) || \
724 732 defined(__EXTENSIONS__)
725 733 extern int lockf();
726 734 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
727 735 extern off_t lseek();
728 736 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
729 737 extern int mincore();
730 738 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
731 739 #if !defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \
732 740 defined(__EXTENSIONS__)
733 741 extern int nice();
734 742 #endif /* !defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)... */
735 743 extern long pathconf();
736 744 extern int pause();
737 745 extern int pipe();
738 746 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG5) || \
739 747 (defined(_LARGEFILE_SOURCE) && _FILE_OFFSET_BITS == 64) || \
740 748 defined(__EXTENSIONS__)
741 749 extern ssize_t pread();
742 750 #endif
743 751 #if !defined(_LP64) && \
744 752 (!defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__))
745 753 extern void profil();
746 754 extern int ptrace();
747 755 #endif
748 756 #if !defined(__XOPEN_OR_POSIX) || \
749 757 ((_POSIX_C_SOURCE > 2) && !defined(_XPG6)) || \
750 758 defined(__EXTENSIONS__)
751 759 extern int pthread_atfork();
752 760 #endif /* !defined(__XOPEN_OR_POSIX) || ((_POSIX_C_SOURCE > 2) ... */
753 761 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG5) || \
754 762 (defined(_LARGEFILE_SOURCE) && _FILE_OFFSET_BITS == 64) || \
755 763 defined(__EXTENSIONS__)
756 764 extern ssize_t pwrite();
757 765 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG5) */
758 766 extern ssize_t read();
759 767 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
760 768 /* per RFC 3542; This is also defined in netdb.h */
761 769 extern int rcmd_af();
762 770 #endif
763 771 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
764 772 extern ssize_t readlink();
765 773 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
766 774 #if (!defined(__XOPEN_OR_POSIX) || (defined(_XPG3) && !defined(_XPG4))) || \
767 775 defined(__EXTENSIONS__)
768 776 extern int rename();
769 777 #endif /* (!defined(__XOPEN_OR_POSIX) || (defined(_XPG3)... */
770 778 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
771 779 extern int resolvepath();
772 780 /* per RFC 3542; This is also defined in netdb.h */
773 781 extern int rexec_af();
774 782 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
775 783 extern int rmdir();
776 784 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
777 785 /* per RFC 3542; This is also defined in netdb.h */
778 786 extern int rresvport_af();
779 787 #endif
780 788 #if !defined(__XOPEN_OR_POSIX) || (defined(_XPG4_2) && !defined(_XPG6)) || \
781 789 defined(__EXTENSIONS__)
782 790 extern void *sbrk();
783 791 #endif /* !defined(__XOPEN_OR_POSIX)|| (defined(_XPG4_2)... */
784 792 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || defined(__EXTENSIONS__)
785 793 extern int setegid();
786 794 extern int seteuid();
787 795 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG6) ... */
788 796 extern int setgid();
789 797 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
790 798 extern int setgroups();
791 799 extern int sethostname();
792 800 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
793 801 extern int setpgid();
794 802 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
795 803 extern pid_t setpgrp();
796 804 extern int setregid();
797 805 extern int setreuid();
798 806 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
799 807 extern pid_t setsid();
800 808 extern int setuid();
801 809 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
802 810 extern void setusershell();
803 811 #endif /* !defined(__XOPEN_OR_POSIX)|| defined(__EXTENSIONS__) */
804 812 extern unsigned sleep();
805 813 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
806 814 extern int stime();
807 815 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
808 816 #if defined(_XPG4)
809 817 /* __EXTENSIONS__ makes the SVID Third Edition prototype in stdlib.h visible */
810 818 extern void swab();
811 819 #endif /* defined(_XPG4) */
812 820 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
813 821 extern int symlink();
814 822 extern void sync();
815 823 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
816 824 #if defined(_XPG5)
817 825 #ifdef __PRAGMA_REDEFINE_EXTNAME
818 826 #pragma redefine_extname sysconf __sysconf_xpg5
819 827 extern long sysconf();
820 828 #else /* __PRAGMA_REDEFINE_EXTNAME */
821 829 extern long __sysconf_xpg5();
822 830 #define sysconf __sysconf_xpg5
823 831 #endif /* __PRAGMA_REDEFINE_EXTNAME */
824 832 #endif /* defined(_XPG5) */
825 833 extern pid_t tcgetpgrp();
826 834 extern int tcsetpgrp();
827 835 #if !defined(__XOPEN_OR_POSIX) || \
828 836 (defined(_LARGEFILE_SOURCE) && _FILE_OFFSET_BITS == 64) || \
829 837 defined(__EXTENSIONS__)
830 838 extern off_t tell();
831 839 #endif /* !defined(__XOPEN_OR_POSIX)... */
832 840 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || \
833 841 (defined(_LARGEFILE_SOURCE) && _FILE_OFFSET_BITS == 64) || \
834 842 defined(__EXTENSIONS__)
835 843 extern int truncate();
836 844 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
837 845 extern char *ttyname();
838 846 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
839 847 extern useconds_t ualarm();
840 848 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
841 849 extern int unlink();
842 850 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
843 851 extern int usleep();
844 852 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
845 853 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
846 854 extern pid_t vfork();
847 855 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
848 856 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
849 857 extern void vhangup();
850 858 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
851 859 extern ssize_t write();
852 860 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
853 861 extern void yield();
854 862 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
855 863
856 864 #if !defined(__XOPEN_OR_POSIX) || defined(_ATFILE_SOURCE) || \
857 865 defined(__EXTENSIONS__)
858 866 /* || defined(_XPG7) */
859 867 extern int faccessat();
860 868 extern int fchownat();
861 869 extern int linkat();
862 870 extern ssize_t readlinkat();
863 871 extern int renameat();
864 872 extern int symlinkat();
865 873 extern int unlinkat();
866 874 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_ATFILE_SOURCE)... */
867 875 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
868 876 extern int get_nprocs();
869 877 extern int get_nprocs_conf();
870 878 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
871 879
872 880 /* transitional large file interface versions */
873 881 #if defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
874 882 !defined(__PRAGMA_REDEFINE_EXTNAME))
875 883 extern int ftruncate64();
876 884 extern off64_t lseek64();
877 885 extern ssize_t pread64();
878 886 extern ssize_t pwrite64();
879 887 extern off64_t tell64();
880 888 extern int truncate64();
881 889 extern int lockf64();
882 890 #endif /* _LARGEFILE64_SOURCE */
883 891
884 892 #endif /* __STDC__ */
885 893
886 894 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
887 895 #pragma unknown_control_flow(vfork)
888 896 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
889 897
890 898 /*
891 899 * getlogin_r() & ttyname_r() prototypes are defined here.
892 900 */
893 901
894 902 /*
895 903 * Previous releases of Solaris, starting at 2.3, provided definitions of
896 904 * various functions as specified in POSIX.1c, Draft 6. For some of these
897 905 * functions, the final POSIX 1003.1c standard had a different number of
898 906 * arguments and return values.
899 907 *
900 908 * The following segment of this header provides support for the standard
901 909 * interfaces while supporting applications written under earlier
902 910 * releases. The application defines appropriate values of the feature
903 911 * test macros _POSIX_C_SOURCE and _POSIX_PTHREAD_SEMANTICS to indicate
904 912 * whether it was written to expect the Draft 6 or standard versions of
905 913 * these interfaces, before including this header. This header then
906 914 * provides a mapping from the source version of the interface to an
907 915 * appropriate binary interface. Such mappings permit an application
908 916 * to be built from libraries and objects which have mixed expectations
909 917 * of the definitions of these functions.
910 918 *
911 919 * For applications using the Draft 6 definitions, the binary symbol is the
912 920 * same as the source symbol, and no explicit mapping is needed. For the
913 921 * standard interface, the function func() is mapped to the binary symbol
914 922 * _posix_func(). The preferred mechanism for the remapping is a compiler
915 923 * #pragma. If the compiler does not provide such a #pragma, the header file
916 924 * defines a static function func() which calls the _posix_func() version;
917 925 * this has to be done instead of #define since POSIX specifies that an
918 926 * application can #undef the symbol and still be bound to the correct
919 927 * implementation. Unfortunately, the statics confuse lint so we fallback to
920 928 * #define in that case.
921 929 *
922 930 * NOTE: Support for the Draft 6 definitions is provided for compatibility
923 931 * only. New applications/libraries should use the standard definitions.
924 932 */
925 933
926 934 #if defined(__EXTENSIONS__) || defined(_REENTRANT) || \
927 935 !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE - 0 >= 199506L) || \
928 936 defined(_POSIX_PTHREAD_SEMANTICS)
929 937
930 938 #if defined(__STDC__)
931 939
932 940 #if (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
933 941
934 942 #ifdef __PRAGMA_REDEFINE_EXTNAME
935 943 #pragma redefine_extname getlogin_r __posix_getlogin_r
936 944 #pragma redefine_extname ttyname_r __posix_ttyname_r
937 945 extern int getlogin_r(char *, int);
938 946 extern int ttyname_r(int, char *, size_t);
939 947 #else /* __PRAGMA_REDEFINE_EXTNAME */
940 948
941 949 extern int __posix_getlogin_r(char *, int);
942 950 extern int __posix_ttyname_r(int, char *, size_t);
943 951
944 952 #ifdef __lint
945 953
946 954 #define getlogin_r __posix_getlogin_r
947 955 #define ttyname_r __posix_ttyname_r
948 956
949 957 #else /* !__lint */
950 958
951 959 static int
952 960 getlogin_r(char *__name, int __len)
953 961 {
954 962 return (__posix_getlogin_r(__name, __len));
955 963 }
956 964 static int
957 965 ttyname_r(int __fildes, char *__buf, size_t __size)
958 966 {
959 967 return (__posix_ttyname_r(__fildes, __buf, __size));
960 968 }
961 969
962 970 #endif /* !__lint */
963 971 #endif /* __PRAGMA_REDEFINE_EXTNAME */
964 972
965 973 #else /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
966 974
967 975 extern char *getlogin_r(char *, int);
968 976 extern char *ttyname_r(int, char *, int);
969 977
970 978 #endif /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
971 979
972 980 #else /* __STDC__ */
973 981
974 982 #if (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
975 983
976 984 #ifdef __PRAGMA_REDEFINE_EXTNAME
977 985 #pragma redefine_extname getlogin_r __posix_getlogin_r
978 986 #pragma redefine_extname ttyname_r __posix_ttyname_r
979 987 extern int getlogin_r();
980 988 extern int ttyname_r();
981 989 #else /* __PRAGMA_REDEFINE_EXTNAME */
982 990
983 991 extern int __posix_getlogin_r();
984 992 extern int __posix_ttyname_r();
985 993
986 994 #ifdef __lint
987 995
988 996 #define getlogin_r __posix_getlogin_r
989 997 #define ttyname_r __posix_ttyname_r
990 998
991 999 #else /* !__lint */
992 1000
993 1001 static int
994 1002 getlogin_r(__name, __len)
995 1003 char *__name;
996 1004 int __len;
997 1005 {
998 1006 return (__posix_getlogin_r(__name, __len));
999 1007 }
1000 1008 static int
1001 1009 ttyname_r(__fildes, __buf, __size)
1002 1010 int __fildes;
1003 1011 char *__buf;
1004 1012 size_t __size;
1005 1013 {
1006 1014 return (__posix_ttyname_r(__fildes, __buf, __size));
1007 1015 }
1008 1016 #endif /* !__lint */
1009 1017 #endif /* __PRAGMA_REDEFINE_EXTNAME */
1010 1018
1011 1019 #else /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
1012 1020
1013 1021 extern char *getlogin_r();
1014 1022 extern char *ttyname_r();
1015 1023
1016 1024 #endif /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
1017 1025
1018 1026 #endif /* __STDC__ */
1019 1027
1020 1028 #endif /* defined(__EXTENSIONS__) || defined(_REENTRANT)... */
1021 1029
1022 1030 #ifdef __cplusplus
1023 1031 }
1024 1032 #endif
1025 1033
1026 1034 #endif /* _UNISTD_H */
↓ open down ↓ |
552 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX