From: John Hodge Date: Mon, 1 Jul 2013 14:27:32 +0000 (+0800) Subject: Usermode/libc,libposix - Fixing errors in headers X-Git-Tag: rel0.15~398 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=d0f3b51e8a52fecdf28df689f3b8ae9215087dd8;p=tpg%2Facess2.git Usermode/libc,libposix - Fixing errors in headers --- diff --git a/Usermode/Libraries/libc.so_src/include_exp/ctype.h b/Usermode/Libraries/libc.so_src/include_exp/ctype.h index ddb0a614..0d437e9b 100644 --- a/Usermode/Libraries/libc.so_src/include_exp/ctype.h +++ b/Usermode/Libraries/libc.so_src/include_exp/ctype.h @@ -27,6 +27,11 @@ static inline int toupper(int ch) { return ch - 'a' + 'A'; return ch; } +static inline int tolower(int ch) { + if('A'<=ch && ch <='Z') + return ch - 'A' + 'a'; + return ch; +} static inline int isspace(int ch) { if(ch == ' ') return 1; diff --git a/Usermode/Libraries/libc.so_src/include_exp/errno.h b/Usermode/Libraries/libc.so_src/include_exp/errno.h index 213aeba2..2fc26a33 100644 --- a/Usermode/Libraries/libc.so_src/include_exp/errno.h +++ b/Usermode/Libraries/libc.so_src/include_exp/errno.h @@ -10,7 +10,7 @@ // 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); diff --git a/Usermode/Libraries/libc.so_src/include_exp/stdlib.h b/Usermode/Libraries/libc.so_src/include_exp/stdlib.h index acba0821..0dae7646 100644 --- a/Usermode/Libraries/libc.so_src/include_exp/stdlib.h +++ b/Usermode/Libraries/libc.so_src/include_exp/stdlib.h @@ -34,7 +34,6 @@ extern float atof(const char *ptr); extern void exit(int status) __attribute__((noreturn)); extern void abort(void); extern void atexit(void (*__func)(void)); -extern void qsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *)); extern int abs(int j); extern long int labs(long int j); extern long long int llabs(long long int j); @@ -42,6 +41,11 @@ extern long long int llabs(long long int j); /* --- Environment --- */ extern char *getenv(const char *name); +/* --- Search/Sort --- */ +typedef int (*_stdlib_compar_t)(const void *, const void *); +extern void *bsearch(const void *key, const void *base, size_t nmemb, size_t size, _stdlib_compar_t compar); +extern void qsort(void *base, size_t nmemb, size_t size, _stdlib_compar_t compar); + /* --- Heap --- */ extern void free(void *mem); extern void *malloc(size_t bytes); diff --git a/Usermode/Libraries/libposix.so_src/include_exp/sys/types.h b/Usermode/Libraries/libposix.so_src/include_exp/sys/types.h index c6cdc020..12238574 100644 --- a/Usermode/Libraries/libposix.so_src/include_exp/sys/types.h +++ b/Usermode/Libraries/libposix.so_src/include_exp/sys/types.h @@ -3,6 +3,8 @@ #ifndef _SYS_TYPES_H #define _SYS_TYPES_H +#include + //typedef signed int ssize_t; //#ifdef __USE_BSD typedef unsigned int u_int;