13#define NULL ((void *)0)
29void *
calloc(
size_t nmemb,
size_t size);
62double strtod(
const char *str,
char **end);
63float strtof(
const char *str,
char **end);
64long double strtold(
const char *str,
char **end);
69double atof(
const char *str);
119#define RAND_MAX 0x7fffffff
120#define EXIT_SUCCESS 0
121#define EXIT_FAILURE 1
151void qsort(
void *
base,
size_t count,
size_t size,
int (*compare)(
const void *,
const void *));
157void *
bsearch(
const void *key,
const void *
base,
size_t count,
size_t size,
158 int (*compare)(
const void *,
const void *));
160int setenv(
const char *name,
const char *value,
int overwrite);
192#define MB_CUR_MAX ((size_t)4)
197int mbtowc(
wchar_t *wc,
const char *s,
size_t n);
207char *
realpath(
const char *restrict path,
char *restrict resolved);
uint32_t base
Definition gdt.c:1
uint8_t flags
Definition idt.c:3
unsigned int uint32_t
Definition fb.h:17
NULL, size_t, ptrdiff_t, offsetof.
integer types of fixed width.
uint32_t arc4random(void)
random numbers good for keys, from the kernel's generator (sys/random.h).
int system(const char *command)
run a command with "/bin/sh -c" and wait for it.
int mblen(const char *s, size_t n)
the bytes of the character at s (at most n), 0 for "\0", or -1
uint32_t arc4random_uniform(uint32_t bound)
a random number below bound, each one equally likely
int unsetenv(const char *name)
int setenv(const char *name, const char *value, int overwrite)
void * calloc(size_t nmemb, size_t size)
allocate zero-initialized memory.
int atoi(const char *s)
convert a string to an integer.
double strtod(const char *str, char **end)
a floating-point number at the start of str, after spaces: an optional sign, then decimal digits with...
void exit(int status) __attribute__((noreturn))
run the atexit handlers, write out buffered stdio output, then end the process with an exit code.
long strtol(const char *s, char **end, int base)
char * realpath(const char *restrict path, char *restrict resolved)
the absolute path of path, with no "." or ".." and no double slashes, into resolved (PATH_MAX bytes),...
long long atoll(const char *s)
int mbtowc(wchar_t *wc, const char *s, size_t n)
the character at s (at most n bytes) into *wc: its bytes, 0 or -1
double atof(const char *str)
strtod(str, NULL).
long long strtoll(const char *s, char **end, int base)
int mkstemp(char *template)
make and open a new file with a name no other file has.
void qsort(void *base, size_t count, size_t size, int(*compare)(const void *, const void *))
sort count elements of size bytes (heap sort: not stable).
void srand(unsigned int seed)
div_t div(int numerator, int denominator)
char * mkdtemp(char *template)
make a new folder (0700) named template with its six X's replaced
void * malloc(size_t size)
allocate memory.
ldiv_t ldiv(long numerator, long denominator)
void arc4random_buf(void *buf, size_t length)
char ** environ
the environment: a NULL-terminated array of "KEY=VALUE" strings.
long long llabs(long long value)
unsigned long strtoul(const char *s, char **end, int base)
char * getenv(const char *name)
look up an environment variable.
int wctomb(char *s, wchar_t wc)
wc as UTF-8 at s: the bytes, or -1
int atexit(void(*function)(void))
register a function for exit() to call.
void abort(void) __attribute__((noreturn))
end the process with SIGABRT.
unsigned long long strtoull(const char *s, char **end, int base)
int ptsname_r(int fd, char *buf, size_t size)
void * realloc(void *ptr, size_t size)
resize a previously allocated block.
long double strtold(const char *str, char **end)
void _Exit(int status) __attribute__((noreturn))
end the process at once: no atexit functions, no stream flush (C99)
float strtof(const char *str, char **end)
void * bsearch(const void *key, const void *base, size_t count, size_t size, int(*compare)(const void *, const void *))
find key in a sorted array.
void free(void *ptr)
free a previously allocated block.
int posix_openpt(int flags)
pseudo-terminals (the master side, /dev/ptmx).
ELF32 file header.
Definition elf.h:51
int quot
Definition stdlib.h:109
int rem
Definition stdlib.h:110
long rem
Definition stdlib.h:116
long quot
Definition stdlib.h:115