]>
Commit | Line | Data |
---|---|---|
f001ded0 UD |
1 | #ifndef _UNISTD_H |
2 | # include <posix/unistd.h> | |
bdbf022d | 3 | |
31341567 | 4 | # ifndef _ISOMAC |
30a2dfd5 | 5 | |
456b3c08 AZ |
6 | # include <stdbool.h> |
7 | # include <kernel-features.h> | |
391f5e96 | 8 | # include <bits/unistd-decl.h> |
456b3c08 | 9 | |
81cb0d82 | 10 | libc_hidden_proto (_exit, __noreturn__) |
3d3316b1 | 11 | # ifndef NO_RTLD_HIDDEN |
af85d409 | 12 | rtld_hidden_proto (_exit, __noreturn__) |
3d3316b1 | 13 | # endif |
c41f555e | 14 | libc_hidden_proto (alarm) |
45f33aac ST |
15 | extern size_t __confstr (int name, char *buf, size_t len); |
16 | libc_hidden_proto (__confstr) | |
c41f555e RM |
17 | libc_hidden_proto (confstr) |
18 | libc_hidden_proto (execl) | |
19 | libc_hidden_proto (execle) | |
20 | libc_hidden_proto (execlp) | |
21 | libc_hidden_proto (execvp) | |
22 | libc_hidden_proto (getpid) | |
23 | libc_hidden_proto (getsid) | |
7a8bdff0 | 24 | libc_hidden_proto (getdomainname) |
5371d99e JM |
25 | extern __typeof (getlogin_r) __getlogin_r __nonnull ((1)); |
26 | libc_hidden_proto (__getlogin_r) | |
7a8bdff0 | 27 | libc_hidden_proto (getlogin_r) |
df962917 RM |
28 | libc_hidden_proto (seteuid) |
29 | libc_hidden_proto (setegid) | |
30 | libc_hidden_proto (tcgetpgrp) | |
a346370d | 31 | libc_hidden_proto (readlinkat) |
412b05fe FW |
32 | libc_hidden_proto (fsync) |
33 | libc_hidden_proto (fdatasync) | |
c41f555e | 34 | |
b17d65ff FB |
35 | libc_hidden_proto (__read_chk) |
36 | libc_hidden_proto (__getdomainname_chk) | |
37 | libc_hidden_proto (__getlogin_r_chk) | |
38 | ||
bdbf022d | 39 | /* Now define the internal interfaces. */ |
dd679287 ST |
40 | extern int __access (const char *__name, int __type); |
41 | libc_hidden_proto (__access) | |
a784e502 | 42 | extern int __euidaccess (const char *__name, int __type); |
09085ede ST |
43 | extern int __faccessat (int __fd, const char *__file, int __type, int __flag); |
44 | extern int __faccessat_noerrno (int __fd, const char *__file, int __type, | |
45 | int __flag); | |
c5c35884 | 46 | extern __off64_t __lseek64 (int __fd, __off64_t __offset, int __whence); |
6991feeb | 47 | extern __off_t __lseek (int __fd, __off_t __offset, int __whence); |
a4baf360 | 48 | libc_hidden_proto (__lseek) |
f16d4019 | 49 | extern __off_t __libc_lseek (int __fd, __off_t __offset, int __whence); |
778c59c8 | 50 | extern __off64_t __libc_lseek64 (int __fd, __off64_t __offset, int __whence); |
aaa8d85c UD |
51 | extern ssize_t __pread (int __fd, void *__buf, size_t __nbytes, |
52 | __off_t __offset); | |
827b8237 | 53 | libc_hidden_proto (__pread); |
778c59c8 UD |
54 | extern ssize_t __libc_pread (int __fd, void *__buf, size_t __nbytes, |
55 | __off_t __offset); | |
6991feeb AJ |
56 | extern ssize_t __pread64 (int __fd, void *__buf, size_t __nbytes, |
57 | __off64_t __offset); | |
827b8237 | 58 | libc_hidden_proto (__pread64); |
778c59c8 | 59 | extern ssize_t __libc_pread64 (int __fd, void *__buf, size_t __nbytes, |
dd795c6c | 60 | __off64_t __offset); |
a784e502 | 61 | extern ssize_t __pwrite (int __fd, const void *__buf, size_t __n, |
aaa8d85c | 62 | __off_t __offset); |
827b8237 | 63 | libc_hidden_proto (__pwrite) |
a784e502 | 64 | extern ssize_t __libc_pwrite (int __fd, const void *__buf, size_t __n, |
778c59c8 | 65 | __off_t __offset); |
a784e502 | 66 | extern ssize_t __pwrite64 (int __fd, const void *__buf, size_t __n, |
6991feeb | 67 | __off64_t __offset); |
37ba7d66 | 68 | libc_hidden_proto (__pwrite64) |
a784e502 | 69 | extern ssize_t __libc_pwrite64 (int __fd, const void *__buf, size_t __n, |
4c8cb283 | 70 | __off64_t __offset); |
e9e9b245 | 71 | extern ssize_t __libc_read (int __fd, void *__buf, size_t __n); |
37ba7d66 | 72 | libc_hidden_proto (__libc_read) |
f6a191a6 | 73 | libc_hidden_proto (read) |
a784e502 | 74 | extern ssize_t __libc_write (int __fd, const void *__buf, size_t __n); |
37ba7d66 | 75 | libc_hidden_proto (__libc_write) |
dfaaee33 | 76 | libc_hidden_proto (write) |
aaa8d85c | 77 | extern int __pipe (int __pipedes[2]); |
37ba7d66 | 78 | libc_hidden_proto (__pipe) |
7ec4b39a L |
79 | extern int __pipe2 (int __pipedes[2], int __flags) attribute_hidden; |
80 | extern unsigned int __sleep (unsigned int __seconds) attribute_hidden; | |
a784e502 | 81 | extern int __chown (const char *__file, |
aaa8d85c | 82 | __uid_t __owner, __gid_t __group); |
37ba7d66 | 83 | libc_hidden_proto (__chown) |
aaa8d85c UD |
84 | extern int __fchown (int __fd, |
85 | __uid_t __owner, __gid_t __group); | |
7ae60af7 | 86 | extern int __fchownat (int __fd, const char *__file, uid_t __owner, gid_t __group, int __flag); |
a784e502 | 87 | extern int __lchown (const char *__file, __uid_t __owner, |
aaa8d85c | 88 | __gid_t __group); |
7ec4b39a L |
89 | extern int __chdir (const char *__path) attribute_hidden; |
90 | extern int __fchdir (int __fd) attribute_hidden; | |
db25266c ST |
91 | extern char *__getcwd (char *__buf, size_t __size); |
92 | libc_hidden_proto (__getcwd) | |
7ec4b39a | 93 | extern int __rmdir (const char *__path) attribute_hidden; |
8275067d | 94 | extern int __execvpe (const char *file, char *const argv[], |
7ec4b39a | 95 | char *const envp[]) attribute_hidden; |
283d9851 AZ |
96 | extern int __execvpex (const char *file, char *const argv[], |
97 | char *const envp[]) attribute_hidden; | |
bdbf022d UD |
98 | |
99 | /* Get the canonical absolute name of the named directory, and put it in SIZE | |
100 | bytes of BUF. Returns NULL if the directory couldn't be determined or | |
101 | SIZE was too small. If successful, returns BUF. In GNU, if BUF is | |
102 | NULL, an array is allocated with `malloc'; the array is SIZE bytes long, | |
103 | unless SIZE <= 0, in which case it is as big as necessary. */ | |
104 | ||
a784e502 | 105 | char *__canonicalize_directory_name_internal (const char *__thisdir, |
aaa8d85c | 106 | char *__buf, |
f83af095 | 107 | size_t __size) attribute_hidden; |
bdbf022d | 108 | |
aaa8d85c | 109 | extern int __dup (int __fd); |
9ff72da4 | 110 | libc_hidden_proto (__dup) |
aaa8d85c | 111 | extern int __dup2 (int __fd, int __fd2); |
37ba7d66 | 112 | libc_hidden_proto (__dup2) |
5aa3a74a TS |
113 | extern int __dup3 (int __fd, int __fd2, int flags); |
114 | libc_hidden_proto (__dup3) | |
a784e502 | 115 | extern int __execve (const char *__path, char *const __argv[], |
7ec4b39a | 116 | char *const __envp[]) attribute_hidden; |
4d4bb451 ST |
117 | extern int __execveat (int dirfd, const char *__path, char *const __argv[], |
118 | char *const __envp[], int flags) attribute_hidden; | |
a784e502 | 119 | extern long int __pathconf (const char *__path, int __name); |
aaa8d85c UD |
120 | extern long int __fpathconf (int __fd, int __name); |
121 | extern long int __sysconf (int __name); | |
a20d8dbe | 122 | libc_hidden_proto (__sysconf) |
6991feeb | 123 | extern __pid_t __getpid (void); |
37ba7d66 | 124 | libc_hidden_proto (__getpid) |
aaa8d85c | 125 | extern __pid_t __getppid (void); |
7ec4b39a L |
126 | extern __pid_t __setsid (void) attribute_hidden; |
127 | extern __uid_t __getuid (void) attribute_hidden; | |
128 | extern __uid_t __geteuid (void) attribute_hidden; | |
129 | extern __gid_t __getgid (void) attribute_hidden; | |
130 | extern __gid_t __getegid (void) attribute_hidden; | |
131 | extern int __getgroups (int __size, __gid_t __list[]) attribute_hidden; | |
37ba7d66 | 132 | libc_hidden_proto (__getpgid) |
7ec4b39a | 133 | extern int __group_member (__gid_t __gid) attribute_hidden; |
aaa8d85c UD |
134 | extern int __setuid (__uid_t __uid); |
135 | extern int __setreuid (__uid_t __ruid, __uid_t __euid); | |
136 | extern int __setgid (__gid_t __gid); | |
6991feeb | 137 | extern int __setpgid (__pid_t __pid, __pid_t __pgid); |
37ba7d66 | 138 | libc_hidden_proto (__setpgid) |
aaa8d85c | 139 | extern int __setregid (__gid_t __rgid, __gid_t __egid); |
0d5cb2c7 RM |
140 | extern int __getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid); |
141 | extern int __getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid); | |
142 | extern int __setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid); | |
143 | extern int __setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid); | |
747bf98e RM |
144 | libc_hidden_proto (__getresuid) |
145 | libc_hidden_proto (__getresgid) | |
146 | libc_hidden_proto (__setresuid) | |
147 | libc_hidden_proto (__setresgid) | |
aaa8d85c | 148 | extern __pid_t __vfork (void); |
d1436edc | 149 | libc_hidden_proto (__vfork) |
05ae46ee ÉN |
150 | extern int __ttyname_r (int __fd, char *__buf, size_t __buflen); |
151 | libc_hidden_proto (__ttyname_r) | |
9a756540 AZ |
152 | extern __pid_t _Fork (void); |
153 | libc_hidden_proto (_Fork); | |
7ec4b39a | 154 | extern int __isatty (int __fd) attribute_hidden; |
c4929eec | 155 | extern int __isatty_nostatus (int __fd) attribute_hidden; |
a784e502 UD |
156 | extern int __link (const char *__from, const char *__to); |
157 | extern int __symlink (const char *__from, const char *__to); | |
7ae60af7 | 158 | extern int __symlinkat (const char *__from, int __fd, const char *__to); |
7ec4b39a L |
159 | extern ssize_t __readlink (const char *__path, char *__buf, size_t __len) |
160 | attribute_hidden; | |
7ae60af7 | 161 | extern ssize_t __readlinkat (int __fd, const char *__file_name, char *__buf, size_t __len); |
7ec4b39a | 162 | extern int __unlink (const char *__name) attribute_hidden; |
7ae60af7 | 163 | extern int __unlinkat (int __fd, const char *__name, int __flag); |
7ec4b39a | 164 | extern int __gethostname (char *__name, size_t __len) attribute_hidden; |
52a1f181 | 165 | extern int __revoke (const char *__file); |
aaa8d85c | 166 | extern int __profil (unsigned short int *__sample_buffer, size_t __size, |
7ec4b39a L |
167 | size_t __offset, unsigned int __scale) |
168 | attribute_hidden; | |
169 | extern int __getdtablesize (void) attribute_hidden; | |
170 | extern int __brk (void *__addr) attribute_hidden; | |
6991feeb | 171 | extern int __close (int __fd); |
37ba7d66 | 172 | libc_hidden_proto (__close) |
3335502b | 173 | extern int __libc_close (int __fd); |
456b3c08 AZ |
174 | # if __ASSUME_CLOSE_RANGE |
175 | static inline _Bool __closefrom_fallback (int __lowfd, _Bool dirfd_fallback) | |
176 | { | |
177 | return false; | |
178 | } | |
179 | # else | |
882d6e17 | 180 | extern _Bool __closefrom_fallback (int __lowfd, _Bool) attribute_hidden; |
456b3c08 | 181 | # endif |
6991feeb | 182 | extern ssize_t __read (int __fd, void *__buf, size_t __nbytes); |
37ba7d66 | 183 | libc_hidden_proto (__read) |
a784e502 | 184 | extern ssize_t __write (int __fd, const void *__buf, size_t __n); |
37ba7d66 | 185 | libc_hidden_proto (__write) |
6991feeb | 186 | extern __pid_t __fork (void); |
d1436edc | 187 | libc_hidden_proto (__fork) |
6991feeb | 188 | extern int __getpagesize (void) __attribute__ ((__const__)); |
37ba7d66 | 189 | libc_hidden_proto (__getpagesize) |
7ec4b39a L |
190 | extern int __ftruncate (int __fd, __off_t __length) attribute_hidden; |
191 | extern int __ftruncate64 (int __fd, __off64_t __length) attribute_hidden; | |
f5164429 | 192 | extern int __truncate (const char *path, __off_t __length); |
6991feeb | 193 | extern void *__sbrk (intptr_t __delta); |
37ba7d66 | 194 | libc_hidden_proto (__sbrk) |
06535ae9 | 195 | |
342cc934 AZ |
196 | extern int __tcsetpgrp (int fd, __pid_t pgrp); |
197 | libc_hidden_proto (__tcsetpgrp) | |
06535ae9 UD |
198 | |
199 | /* This variable is set nonzero at startup if the process's effective | |
200 | IDs differ from its real IDs, or it is otherwise indicated that | |
201 | extra security should be used. When this is set the dynamic linker | |
202 | and some functions contained in the C library ignore various | |
203 | environment variables that normally affect them. */ | |
d0369217 | 204 | extern int __libc_enable_secure attribute_relro; |
6bc6bd3b | 205 | rtld_hidden_proto (__libc_enable_secure) |
06535ae9 | 206 | |
17427edd UD |
207 | |
208 | /* Various internal function. */ | |
730bbab2 | 209 | extern void __libc_check_standard_fds (void) attribute_hidden; |
17427edd | 210 | |
7ae4abe9 | 211 | |
2ef30b3d UD |
212 | /* Internal name for fork function. */ |
213 | extern __pid_t __libc_fork (void); | |
214 | ||
65c93f62 UD |
215 | /* Suspend the process until a signal arrives. |
216 | This always returns -1 and sets `errno' to EINTR. */ | |
217 | extern int __libc_pause (void); | |
218 | ||
c8727fa6 UD |
219 | extern int __getlogin_r_loginuid (char *name, size_t namesize) |
220 | attribute_hidden; | |
221 | ||
730bbab2 L |
222 | # if IS_IN (rtld) |
223 | # include <dl-unistd.h> | |
224 | # endif | |
225 | ||
31341567 | 226 | # endif |
f001ded0 | 227 | #endif |