#define UTIME_OMIT (-2)
#define WCHAR_MAX (0x7fffffff+L'\0')
#define WCHAR_MIN (-1-0x7fffffff+L'\0')
-#define WCOREDUMP(s) ((s) & 0x80)
#define WEOF 0xffffffffU
-#define WEXITSTATUS(s) (((s) & 0xff00) >> 8)
-#define WIFCONTINUED(s) ((s) == 0xffff)
-#define WIFEXITED(s) (!WTERMSIG(s))
-#define WIFSIGNALED(s) (((s)&0xffff)-1U < 0xffu)
-#define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001)>>8) > 0x7f00)
#define WILL 251
#define WINT_MAX UINT32_MAX
#define WINT_MIN 0U
-#define WNOHANG 1
#define WONT 252
#define WORD_BIT 32
#define WRQ 02
-#define WSTOPSIG(s) WEXITSTATUS(s)
-#define WTERMSIG(s) ((s) & 0x7f)
-#define WUNTRACED 2
#define W_OK 2
#define X_OK 4
#define YESEXPR 0x50000
void *realloc (void *, size_t);
void free (void *);
#endif
+#ifdef __wasilibc_unmodified_upstream /* WASI libc doesn't build the legacy functions */
void *valloc (size_t);
void *memalign(size_t, size_t);
+#endif
size_t malloc_usable_size(void *);
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
|| defined(_BSD_SOURCE)
+#ifdef __wasilibc_unmodified_upstream /* WASI has no wait */
#define WNOHANG 1
#define WUNTRACED 2
#define WIFEXITED(s) (!WTERMSIG(s))
#define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001)>>8) > 0x7f00)
#define WIFSIGNALED(s) (((s)&0xffff)-1U < 0xffu)
+#endif
int posix_memalign (void **, size_t, size_t);
int setenv (const char *, const char *, int);
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#include <alloca.h>
+#ifdef __wasilibc_unmodified_upstream /* WASI has no temp directories */
char *mktemp (char *);
int mkstemps (char *, int);
int mkostemps (char *, int, int);
+#endif
+#ifdef __wasilibc_unmodified_upstream /* WASI libc doesn't build the legacy functions */
void *valloc (size_t);
void *memalign(size_t, size_t);
int getloadavg(double *, int);
+#endif
int clearenv(void);
+#ifdef __wasilibc_unmodified_upstream /* WASI has no wait */
#define WCOREDUMP(s) ((s) & 0x80)
#define WIFCONTINUED(s) ((s) == 0xffff)
#endif
+#endif
#ifdef _GNU_SOURCE
+#ifdef __wasilibc_unmodified_upstream /* WASI has no pseudo-terminals */
int ptsname_r(int, char *, size_t);
+#endif
char *ecvt(double, int, int *, int *);
char *fcvt(double, int, int *, int *);
char *gcvt(double, int, char *);
int gettimeofday (struct timeval *__restrict, void *__restrict);
+#ifdef __wasilibc_unmodified_upstream /* WASI has no getitimer */
#define ITIMER_REAL 0
#define ITIMER_VIRTUAL 1
#define ITIMER_PROF 2
int getitimer (int, struct itimerval *);
int setitimer (int, const struct itimerval *__restrict, struct itimerval *__restrict);
+#endif
+#ifdef __wasilibc_unmodified_upstream /* WASI libc doesn't build the legacy functions */
int utimes (const char *, const struct timeval [2]);
+#endif
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
struct timezone {
int tz_minuteswest;
int tz_dsttime;
};
+#ifdef __wasilibc_unmodified_upstream /* WASI libc doesn't build the legacy functions */
int futimes(int, const struct timeval [2]);
int futimesat(int, const char *, const struct timeval [2]);
int lutimes(const char *, const struct timeval [2]);
+#endif
+#ifdef __wasilibc_unmodified_upstream /* WASI has no way to set the time */
int settimeofday(const struct timeval *, const struct timezone *);
int adjtime (const struct timeval *, struct timeval *);
+#endif
#define timerisset(t) ((t)->tv_sec || (t)->tv_usec)
#define timerclear(t) ((t)->tv_sec = (t)->tv_usec = 0)
#define timercmp(s,t,op) ((s)->tv_sec == (t)->tv_sec ? \