diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-10-06 16:46:47 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-10-06 16:46:47 -0700 |
commit | fc437084c77ad1ab578e3933c3b9f08ea20e2d59 (patch) | |
tree | 65ccf84eedefbd1ab57abeafdab74f646345609a /system/include/libc | |
parent | ce6b7ea953dd0a974a0123e6674803a3b0b1f5a2 (diff) |
compilation and header fixes
Diffstat (limited to 'system/include/libc')
-rw-r--r-- | system/include/libc/endian.h | 3 | ||||
-rw-r--r-- | system/include/libc/stdlib.h | 2 | ||||
-rw-r--r-- | system/include/libc/string.h | 5 | ||||
-rw-r--r-- | system/include/libc/sys/resource.h | 17 |
4 files changed, 22 insertions, 5 deletions
diff --git a/system/include/libc/endian.h b/system/include/libc/endian.h new file mode 100644 index 00000000..e2ccbebb --- /dev/null +++ b/system/include/libc/endian.h @@ -0,0 +1,3 @@ + +#include "machine/endian.h" + diff --git a/system/include/libc/stdlib.h b/system/include/libc/stdlib.h index cf7fe8b9..fb94b9f8 100644 --- a/system/include/libc/stdlib.h +++ b/system/include/libc/stdlib.h @@ -198,7 +198,7 @@ int _EXFUN(unsetenv,(const char *__string)); int _EXFUN(_unsetenv_r,(struct _reent *, const char *__string)); #endif -#ifdef __rtems__ +#if defined(__rtems__) || defined(EMSCRIPTEN) int _EXFUN(posix_memalign,(void **, size_t, size_t)); #endif diff --git a/system/include/libc/string.h b/system/include/libc/string.h index 9962768c..146d602c 100644 --- a/system/include/libc/string.h +++ b/system/include/libc/string.h @@ -40,13 +40,13 @@ char *_EXFUN(strrchr,(const char *, int)); size_t _EXFUN(strspn,(const char *, const char *)); char *_EXFUN(strstr,(const char *, const char *)); -#ifndef _REENT_ONLY +#if defined(EMSCRIPTEN) || !defined(_REENT_ONLY) char *_EXFUN(strtok,(char *, const char *)); #endif size_t _EXFUN(strxfrm,(char *, const char *, size_t)); -#ifndef __STRICT_ANSI__ +#if defined(EMSCRIPTEN) || !defined(__STRICT_ANSI__) char *_EXFUN(strtok_r,(char *, const char *, char **)); int _EXFUN(bcmp,(const void *, const void *, size_t)); @@ -102,3 +102,4 @@ int _EXFUN(strtosigno, (const char *__name)); _END_STD_C #endif /* _STRING_H_ */ + diff --git a/system/include/libc/sys/resource.h b/system/include/libc/sys/resource.h index eb827552..fb5d10f2 100644 --- a/system/include/libc/sys/resource.h +++ b/system/include/libc/sys/resource.h @@ -7,9 +7,22 @@ #define RUSAGE_CHILDREN -1 /* terminated child processes */ struct rusage { - struct timeval ru_utime; /* user time used */ - struct timeval ru_stime; /* system time used */ + struct timeval ru_utime; /* user time used */ + struct timeval ru_stime; /* system time used */ + int ru_maxrss; /* XXX Emscripten */ }; +/* XXX Emscripten */ +int getrusage(int who, struct rusage *r_usage); + +/* XXX Emscripten */ +#define RLIMIT_CPU 1 +typedef unsigned rlim_t; +struct rlimit { + rlim_t rlim_cur; + rlim_t rlim_max; +}; +int setrlimit(int resource, const struct rlimit *rlim); + #endif |