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