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