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