1 | #ifndef _UNISTD_H |
2 | # include <posix/unistd.h> |
3 | |
4 | # ifndef _ISOMAC |
5 | |
6 | libc_hidden_proto (_exit, __noreturn__) |
7 | # ifndef NO_RTLD_HIDDEN |
8 | rtld_hidden_proto (_exit, __noreturn__) |
9 | # endif |
10 | libc_hidden_proto (alarm) |
11 | extern size_t __confstr (int name, char *buf, size_t len); |
12 | libc_hidden_proto (__confstr) |
13 | libc_hidden_proto (confstr) |
14 | libc_hidden_proto (execl) |
15 | libc_hidden_proto (execle) |
16 | libc_hidden_proto (execlp) |
17 | libc_hidden_proto (execvp) |
18 | libc_hidden_proto (getpid) |
19 | libc_hidden_proto (getsid) |
20 | libc_hidden_proto (getdomainname) |
21 | extern __typeof (getlogin_r) __getlogin_r __nonnull ((1)); |
22 | libc_hidden_proto (__getlogin_r) |
23 | libc_hidden_proto (getlogin_r) |
24 | libc_hidden_proto (seteuid) |
25 | libc_hidden_proto (setegid) |
26 | libc_hidden_proto (tcgetpgrp) |
27 | libc_hidden_proto (readlinkat) |
28 | libc_hidden_proto (fsync) |
29 | libc_hidden_proto (fdatasync) |
30 | |
31 | /* Now define the internal interfaces. */ |
32 | extern int __access (const char *__name, int __type); |
33 | libc_hidden_proto (__access) |
34 | extern int __euidaccess (const char *__name, int __type); |
35 | extern int __faccessat (int __fd, const char *__file, int __type, int __flag); |
36 | extern int __faccessat_noerrno (int __fd, const char *__file, int __type, |
37 | int __flag); |
38 | extern __off64_t __lseek64 (int __fd, __off64_t __offset, int __whence); |
39 | extern __off_t __lseek (int __fd, __off_t __offset, int __whence); |
40 | libc_hidden_proto (__lseek) |
41 | extern __off_t __libc_lseek (int __fd, __off_t __offset, int __whence); |
42 | extern __off64_t __libc_lseek64 (int __fd, __off64_t __offset, int __whence); |
43 | extern ssize_t __pread (int __fd, void *__buf, size_t __nbytes, |
44 | __off_t __offset); |
45 | libc_hidden_proto (__pread); |
46 | extern ssize_t __libc_pread (int __fd, void *__buf, size_t __nbytes, |
47 | __off_t __offset); |
48 | extern ssize_t __pread64 (int __fd, void *__buf, size_t __nbytes, |
49 | __off64_t __offset); |
50 | libc_hidden_proto (__pread64); |
51 | extern ssize_t __libc_pread64 (int __fd, void *__buf, size_t __nbytes, |
52 | __off64_t __offset); |
53 | extern ssize_t __pwrite (int __fd, const void *__buf, size_t __n, |
54 | __off_t __offset); |
55 | libc_hidden_proto (__pwrite) |
56 | extern ssize_t __libc_pwrite (int __fd, const void *__buf, size_t __n, |
57 | __off_t __offset); |
58 | extern ssize_t __pwrite64 (int __fd, const void *__buf, size_t __n, |
59 | __off64_t __offset); |
60 | libc_hidden_proto (__pwrite64) |
61 | extern ssize_t __libc_pwrite64 (int __fd, const void *__buf, size_t __n, |
62 | __off64_t __offset); |
63 | extern ssize_t __libc_read (int __fd, void *__buf, size_t __n); |
64 | libc_hidden_proto (__libc_read) |
65 | libc_hidden_proto (read) |
66 | extern ssize_t __libc_write (int __fd, const void *__buf, size_t __n); |
67 | libc_hidden_proto (__libc_write) |
68 | libc_hidden_proto (write) |
69 | extern int __pipe (int __pipedes[2]); |
70 | libc_hidden_proto (__pipe) |
71 | extern int __pipe2 (int __pipedes[2], int __flags) attribute_hidden; |
72 | extern unsigned int __sleep (unsigned int __seconds) attribute_hidden; |
73 | extern int __chown (const char *__file, |
74 | __uid_t __owner, __gid_t __group); |
75 | libc_hidden_proto (__chown) |
76 | extern int __fchown (int __fd, |
77 | __uid_t __owner, __gid_t __group); |
78 | extern int __lchown (const char *__file, __uid_t __owner, |
79 | __gid_t __group); |
80 | extern int __chdir (const char *__path) attribute_hidden; |
81 | extern int __fchdir (int __fd) attribute_hidden; |
82 | extern char *__getcwd (char *__buf, size_t __size); |
83 | libc_hidden_proto (__getcwd) |
84 | extern int __rmdir (const char *__path) attribute_hidden; |
85 | extern int __execvpe (const char *file, char *const argv[], |
86 | char *const envp[]) attribute_hidden; |
87 | extern int __execvpex (const char *file, char *const argv[], |
88 | char *const envp[]) attribute_hidden; |
89 | |
90 | /* Get the canonical absolute name of the named directory, and put it in SIZE |
91 | bytes of BUF. Returns NULL if the directory couldn't be determined or |
92 | SIZE was too small. If successful, returns BUF. In GNU, if BUF is |
93 | NULL, an array is allocated with `malloc'; the array is SIZE bytes long, |
94 | unless SIZE <= 0, in which case it is as big as necessary. */ |
95 | |
96 | char *__canonicalize_directory_name_internal (const char *__thisdir, |
97 | char *__buf, |
98 | size_t __size) attribute_hidden; |
99 | |
100 | extern int __dup (int __fd); |
101 | libc_hidden_proto (__dup) |
102 | extern int __dup2 (int __fd, int __fd2); |
103 | libc_hidden_proto (__dup2) |
104 | extern int __dup3 (int __fd, int __fd2, int flags); |
105 | libc_hidden_proto (__dup3) |
106 | extern int __execve (const char *__path, char *const __argv[], |
107 | char *const __envp[]) attribute_hidden; |
108 | extern int __execveat (int dirfd, const char *__path, char *const __argv[], |
109 | char *const __envp[], int flags) attribute_hidden; |
110 | extern long int __pathconf (const char *__path, int __name); |
111 | extern long int __fpathconf (int __fd, int __name); |
112 | extern long int __sysconf (int __name); |
113 | libc_hidden_proto (__sysconf) |
114 | extern __pid_t __getpid (void); |
115 | libc_hidden_proto (__getpid) |
116 | extern __pid_t __getppid (void); |
117 | extern __pid_t __setsid (void) attribute_hidden; |
118 | extern __uid_t __getuid (void) attribute_hidden; |
119 | extern __uid_t __geteuid (void) attribute_hidden; |
120 | extern __gid_t __getgid (void) attribute_hidden; |
121 | extern __gid_t __getegid (void) attribute_hidden; |
122 | extern int __getgroups (int __size, __gid_t __list[]) attribute_hidden; |
123 | libc_hidden_proto (__getpgid) |
124 | extern int __group_member (__gid_t __gid) attribute_hidden; |
125 | extern int __setuid (__uid_t __uid); |
126 | extern int __setreuid (__uid_t __ruid, __uid_t __euid); |
127 | extern int __setgid (__gid_t __gid); |
128 | extern int __setpgid (__pid_t __pid, __pid_t __pgid); |
129 | libc_hidden_proto (__setpgid) |
130 | extern int __setregid (__gid_t __rgid, __gid_t __egid); |
131 | extern int __getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid); |
132 | extern int __getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid); |
133 | extern int __setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid); |
134 | extern int __setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid); |
135 | libc_hidden_proto (__getresuid) |
136 | libc_hidden_proto (__getresgid) |
137 | libc_hidden_proto (__setresuid) |
138 | libc_hidden_proto (__setresgid) |
139 | extern __pid_t __vfork (void); |
140 | libc_hidden_proto (__vfork) |
141 | extern int __ttyname_r (int __fd, char *__buf, size_t __buflen); |
142 | libc_hidden_proto (__ttyname_r) |
143 | extern __pid_t _Fork (void); |
144 | libc_hidden_proto (_Fork); |
145 | extern int __isatty (int __fd) attribute_hidden; |
146 | extern int __link (const char *__from, const char *__to); |
147 | extern int __symlink (const char *__from, const char *__to); |
148 | extern ssize_t __readlink (const char *__path, char *__buf, size_t __len) |
149 | attribute_hidden; |
150 | extern int __unlink (const char *__name) attribute_hidden; |
151 | extern int __gethostname (char *__name, size_t __len) attribute_hidden; |
152 | extern int __revoke (const char *__file); |
153 | extern int __profil (unsigned short int *__sample_buffer, size_t __size, |
154 | size_t __offset, unsigned int __scale) |
155 | attribute_hidden; |
156 | extern int __getdtablesize (void) attribute_hidden; |
157 | extern int __brk (void *__addr) attribute_hidden; |
158 | extern int __close (int __fd); |
159 | libc_hidden_proto (__close) |
160 | extern int __libc_close (int __fd); |
161 | extern _Bool __closefrom_fallback (int __lowfd, _Bool) attribute_hidden; |
162 | extern ssize_t __read (int __fd, void *__buf, size_t __nbytes); |
163 | libc_hidden_proto (__read) |
164 | extern ssize_t __write (int __fd, const void *__buf, size_t __n); |
165 | libc_hidden_proto (__write) |
166 | extern __pid_t __fork (void); |
167 | libc_hidden_proto (__fork) |
168 | extern int __getpagesize (void) __attribute__ ((__const__)); |
169 | libc_hidden_proto (__getpagesize) |
170 | extern int __ftruncate (int __fd, __off_t __length) attribute_hidden; |
171 | extern int __ftruncate64 (int __fd, __off64_t __length) attribute_hidden; |
172 | extern int __truncate (const char *path, __off_t __length); |
173 | extern void *__sbrk (intptr_t __delta); |
174 | libc_hidden_proto (__sbrk) |
175 | |
176 | |
177 | /* This variable is set nonzero at startup if the process's effective |
178 | IDs differ from its real IDs, or it is otherwise indicated that |
179 | extra security should be used. When this is set the dynamic linker |
180 | and some functions contained in the C library ignore various |
181 | environment variables that normally affect them. */ |
182 | extern int __libc_enable_secure attribute_relro; |
183 | extern int __libc_enable_secure_decided; |
184 | rtld_hidden_proto (__libc_enable_secure) |
185 | |
186 | |
187 | /* Various internal function. */ |
188 | extern void __libc_check_standard_fds (void) attribute_hidden; |
189 | |
190 | |
191 | /* Internal name for fork function. */ |
192 | extern __pid_t __libc_fork (void); |
193 | |
194 | /* Suspend the process until a signal arrives. |
195 | This always returns -1 and sets `errno' to EINTR. */ |
196 | extern int __libc_pause (void); |
197 | |
198 | extern int __getlogin_r_loginuid (char *name, size_t namesize) |
199 | attribute_hidden; |
200 | |
201 | # if IS_IN (rtld) |
202 | # include <dl-unistd.h> |
203 | # endif |
204 | |
205 | # endif |
206 | #endif |
207 | |