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