2 meinOS - A unix-like x86 microkernel operating system
3 Copyright (C) 2008 Janosch Gräf <janosch.graef@gmx.net>
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #include <sys/types.h>
29 #define EXIT_SUCCESS 0
32 #define EXIT_FAILURE 1
36 #define NULL ((void*)0)
39 #define on_exit(func) atexit(func)
46 void exit(int result
);
47 void _Exit(int result
);
49 int atexit(void (*function
)(void));
50 int system(const char *command
);
52 int atoi(const char *str
);
54 #define RAND_MAX 32767
56 void srand(int newseed
);
60 div_t div(int numer
, int denom
);
62 char *getenv(const char *name
);
63 int setenv(const char *envname
, const char *envval
, int overwrite
);
64 int unsetenv(const char *name
);
66 void *sbrk(intptr_t size
);
67 void* memalign(size_t, size_t);
69 char *realpath(const char *file_name
,char *resolved_name
);
71 static inline signed long strtol(const char *nptr
,char **endptr
,int base
) {
72 return (signed long)strntoumax(nptr
,endptr
,base
,~(size_t)0);
75 static inline signed long long strtoll(const char *nptr
,char **endptr
,int base
) {
76 return (signed long long)strntoumax(nptr
,endptr
,base
,~(size_t)0);
79 static inline unsigned long strtoul(const char *nptr
,char **endptr
,int base
) {
80 return (unsigned long)strntoumax(nptr
,endptr
,base
,~(size_t)0);
83 static inline unsigned long long strtoull(const char *nptr
,char **endptr
,int base
) {
84 return (unsigned long long)strntoumax(nptr
,endptr
,base
,~(size_t)0);