X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=include%2Funistd.h;h=bf10a6d12705742ca0c42584e8df361f1c11c22f;hb=6739b13a172aad9c01572c04cadacc99c7041811;hp=b9e48149677ddcfb09f031680d0815bf8e3c0a4f;hpb=1d729537873f70da83f2608e7529aad887cf13c1;p=musl diff --git a/include/unistd.h b/include/unistd.h index b9e48149..bf10a6d1 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -5,20 +5,18 @@ extern "C" { #endif +#include + #define STDIN_FILENO 0 #define STDOUT_FILENO 1 #define STDERR_FILENO 2 -#undef SEEK_SET -#undef SEEK_CUR -#undef SEEK_END #define SEEK_SET 0 #define SEEK_CUR 1 #define SEEK_END 2 -#undef NULL #ifdef __cplusplus -#define NULL 0 +#define NULL 0L #else #define NULL ((void*)0) #endif @@ -29,15 +27,18 @@ extern "C" { #define __NEED_gid_t #define __NEED_off_t #define __NEED_pid_t -#define __NEED_useconds_t #define __NEED_intptr_t +#define __NEED_useconds_t #include int pipe(int [2]); +int pipe2(int [2], int); int close(int); +int posix_close(int, int); int dup(int); int dup2(int, int); +int dup3(int, int, int); off_t lseek(int, off_t, int); int fsync(int); int fdatasync(int); @@ -56,8 +57,8 @@ int link(const char *, const char *); int linkat(int, const char *, int, const char *, int); int symlink(const char *, const char *); int symlinkat(const char *, int, const char *); -int readlink(const char *, char *, size_t); -int readlinkat(int, const char *, char *, size_t); +ssize_t readlink(const char *__restrict, char *__restrict, size_t); +ssize_t readlinkat(int, const char *__restrict, char *__restrict, size_t); int unlink(const char *); int unlinkat(int, const char *, int); int rmdir(const char *); @@ -68,6 +69,7 @@ int ftruncate(int, off_t); #define R_OK 4 #define W_OK 2 #define X_OK 1 + int access(const char *, int); int faccessat(int, const char *, int, int); @@ -82,11 +84,12 @@ int pause(void); pid_t fork(void); int execve(const char *, char *const [], char *const []); int execv(const char *, char *const []); -int execle(const char *, ...); -int execl(const char *, ...); +int execle(const char *, const char *, ...); +int execl(const char *, const char *, ...); int execvp(const char *, char *const []); -int execlp(const char *, ...); -void _exit(int); +int execlp(const char *, const char *, ...); +int fexecve(int, char *const [], char *const []); +_Noreturn void _exit(int); pid_t getpid(void); pid_t getppid(void); @@ -132,28 +135,74 @@ size_t confstr(int, char *, size_t); #define F_TLOCK 2 #define F_TEST 3 -#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) +#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) int lockf(int, int, off_t); -int setpgrp(void); -char *crypt(const char *, const char *); -void encrypt(char *, int); -void swab(const void *, void *, ssize_t); long gethostid(void); int nice(int); void sync(void); #endif -#ifdef _GNU_SOURCE +#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) +pid_t setpgrp(void); +char *crypt(const char *, const char *); +void encrypt(char *, int); +void swab(const void *__restrict, void *__restrict, ssize_t); +#endif + +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) \ + || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE+0 < 700) +int usleep(unsigned); +unsigned ualarm(unsigned, unsigned); +#endif + +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +#define L_SET 0 +#define L_INCR 1 +#define L_XTND 2 +int brk(void *); +void *sbrk(intptr_t); pid_t vfork(void); int vhangup(void); int chroot(const char *); int getpagesize(void); +int getdtablesize(void); int sethostname(const char *, size_t); -int usleep(useconds_t); -useconds_t ualarm(useconds_t, useconds_t); -int setgroups(int, const gid_t []); +int getdomainname(char *, size_t); +int setdomainname(const char *, size_t); +int setgroups(size_t, const gid_t *); +char *getpass(const char *); +int daemon(int, int); +void setusershell(void); +void endusershell(void); +char *getusershell(void); +int acct(const char *); +long syscall(long, ...); +#endif + +#ifdef _GNU_SOURCE +extern char **environ; +int setresuid(uid_t, uid_t, uid_t); +int setresgid(gid_t, gid_t, gid_t); +int getresuid(uid_t *, uid_t *, uid_t *); +int getresgid(gid_t *, gid_t *, gid_t *); +char *get_current_dir_name(void); +void syncfs(int); +int euidaccess(const char *, int); +int eaccess(const char *, int); #endif +#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) +#define lseek64 lseek +#define pread64 pread +#define pwrite64 pwrite +#define truncate64 truncate +#define ftruncate64 ftruncate +#define lockf64 lockf +#define off64_t off_t +#endif + +#define POSIX_CLOSE_RESTART 0 + #define _XOPEN_VERSION 700 #define _XOPEN_UNIX 1 #define _XOPEN_ENH_I18N 1 @@ -161,6 +210,7 @@ int setgroups(int, const gid_t []); #define _POSIX_VERSION 200809L #define _POSIX2_VERSION _POSIX_VERSION +#define _POSIX_ADVISORY_INFO _POSIX_VERSION #define _POSIX_CHOWN_RESTRICTED 1 #define _POSIX_IPV6 _POSIX_VERSION #define _POSIX_JOB_CONTROL 1 @@ -168,17 +218,24 @@ int setgroups(int, const gid_t []); #define _POSIX_MEMLOCK _POSIX_VERSION #define _POSIX_MEMLOCK_RANGE _POSIX_VERSION #define _POSIX_MEMORY_PROTECTION _POSIX_VERSION +#define _POSIX_MESSAGE_PASSING _POSIX_VERSION +#define _POSIX_FSYNC _POSIX_VERSION #define _POSIX_NO_TRUNC 1 #define _POSIX_RAW_SOCKETS _POSIX_VERSION #define _POSIX_REALTIME_SIGNALS _POSIX_VERSION #define _POSIX_REGEXP 1 #define _POSIX_SAVED_IDS 1 #define _POSIX_SHELL 1 +#define _POSIX_SPAWN _POSIX_VERSION #define _POSIX_VDISABLE 0 #define _POSIX_THREADS _POSIX_VERSION #define _POSIX_THREAD_PROCESS_SHARED _POSIX_VERSION #define _POSIX_THREAD_SAFE_FUNCTIONS _POSIX_VERSION +#define _POSIX_THREAD_ATTR_STACKADDR _POSIX_VERSION +#define _POSIX_THREAD_ATTR_STACKSIZE _POSIX_VERSION +#define _POSIX_THREAD_PRIORITY_SCHEDULING _POSIX_VERSION +#define _POSIX_THREAD_CPUTIME _POSIX_VERSION #define _POSIX_TIMERS _POSIX_VERSION #define _POSIX_TIMEOUTS _POSIX_VERSION #define _POSIX_MONOTONIC_CLOCK _POSIX_VERSION @@ -189,6 +246,7 @@ int setgroups(int, const gid_t []); #define _POSIX_READER_WRITER_LOCKS _POSIX_VERSION #define _POSIX_ASYNCHRONOUS_IO _POSIX_VERSION #define _POSIX_SEMAPHORES _POSIX_VERSION +#define _POSIX_SHARED_MEMORY_OBJECTS _POSIX_VERSION #define _POSIX2_C_BIND _POSIX_VERSION