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