1 /* -*-comment-start: "//";comment-end:""-*-
2 * GNU Mes --- Maxwell Equations of Software
3 * Copyright © 2017,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
5 * This file is part of GNU Mes.
7 * GNU Mes is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or (at
10 * your option) any later version.
12 * GNU Mes is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef __MES_UNISTD_H
21 #define __MES_UNISTD_H 1
28 #include_next <unistd.h>
30 #else // ! SYSTEM_LIBC
32 #if defined (BOOTSTRAP_WITH_POSIX)
33 #define _POSIX_VERSION 199009L
36 #include <sys/types.h>
42 #define STDIN_FILENO 0
43 #define STDOUT_FILENO 1
44 #define STDERR_FILENO 2
45 #endif // STDIN_FILENO
48 #define STDIN_FILE_NO 0
49 #define STDOUT_FILE_NO 1
50 #define STDERR_FILE_NO 2
51 #endif // STDIN_FILE_NO
60 int access (char const *s, int mode);
61 unsigned int alarm (unsigned int seconds);
63 int execv (char const *file_name, char *const argv[]);
64 int execl (char const *file_name, char const *arg, ...);
65 int execlp (char const *file_name, char const *arg, ...);
66 int execve (char const *file, char *const argv[], char *const env[]);
67 int execvp (char const *file, char *const argv[]);
69 int fsync (int filedes);
70 char *getcwd (char *buf, size_t size);
73 int setgid (gid_t newgid);
74 int setuid (uid_t newuid);
80 int getpgid (pid_t pid);
82 int link (char const *old_name, char const *new_name);
83 off_t lseek (int fd, off_t offset, int whence);
84 ssize_t read (int fd, void *buffer, size_t size);
85 ssize_t readlink (char const *file_name, char *buffer, size_t size);
86 #if __SBRK_CHAR_PTRDIFF
87 /* xmalloc in binutils <= 2.10.1 uses this old prototype */
88 char *sbrk (ptrdiff_t delta);
90 void *sbrk (intptr_t delta);
92 int symlink (char const *old_name, char const *new_name);
93 int unlink (char const *file_name);
94 ssize_t write (int filedes, void const *buffer, size_t size);
96 #endif // ! SYSTEM_LIBC
98 #endif // __MES_UNISTD_H