X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=include%2Funistd.h;h=4f6953c44810f72b12cf764ba0586b59662eb53e;hp=ee7ee6d8ab75ae14152588cf594fa9dfcb4b07b1;hb=6cf8bfdb646efaf76c75a95d1ea0cd254706c037;hpb=ba6a9e7734aaff8f4e7d49b888f9dd1954bc92b1 diff --git a/include/unistd.h b/include/unistd.h index ee7ee6d8..4f6953c4 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -5,13 +5,12 @@ 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 @@ -55,8 +54,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 *); -ssize_t readlink(const char *, char *, size_t); -ssize_t 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 *); @@ -67,6 +66,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); @@ -86,7 +86,7 @@ int execl(const char *, const char *, ...); int execvp(const char *, char *const []); int execlp(const char *, const char *, ...); int fexecve(int, char *const [], char *const []); -void _exit(int); +_Noreturn void _exit(int); pid_t getpid(void); pid_t getppid(void); @@ -132,35 +132,67 @@ 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); -pid_t 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); -int getdtablesize(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 < 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 forkall(void); 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(unsigned); -unsigned ualarm(unsigned, unsigned); +int getdomainname(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 *); +#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); -int daemon(int, int); -int getdomainname(char *, size_t); +int pipe2(int [2], int); +int dup3(int, int, 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 _XOPEN_VERSION 700