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