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

source code of glibc/include/unistd.h