1 /* -*-comment-start: "//";comment-end:""-*-
2 * Mes --- Maxwell Equations of Software
3 * Copyright © 2017,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
5 * This file is part of Mes.
7 * 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 * 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 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>
37 #define STDIN_FILENO 0
38 #define STDOUT_FILENO 1
39 #define STDERR_FILENO 2
40 #endif // STDIN_FILENO
43 #define STDIN_FILE_NO 0
44 #define STDOUT_FILE_NO 1
45 #define STDERR_FILE_NO 2
46 #endif // STDIN_FILE_NO
51 typedef unsigned long off_t;
57 typedef unsigned long size_t;
66 #ifndef __MES_INTPTR_T
67 #define __MES_INTPTR_T
69 typedef long intptr_t;
72 #ifndef __MES_PTRDIFF_T
73 #define __MES_PTRDIFF_T
75 typedef long ptrdiff_t;
91 int access (char const *s, int mode);
92 unsigned int alarm (unsigned int seconds);
93 #define alarm(x) {eputs ("alarm x="); eputs (itoa (x)); eputs ("\n"); kill (getpid (), 14);}
94 #define atexit(x) eputs ("atexit\n")
97 int execv (char const *file_name, char *const argv[]);
98 int execve (char const *file, char *const argv[], char *const env[]);
99 int execvp (char const *file, char *const argv[]);
101 char *getcwd (char *buf, size_t size);
103 off_t lseek (int fd, off_t offset, int whence);
104 ssize_t read (int fd, void *buffer, size_t size);
105 #if __SBRK_CHAR_PTRDIFF
106 /* xmalloc in binutils <= 2.10.1 uses this old prototype */
107 char * sbrk (ptrdiff_t delta);
109 void * sbrk (intptr_t delta);
111 int unlink (char const *file_name);
112 ssize_t write (int filedes, void const *buffer, size_t size);
115 #endif // ! WITH_GLIBC
117 #endif // __MES_UNISTD_H