8 #include <klibc/extern.h>
9 #include <klibc/compiler.h>
12 #define EXIT_FAILURE 1
13 #define EXIT_SUCCESS 0
15 __extern __noreturn
abort(void);
16 static __inline__
int abs(int __n
)
18 return (__n
< 0) ? -__n
: __n
;
21 __extern
int atexit(void (*)(void));
22 __extern
int on_exit(void (*)(int, void *), void *);
23 __extern
int atoi(const char *);
24 __extern
long atol(const char *);
25 __extern
long long atoll(const char *);
26 __extern __noreturn
exit(int);
27 __extern __noreturn
_Exit(int);
28 __extern
void free(void *);
29 static __inline__
long labs(long __n
)
31 return (__n
< 0L) ? -__n
: __n
;
34 static __inline__
long long llabs(long long __n
)
36 return (__n
< 0LL) ? -__n
: __n
;
39 __extern __mallocfunc
void *malloc(size_t);
40 __extern __mallocfunc
void *zalloc(size_t);
41 __extern __mallocfunc
void *calloc(size_t, size_t);
42 __extern __mallocfunc
void *realloc(void *, size_t);
43 __extern
long strtol(const char *, char **, int);
44 __extern
long long strtoll(const char *, char **, int);
45 __extern
unsigned long strtoul(const char *, char **, int);
46 __extern
unsigned long long strtoull(const char *, char **, int);
48 static __inline__
char *getenv(const char *name
)
54 __extern
int putenv(const char *);
55 __extern
int setenv(const char *, const char *, int);
56 __extern
int unsetenv(const char *);
58 __extern
void qsort(void *, size_t, size_t,
59 int (*)(const void *, const void *));
61 __extern
long jrand48(unsigned short *);
62 __extern
long mrand48(void);
63 __extern
long nrand48(unsigned short *);
64 __extern
long lrand48(void);
65 __extern
unsigned short *seed48(const unsigned short *);
66 __extern
void srand48(long);
68 #define RAND_MAX 0x7fffffff
69 static __inline__
int rand(void)
71 return (int)lrand48();
74 static __inline__
void srand(unsigned int __s
)
79 static __inline__
long random(void)
84 static __inline__
void srandom(unsigned int __s
)
89 /* Basic PTY functions. These only work if devpts is mounted! */
91 __extern
int unlockpt(int);
92 __extern
char *ptsname(int);
93 __extern
int getpt(void);
95 static __inline__
int grantpt(int __fd
)
98 return 0; /* devpts does this all for us! */
101 #endif /* _STDLIB_H */