199767f8919635c4928607450d9e0abb932109ceToomas Soome * Copyright (c) 1991, 1993, 1994
199767f8919635c4928607450d9e0abb932109ceToomas Soome * The Regents of the University of California. All rights reserved.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Redistribution and use in source and binary forms, with or without
199767f8919635c4928607450d9e0abb932109ceToomas Soome * modification, are permitted provided that the following conditions
199767f8919635c4928607450d9e0abb932109ceToomas Soome * 1. Redistributions of source code must retain the above copyright
199767f8919635c4928607450d9e0abb932109ceToomas Soome * notice, this list of conditions and the following disclaimer.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * 2. Redistributions in binary form must reproduce the above copyright
199767f8919635c4928607450d9e0abb932109ceToomas Soome * notice, this list of conditions and the following disclaimer in the
199767f8919635c4928607450d9e0abb932109ceToomas Soome * documentation and/or other materials provided with the distribution.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * 3. Neither the name of the University nor the names of its contributors
199767f8919635c4928607450d9e0abb932109ceToomas Soome * may be used to endorse or promote products derived from this software
199767f8919635c4928607450d9e0abb932109ceToomas Soome * without specific prior written permission.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
199767f8919635c4928607450d9e0abb932109ceToomas Soome * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
199767f8919635c4928607450d9e0abb932109ceToomas Soome * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
199767f8919635c4928607450d9e0abb932109ceToomas Soome * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
199767f8919635c4928607450d9e0abb932109ceToomas Soome * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
199767f8919635c4928607450d9e0abb932109ceToomas Soome * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
199767f8919635c4928607450d9e0abb932109ceToomas Soome * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
199767f8919635c4928607450d9e0abb932109ceToomas Soome * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
199767f8919635c4928607450d9e0abb932109ceToomas Soome * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
199767f8919635c4928607450d9e0abb932109ceToomas Soome * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
199767f8919635c4928607450d9e0abb932109ceToomas Soome * SUCH DAMAGE.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * @(#)unistd.h 8.12 (Berkeley) 4/27/95
199767f8919635c4928607450d9e0abb932109ceToomas Soome#include <sys/types.h> /* XXX adds too much pollution. */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define STDIN_FILENO 0 /* standard input file descriptor */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define STDOUT_FILENO 1 /* standard output file descriptor */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define STDERR_FILENO 2 /* standard error file descriptor */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define F_LOCK 1 /* lock a section for exclusive use */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define F_TLOCK 2 /* test and lock a section for exclusive use */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define F_TEST 3 /* test a section for locks by other procs */
199767f8919635c4928607450d9e0abb932109ceToomas Soome * POSIX options and option groups we unconditionally do or don't
199767f8919635c4928607450d9e0abb932109ceToomas Soome * implement. This list includes those options which are exclusively
199767f8919635c4928607450d9e0abb932109ceToomas Soome * implemented (or not) in user mode. Please keep this list in
199767f8919635c4928607450d9e0abb932109ceToomas Soome * alphabetical order.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Anything which is defined as zero below **must** have an
199767f8919635c4928607450d9e0abb932109ceToomas Soome * implementation for the corresponding sysconf() which is able to
199767f8919635c4928607450d9e0abb932109ceToomas Soome * determine conclusively whether or not the feature is supported.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Anything which is defined as other than -1 below **must** have
199767f8919635c4928607450d9e0abb932109ceToomas Soome * complete headers, types, and function declarations as specified by
199767f8919635c4928607450d9e0abb932109ceToomas Soome * the POSIX standard; however, if the relevant sysconf() function
199767f8919635c4928607450d9e0abb932109ceToomas Soome * returns -1, the functions may be stubbed out.
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define _POSIX_THREAD_PRIORITY_SCHEDULING 200112L
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define _POSIX2_FORT_DEV -1 /* need fort77 utility */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define _XOPEN_ENH_I18N -1 /* mandatory in XSI */
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* Define the POSIX.2 version we target for compliance. */
199767f8919635c4928607450d9e0abb932109ceToomas Soome * POSIX-style system configuration variable accessors (for the
199767f8919635c4928607450d9e0abb932109ceToomas Soome * sysconf function). The kernel does not directly implement the
199767f8919635c4928607450d9e0abb932109ceToomas Soome * sysconf() interface; rather, a C library stub translates references
199767f8919635c4928607450d9e0abb932109ceToomas Soome * to sysconf() into calls to sysctl() using a giant switch statement.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Those that are marked `user' are implemented entirely in the C
199767f8919635c4928607450d9e0abb932109ceToomas Soome * library and never query the kernel. pathconf() is implemented
199767f8919635c4928607450d9e0abb932109ceToomas Soome * directly by the kernel so those are not defined here.
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define _SC_THREAD_DESTRUCTOR_ITERATIONS 85 /* user */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define _SC_THREAD_PRIORITY_SCHEDULING 89 /* user */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define _SC_THREAD_SPORADIC_SERVER 92 /* user */
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* Extensions found in Solaris and Linux. */
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* Keys for the confstr(3) function. */
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* 1003.1-1990 */
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint access(const char *, int);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeunsigned int alarm(unsigned int);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint chdir(const char *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint dup2(int, int);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint execl(const char *, const char *, ...) __null_sentinel;
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint execle(const char *, const char *, ...);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint execlp(const char *, const char *, ...) __null_sentinel;
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint execv(const char *, char * const *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint execve(const char *, char * const *, char * const *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint execvp(const char *, char * const *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomelong fpathconf(int, int);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint link(const char *, const char *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomelong pathconf(const char *, int);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint rmdir(const char *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeunsigned int sleep(unsigned int);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint unlink(const char *);
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* 1003.2-1992 */
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint getopt(int, char * const [], const char *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeextern char *optarg; /* getopt(3) external variables */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif /* _GETOPT_DECLARED */
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* ISO/IEC 9945-1: 1996 */
199767f8919635c4928607450d9e0abb932109ceToomas Soome * ftruncate() was in the POSIX Realtime Extension (it's used for shared
199767f8919635c4928607450d9e0abb932109ceToomas Soome * memory), but truncate() was not.
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint getlogin_r(char *, int);
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* 1003.1-2001 */
199767f8919635c4928607450d9e0abb932109ceToomas Soomessize_t readlink(const char * __restrict, char * __restrict, size_t);
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* 1003.1-2008 */
199767f8919635c4928607450d9e0abb932109ceToomas Soomessize_t pwrite(int, const void *, size_t, off_t);
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* See comment at ftruncate() above. */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif /* __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE */
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint faccessat(int, const char *, int, int);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint fchownat(int, const char *, uid_t, gid_t, int);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint fexecve(int, char *const [], char *const []);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint linkat(int, const char *, int, const char *, int);
199767f8919635c4928607450d9e0abb932109ceToomas Soomessize_t readlinkat(int, const char * __restrict, char * __restrict, size_t);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint symlinkat(const char *, int, const char *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint unlinkat(int, const char *, int);
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif /* __POSIX_VISIBLE >= 200809 */
199767f8919635c4928607450d9e0abb932109ceToomas Soome * symlink() was originally in POSIX.1a, which was withdrawn after
199767f8919635c4928607450d9e0abb932109ceToomas Soome * being overtaken by events (1003.1-2001). It was in XPG4.2, and of
199767f8919635c4928607450d9e0abb932109ceToomas Soome * course has been in BSD since 4.2.
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 402
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint symlink(const char * __restrict, const char * __restrict);
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* X/Open System Interfaces */
199767f8919635c4928607450d9e0abb932109ceToomas Soomechar *crypt(const char *, const char *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint encrypt(char *, int);
199767f8919635c4928607450d9e0abb932109ceToomas Soomevoid swab(const void * __restrict, void * __restrict, ssize_t);
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif /* _SWAB_DECLARED */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif /* __XSI_VISIBLE */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if (__XSI_VISIBLE && __XSI_VISIBLE <= 500) || __BSD_VISIBLE
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint brk(const void *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint chroot(const char *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomechar *getpass(const char *);
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if (__XSI_VISIBLE && __XSI_VISIBLE <= 600) || __BSD_VISIBLE
199767f8919635c4928607450d9e0abb932109ceToomas Soomechar *getwd(char *); /* obsoleted by getcwd() */
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint acct(const char *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint check_utility_compat(const char *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint crypt_set_format(const char *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint des_cipher(const char *, char *, long, int);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint dup3(int, int, int);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint eaccess(const char *, int);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint exect(const char *, char * const *, char * const *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint execvP(const char *, const char *, char * const *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint feature_present(const char *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint getdomainname(char *, int);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint getgrouplist(const char *, gid_t, gid_t *, int *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint iruserok(unsigned long, int, const char *, const char *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint iruserok_sa(const void *, int, int, const char *, const char *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomevoid __FreeBSD_libc_enter_restricted_mode(void);
199767f8919635c4928607450d9e0abb932109ceToomas Soomelong lpathconf(const char *, int);
199767f8919635c4928607450d9e0abb932109ceToomas Soomechar *mkdtemp(char *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint mkstemps(char *, int);
199767f8919635c4928607450d9e0abb932109ceToomas Soomechar *mktemp(char *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint nfssvc(int, void *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint nlm_syscall(int, int, int, char **);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint pipe2(int *, int);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint rcmd(char **, int, const char *, const char *, const char *, int *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint rcmd_af(char **, int, const char *,
199767f8919635c4928607450d9e0abb932109ceToomas Soome const char *, const char *, int *, int);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint rcmdsh(char **, int, const char *,
199767f8919635c4928607450d9e0abb932109ceToomas Soome const char *, const char *, const char *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomechar *re_comp(const char *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint re_exec(const char *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint revoke(const char *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomepid_t rfork_thread(int, void *, int (*)(void *), void *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint rresvport_af(int *, int);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint ruserok(const char *, int, const char *, const char *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint setdomainname(const char *, int);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint sethostname(const char *, int);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint setkey(const char *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint setlogin(const char *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint setloginclass(const char *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomevoid *setmode(const char *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint setpgrp(pid_t, pid_t); /* obsoleted by setpgid() */
199767f8919635c4928607450d9e0abb932109ceToomas Soomevoid setproctitle(const char *_fmt, ...) __printf0like(1, 2);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint swapon(const char *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint swapoff(const char *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint syscall(int, ...);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint undelete(const char *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint unwhiteout(const char *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomevoid *valloc(size_t); /* obsoleted by malloc() */
199767f8919635c4928607450d9e0abb932109ceToomas Soomeextern int optreset; /* getopt(3) external variable */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif /* __BSD_VISIBLE */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif /* !_UNISTD_H_ */