| 1 | /*	$OpenBSD: unistd.h,v 1.113 2025/10/07 12:02:21 brynet Exp $ */ |
| 2 | /*	$NetBSD: unistd.h,v 1.26.4.1 1996/05/28 02:31:51 mrg Exp $	*/ |
| 3 | |
| 4 | /*- |
| 5 | * Copyright (c) 1991 The Regents of the University of California. |
| 6 | * All rights reserved. |
| 7 | * |
| 8 | * Redistribution and use in source and binary forms, with or without |
| 9 | * modification, are permitted provided that the following conditions |
| 10 | * are met: |
| 11 | * 1. Redistributions of source code must retain the above copyright |
| 12 | * notice, this list of conditions and the following disclaimer. |
| 13 | * 2. Redistributions in binary form must reproduce the above copyright |
| 14 | * notice, this list of conditions and the following disclaimer in the |
| 15 | * documentation and/or other materials provided with the distribution. |
| 16 | * 3. Neither the name of the University nor the names of its contributors |
| 17 | * may be used to endorse or promote products derived from this software |
| 18 | * without specific prior written permission. |
| 19 | * |
| 20 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND |
| 21 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 23 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
| 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
| 26 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 27 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 28 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
| 29 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 30 | * SUCH DAMAGE. |
| 31 | * |
| 32 | *	@(#)unistd.h	5.13 (Berkeley) 6/17/91 |
| 33 | */ |
| 34 | |
| 35 | #ifndef _UNISTD_H_ |
| 36 | #define	_UNISTD_H_ |
| 37 | |
| 38 | #include <sys/_null.h> |
| 39 | #include <sys/types.h> |
| 40 | #include <sys/unistd.h> |
| 41 | |
| 42 | #define	STDIN_FILENO	0	/* standard input file descriptor */ |
| 43 | #define	STDOUT_FILENO	1	/* standard output file descriptor */ |
| 44 | #define	STDERR_FILENO	2	/* standard error file descriptor */ |
| 45 | |
| 46 | #if __XPG_VISIBLE || __POSIX_VISIBLE >= 200112 |
| 47 | #define F_ULOCK 0	/* unlock locked section */ |
| 48 | #define F_LOCK 1	/* lock a section for exclusive use */ |
| 49 | #define F_TLOCK 2	/* test and lock a section for exclusive use */ |
| 50 | #define F_TEST 3	/* test a section for locks by other procs */ |
| 51 | #endif |
| 52 | |
| 53 | /* |
| 54 | * POSIX options and option groups we unconditionally do or don't |
| 55 | * implement. Please keep this list in alphabetical order. |
| 56 | * |
| 57 | * Anything which is defined as zero below **must** have an |
| 58 | * implementation for the corresponding sysconf() which is able to |
| 59 | * determine conclusively whether or not the feature is supported. |
| 60 | * Anything which is defined as other than -1 below **must** have |
| 61 | * complete headers, types, and function declarations as specified by |
| 62 | * the POSIX standard; however, if the relevant sysconf() function |
| 63 | * returns -1, the functions may be stubbed out. |
| 64 | */ |
| 65 | #define _POSIX_ADVISORY_INFO			(-1) |
| 66 | #define _POSIX_ASYNCHRONOUS_IO			(-1) |
| 67 | #define _POSIX_BARRIERS				200112L |
| 68 | #define _POSIX_CHOWN_RESTRICTED			1 |
| 69 | #define _POSIX_CLOCK_SELECTION			(-1) |
| 70 | #define _POSIX_CPUTIME				200809L |
| 71 | #define _POSIX_FSYNC				200112L |
| 72 | #define _POSIX_IPV6				0 |
| 73 | #define _POSIX_JOB_CONTROL			1 |
| 74 | #define _POSIX_MAPPED_FILES			200112L |
| 75 | #define _POSIX_MEMLOCK				200112L |
| 76 | #define _POSIX_MEMLOCK_RANGE			200112L |
| 77 | #define _POSIX_MEMORY_PROTECTION		200112L |
| 78 | #define _POSIX_MESSAGE_PASSING			(-1) |
| 79 | #define _POSIX_MONOTONIC_CLOCK			200112L |
| 80 | #define _POSIX_NO_TRUNC				1 |
| 81 | #define _POSIX_PRIORITIZED_IO			(-1) |
| 82 | #define _POSIX_PRIORITY_SCHEDULING		(-1) |
| 83 | #define _POSIX_RAW_SOCKETS			200112L |
| 84 | #define _POSIX_READER_WRITER_LOCKS		200112L |
| 85 | #define _POSIX_REALTIME_SIGNALS			(-1) |
| 86 | #define _POSIX_REGEXP				1 |
| 87 | #define _POSIX_SAVED_IDS			1 |
| 88 | #define _POSIX_SEMAPHORES			200112L |
| 89 | #define _POSIX_SHARED_MEMORY_OBJECTS		200809L |
| 90 | #define _POSIX_SHELL				1 |
| 91 | #define _POSIX_SPAWN				200112L |
| 92 | #define _POSIX_SPIN_LOCKS			200112L |
| 93 | #define _POSIX_SPORADIC_SERVER			(-1) |
| 94 | #define _POSIX_SYNCHRONIZED_IO			(-1) |
| 95 | #define _POSIX_THREAD_ATTR_STACKADDR		200112L |
| 96 | #define _POSIX_THREAD_ATTR_STACKSIZE		200112L |
| 97 | #define _POSIX_THREAD_CPUTIME			200809L |
| 98 | #define _POSIX_THREAD_PRIO_INHERIT		(-1) |
| 99 | #define _POSIX_THREAD_PRIO_PROTECT		(-1) |
| 100 | #define _POSIX_THREAD_PRIORITY_SCHEDULING	(-1) |
| 101 | #define _POSIX_THREAD_PROCESS_SHARED		(-1) |
| 102 | #define _POSIX_THREAD_ROBUST_PRIO_INHERIT	(-1) |
| 103 | #define _POSIX_THREAD_ROBUST_PRIO_PROTECT	(-1) |
| 104 | #define _POSIX_THREAD_SAFE_FUNCTIONS		200112L |
| 105 | #define _POSIX_THREAD_SPORADIC_SERVER		(-1) |
| 106 | #define _POSIX_THREADS				200112L |
| 107 | #define _POSIX_TIMEOUTS				200112L |
| 108 | #define _POSIX_TIMERS				(-1) |
| 109 | #define _POSIX_TRACE				(-1) |
| 110 | #define _POSIX_TRACE_EVENT_FILTER		(-1) |
| 111 | #define _POSIX_TRACE_INHERIT			(-1) |
| 112 | #define _POSIX_TRACE_LOG			(-1) |
| 113 | #define _POSIX_TYPED_MEMORY_OBJECTS		(-1) |
| 114 | #define _POSIX2_C_BIND				200112L |
| 115 | #define _POSIX2_C_DEV				(-1) /* need C99 utility */ |
| 116 | #define _POSIX2_CHAR_TERM			1 |
| 117 | #define _POSIX2_FORT_DEV			(-1) /* need fort77 utility */ |
| 118 | #define _POSIX2_FORT_RUN			(-1) /* need asa utility */ |
| 119 | #define _POSIX2_LOCALEDEF			(-1) |
| 120 | #define _POSIX2_PBS				(-1) |
| 121 | #define _POSIX2_PBS_ACCOUNTING			(-1) |
| 122 | #define _POSIX2_PBS_CHECKPOINT			(-1) |
| 123 | #define _POSIX2_PBS_LOCATE			(-1) |
| 124 | #define _POSIX2_PBS_MESSAGE			(-1) |
| 125 | #define _POSIX2_PBS_TRACK			(-1) |
| 126 | #define _POSIX2_SW_DEV				200112L |
| 127 | #define _POSIX2_UPE				200112L |
| 128 | #define _POSIX_V6_ILP32_OFF32			(-1) |
| 129 | #define _POSIX_V6_ILP32_OFFBIG			0 |
| 130 | #define _POSIX_V6_LP64_OFF64			0 |
| 131 | #define _POSIX_V6_LPBIG_OFFBIG			0 |
| 132 | #define _POSIX_V7_ILP32_OFF32			(-1) |
| 133 | #define _POSIX_V7_ILP32_OFFBIG			0 |
| 134 | #define _POSIX_V7_LP64_OFF64			0 |
| 135 | #define _POSIX_V7_LPBIG_OFFBIG			0 |
| 136 | |
| 137 | #define _XOPEN_CRYPT				1 |
| 138 | #define _XOPEN_ENH_I18N				(-1) /* mandatory in XSI */ |
| 139 | #define _XOPEN_LEGACY				(-1) |
| 140 | #define _XOPEN_REALTIME				(-1) |
| 141 | #define _XOPEN_REALTIME_THREADS			(-1) |
| 142 | #define _XOPEN_SHM				1 |
| 143 | #define _XOPEN_STREAMS				(-1) |
| 144 | #define _XOPEN_UUCP				(-1) |
| 145 | #define _XOPEN_UNIX				(-1) |
| 146 | |
| 147 | /* Define the POSIX.2 version we target for compliance. */ |
| 148 | #define _POSIX2_VERSION				200809L |
| 149 | |
| 150 | /* the sysconf(3) variable values are part of the ABI */ |
| 151 | |
| 152 | /* configurable system variables */ |
| 153 | #define	_SC_ARG_MAX		 1 |
| 154 | #define	_SC_CHILD_MAX		 2 |
| 155 | #define	_SC_CLK_TCK		 3 |
| 156 | #define	_SC_NGROUPS_MAX		 4 |
| 157 | #define	_SC_OPEN_MAX		 5 |
| 158 | #define	_SC_JOB_CONTROL		 6 |
| 159 | #define	_SC_SAVED_IDS		 7 |
| 160 | #define	_SC_VERSION		 8 |
| 161 | #define	_SC_BC_BASE_MAX		 9 |
| 162 | #define	_SC_BC_DIM_MAX		10 |
| 163 | #define	_SC_BC_SCALE_MAX	11 |
| 164 | #define	_SC_BC_STRING_MAX	12 |
| 165 | #define	_SC_COLL_WEIGHTS_MAX	13 |
| 166 | #define	_SC_EXPR_NEST_MAX	14 |
| 167 | #define	_SC_LINE_MAX		15 |
| 168 | #define	_SC_RE_DUP_MAX		16 |
| 169 | #define	_SC_2_VERSION		17 |
| 170 | #define	_SC_2_C_BIND		18 |
| 171 | #define	_SC_2_C_DEV		19 |
| 172 | #define	_SC_2_CHAR_TERM		20 |
| 173 | #define	_SC_2_FORT_DEV		21 |
| 174 | #define	_SC_2_FORT_RUN		22 |
| 175 | #define	_SC_2_LOCALEDEF		23 |
| 176 | #define	_SC_2_SW_DEV		24 |
| 177 | #define	_SC_2_UPE		25 |
| 178 | #define	_SC_STREAM_MAX		26 |
| 179 | #define	_SC_TZNAME_MAX		27 |
| 180 | #define	_SC_PAGESIZE		28 |
| 181 | #define	_SC_PAGE_SIZE		_SC_PAGESIZE	/* 1170 compatibility */ |
| 182 | #define	_SC_FSYNC		29 |
| 183 | #define	_SC_XOPEN_SHM		30 |
| 184 | #define	_SC_SEM_NSEMS_MAX	31 |
| 185 | #define	_SC_SEM_VALUE_MAX	32 |
| 186 | #define	_SC_HOST_NAME_MAX	33 |
| 187 | #define	_SC_MONOTONIC_CLOCK	34 |
| 188 | #define	_SC_2_PBS		35 |
| 189 | #define	_SC_2_PBS_ACCOUNTING	36 |
| 190 | #define	_SC_2_PBS_CHECKPOINT	37 |
| 191 | #define	_SC_2_PBS_LOCATE	38 |
| 192 | #define	_SC_2_PBS_MESSAGE	39 |
| 193 | #define	_SC_2_PBS_TRACK		40 |
| 194 | #define	_SC_ADVISORY_INFO	41 |
| 195 | #define	_SC_AIO_LISTIO_MAX	42 |
| 196 | #define	_SC_AIO_MAX		43 |
| 197 | #define	_SC_AIO_PRIO_DELTA_MAX	44 |
| 198 | #define	_SC_ASYNCHRONOUS_IO	45 |
| 199 | #define	_SC_ATEXIT_MAX		46 |
| 200 | #define	_SC_BARRIERS		47 |
| 201 | #define	_SC_CLOCK_SELECTION	48 |
| 202 | #define	_SC_CPUTIME		49 |
| 203 | #define	_SC_DELAYTIMER_MAX	50 |
| 204 | #define	_SC_IOV_MAX		51 |
| 205 | #define	_SC_IPV6		52 |
| 206 | #define	_SC_MAPPED_FILES	53 |
| 207 | #define	_SC_MEMLOCK		54 |
| 208 | #define	_SC_MEMLOCK_RANGE	55 |
| 209 | #define	_SC_MEMORY_PROTECTION	56 |
| 210 | #define	_SC_MESSAGE_PASSING	57 |
| 211 | #define	_SC_MQ_OPEN_MAX		58 |
| 212 | #define	_SC_MQ_PRIO_MAX		59 |
| 213 | #define	_SC_PRIORITIZED_IO	60 |
| 214 | #define	_SC_PRIORITY_SCHEDULING	61 |
| 215 | #define	_SC_RAW_SOCKETS		62 |
| 216 | #define	_SC_READER_WRITER_LOCKS	63 |
| 217 | #define	_SC_REALTIME_SIGNALS	64 |
| 218 | #define	_SC_REGEXP		65 |
| 219 | #define	_SC_RTSIG_MAX		66 |
| 220 | #define	_SC_SEMAPHORES		67 |
| 221 | #define	_SC_SHARED_MEMORY_OBJECTS 68 |
| 222 | #define	_SC_SHELL		69 |
| 223 | #define	_SC_SIGQUEUE_MAX	70 |
| 224 | #define	_SC_SPAWN		71 |
| 225 | #define	_SC_SPIN_LOCKS		72 |
| 226 | #define	_SC_SPORADIC_SERVER	73 |
| 227 | #define	_SC_SS_REPL_MAX		74 |
| 228 | #define	_SC_SYNCHRONIZED_IO	75 |
| 229 | #define	_SC_SYMLOOP_MAX		76 |
| 230 | #define	_SC_THREAD_ATTR_STACKADDR 77 |
| 231 | #define	_SC_THREAD_ATTR_STACKSIZE 78 |
| 232 | #define	_SC_THREAD_CPUTIME	79 |
| 233 | #define	_SC_THREAD_DESTRUCTOR_ITERATIONS 80 |
| 234 | #define	_SC_THREAD_KEYS_MAX	81 |
| 235 | #define	_SC_THREAD_PRIO_INHERIT	82 |
| 236 | #define	_SC_THREAD_PRIO_PROTECT	83 |
| 237 | #define	_SC_THREAD_PRIORITY_SCHEDULING 84 |
| 238 | #define	_SC_THREAD_PROCESS_SHARED 85 |
| 239 | #define	_SC_THREAD_ROBUST_PRIO_INHERIT 86 |
| 240 | #define	_SC_THREAD_ROBUST_PRIO_PROTECT 87 |
| 241 | #define	_SC_THREAD_SPORADIC_SERVER 88 |
| 242 | #define	_SC_THREAD_STACK_MIN	89 |
| 243 | #define	_SC_THREAD_THREADS_MAX	90 |
| 244 | #define	_SC_THREADS		91 |
| 245 | #define	_SC_TIMEOUTS		92 |
| 246 | #define	_SC_TIMER_MAX		93 |
| 247 | #define	_SC_TIMERS		94 |
| 248 | #define	_SC_TRACE		95 |
| 249 | #define	_SC_TRACE_EVENT_FILTER	96 |
| 250 | #define	_SC_TRACE_EVENT_NAME_MAX 97 |
| 251 | #define	_SC_TRACE_INHERIT	98 |
| 252 | #define	_SC_TRACE_LOG		99 |
| 253 | #define	_SC_GETGR_R_SIZE_MAX	100 |
| 254 | #define	_SC_GETPW_R_SIZE_MAX	101 |
| 255 | #define	_SC_LOGIN_NAME_MAX	102 |
| 256 | #define	_SC_THREAD_SAFE_FUNCTIONS 103 |
| 257 | #define	_SC_TRACE_NAME_MAX 104 |
| 258 | #define	_SC_TRACE_SYS_MAX 105 |
| 259 | #define	_SC_TRACE_USER_EVENT_MAX 106 |
| 260 | #define	_SC_TTY_NAME_MAX	107 |
| 261 | #define	_SC_TYPED_MEMORY_OBJECTS 108 |
| 262 | #define	_SC_V6_ILP32_OFF32	109 |
| 263 | #define	_SC_V6_ILP32_OFFBIG	110 |
| 264 | #define	_SC_V6_LP64_OFF64	111 |
| 265 | #define	_SC_V6_LPBIG_OFFBIG	112 |
| 266 | #define	_SC_V7_ILP32_OFF32	113 |
| 267 | #define	_SC_V7_ILP32_OFFBIG	114 |
| 268 | #define	_SC_V7_LP64_OFF64	115 |
| 269 | #define	_SC_V7_LPBIG_OFFBIG	116 |
| 270 | #define	_SC_XOPEN_CRYPT		117 |
| 271 | #define	_SC_XOPEN_ENH_I18N	118 |
| 272 | #define	_SC_XOPEN_LEGACY	119 |
| 273 | #define	_SC_XOPEN_REALTIME	120 |
| 274 | #define	_SC_XOPEN_REALTIME_THREADS 121 |
| 275 | #define	_SC_XOPEN_STREAMS	122 |
| 276 | #define	_SC_XOPEN_UNIX		123 |
| 277 | #define	_SC_XOPEN_UUCP		124 |
| 278 | #define	_SC_XOPEN_VERSION	125 |
| 279 | |
| 280 | #define	_SC_PHYS_PAGES		500 |
| 281 | #define	_SC_AVPHYS_PAGES	501 |
| 282 | #define	_SC_NPROCESSORS_CONF	502 |
| 283 | #define	_SC_NPROCESSORS_ONLN	503 |
| 284 | |
| 285 | /* configurable system strings */ |
| 286 | #define	_CS_PATH				 1 |
| 287 | #define	_CS_POSIX_V6_ILP32_OFF32_CFLAGS		 2 |
| 288 | #define	_CS_POSIX_V6_ILP32_OFF32_LDFLAGS	 3 |
| 289 | #define	_CS_POSIX_V6_ILP32_OFF32_LIBS		 4 |
| 290 | #define	_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS	 5 |
| 291 | #define	_CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS	 6 |
| 292 | #define	_CS_POSIX_V6_ILP32_OFFBIG_LIBS		 7 |
| 293 | #define	_CS_POSIX_V6_LP64_OFF64_CFLAGS		 8 |
| 294 | #define	_CS_POSIX_V6_LP64_OFF64_LDFLAGS		 9 |
| 295 | #define	_CS_POSIX_V6_LP64_OFF64_LIBS		10 |
| 296 | #define	_CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS	11 |
| 297 | #define	_CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS	12 |
| 298 | #define	_CS_POSIX_V6_LPBIG_OFFBIG_LIBS		13 |
| 299 | #define	_CS_POSIX_V6_WIDTH_RESTRICTED_ENVS	14 |
| 300 | #define	_CS_V6_ENV				15 |
| 301 | #define	_CS_POSIX_V7_ILP32_OFF32_CFLAGS		16 |
| 302 | #define	_CS_POSIX_V7_ILP32_OFF32_LDFLAGS	17 |
| 303 | #define	_CS_POSIX_V7_ILP32_OFF32_LIBS		18 |
| 304 | #define	_CS_POSIX_V7_ILP32_OFFBIG_CFLAGS	19 |
| 305 | #define	_CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS	20 |
| 306 | #define	_CS_POSIX_V7_ILP32_OFFBIG_LIBS		21 |
| 307 | #define	_CS_POSIX_V7_LP64_OFF64_CFLAGS		22 |
| 308 | #define	_CS_POSIX_V7_LP64_OFF64_LDFLAGS		23 |
| 309 | #define	_CS_POSIX_V7_LP64_OFF64_LIBS		24 |
| 310 | #define	_CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS	25 |
| 311 | #define	_CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS	26 |
| 312 | #define	_CS_POSIX_V7_LPBIG_OFFBIG_LIBS		27 |
| 313 | #define	_CS_POSIX_V7_THREADS_CFLAGS		28 |
| 314 | #define	_CS_POSIX_V7_THREADS_LDFLAGS		29 |
| 315 | #define	_CS_POSIX_V7_WIDTH_RESTRICTED_ENVS	30 |
| 316 | #define	_CS_V7_ENV				31 |
| 317 | |
| 318 | #ifndef	_INTPTR_T_DEFINED_ |
| 319 | #define	_INTPTR_T_DEFINED_ |
| 320 | typedef	__intptr_t		intptr_t; |
| 321 | #endif |
| 322 | |
| 323 | __BEGIN_DECLS |
| 324 | __dead void	 _exit(int); |
| 325 | int	 access(const char *, int); |
| 326 | unsigned int alarm(unsigned int); |
| 327 | int	 chdir(const char *); |
| 328 | int	 chown(const char *, uid_t, gid_t); |
| 329 | int	 close(int); |
| 330 | int	 dup(int); |
| 331 | int	 dup2(int, int); |
| 332 | int	 execl(const char *, const char *, ...) |
| 333 | 	 __attribute__((__sentinel__)); |
| 334 | int	 execle(const char *, const char *, ...); |
| 335 | int	 execlp(const char *, const char *, ...) |
| 336 | 	 __attribute__((__sentinel__)); |
| 337 | int	 execv(const char *, char *const *); |
| 338 | int	 execve(const char *, char *const *, char *const *); |
| 339 | int	 execvp(const char *, char *const *); |
| 340 | #if __BSD_VISIBLE |
| 341 | int	 execvpe(const char *, char *const *, char *const *); |
| 342 | #endif |
| 343 | pid_t	 fork(void); |
| 344 | long	 fpathconf(int, int); |
| 345 | char	*getcwd(char *, size_t) |
| 346 | 		__attribute__((__bounded__(__string__,1,2))); |
| 347 | gid_t	 getegid(void); |
| 348 | uid_t	 geteuid(void); |
| 349 | gid_t	 getgid(void); |
| 350 | int	 getgroups(int, gid_t *); |
| 351 | char	*getlogin(void); |
| 352 | pid_t	 getpgrp(void); |
| 353 | pid_t	 getpid(void); |
| 354 | pid_t	 getppid(void); |
| 355 | uid_t	 getuid(void); |
| 356 | int	 isatty(int); |
| 357 | int	 link(const char *, const char *); |
| 358 | off_t	 lseek(int, off_t, int); |
| 359 | long	 pathconf(const char *, int); |
| 360 | #if __BSD_VISIBLE |
| 361 | long	 pathconfat(int, const char *, int, int); |
| 362 | #endif |
| 363 | int	 pause(void); |
| 364 | int	 pipe(int *); |
| 365 | ssize_t	 read(int, void *, size_t) |
| 366 | 		__attribute__((__bounded__(__buffer__,2,3))); |
| 367 | int	 rmdir(const char *); |
| 368 | int	 setgid(gid_t); |
| 369 | int	 setuid(uid_t); |
| 370 | unsigned int sleep(unsigned int); |
| 371 | long	 sysconf(int); |
| 372 | pid_t	 tcgetpgrp(int); |
| 373 | int	 tcsetpgrp(int, pid_t); |
| 374 | char	*ttyname(int); |
| 375 | int	 unlink(const char *); |
| 376 | ssize_t	 write(int, const void *, size_t) |
| 377 | 		__attribute__((__bounded__(__buffer__,2,3))); |
| 378 | |
| 379 | #if __POSIX_VISIBLE || __XPG_VISIBLE >= 300 |
| 380 | pid_t	 setsid(void); |
| 381 | int	 setpgid(pid_t, pid_t); |
| 382 | #endif |
| 383 | |
| 384 | #if __POSIX_VISIBLE >= 199209 || __XPG_VISIBLE |
| 385 | size_t	 confstr(int, char *, size_t) |
| 386 | 		__attribute__((__bounded__(__string__,2,3))); |
| 387 | #ifndef _GETOPT_DEFINED_ |
| 388 | #define _GETOPT_DEFINED_ |
| 389 | int	 getopt(int, char * const *, const char *); |
| 390 | extern	 char *optarg;			/* getopt(3) external variables */ |
| 391 | extern	 int opterr, optind, optopt, optreset; |
| 392 | #endif /* _GETOPT_DEFINED_ */ |
| 393 | #endif |
| 394 | |
| 395 | #if __POSIX_VISIBLE >= 199506 || __XPG_VISIBLE |
| 396 | int	 fsync(int); |
| 397 | int	 ftruncate(int, off_t); |
| 398 | int	 getlogin_r(char *, size_t) |
| 399 | 		__attribute__((__bounded__(__string__,1,2))); |
| 400 | ssize_t	 readlink(const char * __restrict, char * __restrict, size_t) |
| 401 | 		__attribute__ ((__bounded__(__string__,2,3))); |
| 402 | #endif |
| 403 | #if __POSIX_VISIBLE >= 199506 |
| 404 | int	 fdatasync(int); |
| 405 | #endif |
| 406 | |
| 407 | #if __XPG_VISIBLE || __BSD_VISIBLE |
| 408 | char	*crypt(const char *, const char *); |
| 409 | int	 fchdir(int); |
| 410 | int	 fchown(int, uid_t, gid_t); |
| 411 | long	 gethostid(void); |
| 412 | char	*getwd(char *) |
| 413 | 		__attribute__ ((__bounded__(__minbytes__,1,1024))); |
| 414 | int	 lchown(const char *, uid_t, gid_t); |
| 415 | int	 mkstemp(char *); |
| 416 | char	*mktemp(char *); |
| 417 | int	 nice(int); |
| 418 | int	 setregid(gid_t, gid_t); |
| 419 | int	 setreuid(uid_t, uid_t); |
| 420 | void	 swab(const void *__restrict, void *__restrict, ssize_t); |
| 421 | void	 sync(void); |
| 422 | int	 truncate(const char *, off_t); |
| 423 | useconds_t	 ualarm(useconds_t, useconds_t); |
| 424 | int	 usleep(useconds_t); |
| 425 | pid_t	 vfork(void); |
| 426 | #endif |
| 427 | |
| 428 | #if __POSIX_VISIBLE >= 200809 || __XPG_VISIBLE >= 420 |
| 429 | pid_t	 getpgid(pid_t); |
| 430 | pid_t	 getsid(pid_t); |
| 431 | #endif |
| 432 | |
| 433 | #if __XPG_VISIBLE >= 500 |
| 434 | ssize_t pread(int, void *, size_t, off_t) |
| 435 | 		__attribute__((__bounded__(__buffer__,2,3))); |
| 436 | ssize_t pwrite(int, const void *, size_t, off_t) |
| 437 | 		__attribute__((__bounded__(__buffer__,2,3))); |
| 438 | int	 ttyname_r(int, char *, size_t) |
| 439 | 	 __attribute__((__bounded__(__string__,2,3))); |
| 440 | #endif |
| 441 | |
| 442 | #if __BSD_VISIBLE || __XPG_VISIBLE <= 500 |
| 443 | /* Interfaces withdrawn by X/Open Issue 5 Version 0 */ |
| 444 | int	 brk(void *); |
| 445 | int	 chroot(const char *); |
| 446 | int	 getdtablesize(void); |
| 447 | int	 getpagesize(void); |
| 448 | char	*getpass(const char *); |
| 449 | void	*sbrk(int); |
| 450 | #endif |
| 451 | |
| 452 | #if __POSIX_VISIBLE >= 200112 || __XPG_VISIBLE >= 420 |
| 453 | int lockf(int, int, off_t); |
| 454 | #endif |
| 455 | |
| 456 | #if __POSIX_VISIBLE >= 200112 || __XPG_VISIBLE >= 420 || __BSD_VISIBLE |
| 457 | int	 symlink(const char *, const char *); |
| 458 | int	 gethostname(char *, size_t) |
| 459 | 		__attribute__ ((__bounded__(__string__,1,2))); |
| 460 | int	 setegid(gid_t); |
| 461 | int	 seteuid(uid_t); |
| 462 | #endif |
| 463 | |
| 464 | #if __POSIX_VISIBLE >= 200809 |
| 465 | int	faccessat(int, const char *, int, int); |
| 466 | int	fchownat(int, const char *, uid_t, gid_t, int); |
| 467 | int	linkat(int, const char *, int, const char *, int); |
| 468 | ssize_t	readlinkat(int, const char *, char *, size_t) |
| 469 | 		__attribute__ ((__bounded__(__string__,3,4))); |
| 470 | int	symlinkat(const char *, int, const char *); |
| 471 | int	unlinkat(int, const char *, int); |
| 472 | #endif |
| 473 | |
| 474 | #if __POSIX_VISIBLE >= 202405 || __BSD_VISIBLE |
| 475 | int	getentropy(void *, size_t); |
| 476 | #endif |
| 477 | #if __XPG_VISIBLE >= 800 || __BSD_VISIBLE |
| 478 | int	getresgid(gid_t *, gid_t *, gid_t *); |
| 479 | int	getresuid(uid_t *, uid_t *, uid_t *); |
| 480 | int	setresgid(gid_t, gid_t, gid_t); |
| 481 | int	setresuid(uid_t, uid_t, uid_t); |
| 482 | #endif |
| 483 | |
| 484 | #if __BSD_VISIBLE |
| 485 | int	dup3(int, int, int); |
| 486 | int	pipe2(int [2], int); |
| 487 | #endif |
| 488 | |
| 489 | #if __BSD_VISIBLE |
| 490 | int	 acct(const char *); |
| 491 | int	 closefrom(int); |
| 492 | int	 crypt_checkpass(const char *, const char *); |
| 493 | int	 crypt_newhash(const char *, const char *, char *, size_t); |
| 494 | void	 endusershell(void); |
| 495 | char	*fflagstostr(u_int32_t); |
| 496 | int	 getdomainname(char *, size_t) |
| 497 | 		__attribute__ ((__bounded__(__string__,1,2))); |
| 498 | int	 getdtablecount(void); |
| 499 | int	 getgrouplist(const char *, gid_t, gid_t *, int *); |
| 500 | mode_t	 getmode(const void *, mode_t); |
| 501 | pid_t	 getthrid(void); |
| 502 | int	 getthrname(pid_t, char *, size_t); |
| 503 | char	*getusershell(void); |
| 504 | int	 initgroups(const char *, gid_t); |
| 505 | int	 issetugid(void); |
| 506 | char	*mkdtemp(char *); |
| 507 | int	 mkstemps(char *, int); |
| 508 | int	 nfssvc(int, void *); |
| 509 | int	 profil(void *, size_t, size_t, unsigned long, unsigned int, int) |
| 510 | 		__attribute__ ((__bounded__(__string__,1,2))); |
| 511 | int	 quotactl(const char *, int, int, char *); |
| 512 | int	 rcmd(char **, int, const char *, |
| 513 | 	 const char *, const char *, int *); |
| 514 | int	 rcmd_af(char **, int, const char *, |
| 515 | 	 const char *, const char *, int *, int); |
| 516 | int	 rcmdsh(char **, int, const char *, |
| 517 | 	 const char *, const char *, char *); |
| 518 | int	 reboot(int); |
| 519 | int	 revoke(const char *); |
| 520 | int	 rresvport(int *); |
| 521 | int	 rresvport_af(int *, int); |
| 522 | int	 ruserok(const char *, int, const char *, const char *); |
| 523 | int	 setdomainname(const char *, size_t); |
| 524 | int	 setgroups(int, const gid_t *); |
| 525 | int	 sethostid(long); |
| 526 | int	 sethostname(const char *, size_t); |
| 527 | int	 setlogin(const char *); |
| 528 | void	*setmode(const char *); |
| 529 | int	 setpgrp(pid_t _pid, pid_t _pgrp);	/* BSD compat version */ |
| 530 | int	 setthrname(pid_t, const char *); |
| 531 | void	 setusershell(void); |
| 532 | int	 strtofflags(char **, u_int32_t *, u_int32_t *); |
| 533 | int	 swapctl(int, const void *, int); |
| 534 | int	 pledge(const char *, const char *); |
| 535 | int	 unveil(const char *, const char *); |
| 536 | pid_t	 __tfork_thread(const struct __tfork *, size_t, void (*)(void *), |
| 537 | 	 void *); |
| 538 | #endif /* __BSD_VISIBLE */ |
| 539 | __END_DECLS |
| 540 | |
| 541 | #endif /* !_UNISTD_H_ */ |