// TODO: Fully implement errno.h, make sure it matches the kernel one
-extern int *libc_geterrno();
+extern int *libc_geterrno(void);
#define errno (*libc_geterrno())
extern const char *strerr(int errnum);
extern void exit(int status) __attribute__((noreturn));\r
extern void abort(void);\r
extern void atexit(void (*__func)(void));\r
-extern void qsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *));\r
extern int abs(int j);\r
extern long int labs(long int j);\r
extern long long int llabs(long long int j);\r
/* --- Environment --- */\r
extern char *getenv(const char *name);\r
\r
+/* --- Search/Sort --- */\r
+typedef int (*_stdlib_compar_t)(const void *, const void *);\r
+extern void *bsearch(const void *key, const void *base, size_t nmemb, size_t size, _stdlib_compar_t compar);\r
+extern void qsort(void *base, size_t nmemb, size_t size, _stdlib_compar_t compar);\r
+\r
/* --- Heap --- */\r
extern void free(void *mem);\r
extern void *malloc(size_t bytes);\r