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