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