projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
make sys/procfs.h mostly work on most archs
[musl]
/
include
/
stdlib.h
diff --git
a/include/stdlib.h
b/include/stdlib.h
index
27784c6
..
2d1505b
100644
(file)
--- a/
include/stdlib.h
+++ b/
include/stdlib.h
@@
-5,6
+5,8
@@
extern "C" {
#endif
extern "C" {
#endif
+#include <features.h>
+
#undef NULL
#ifdef __cplusplus
#define NULL 0
#undef NULL
#ifdef __cplusplus
#define NULL 0
@@
-22,14
+24,14
@@
long atol (const char *);
long long atoll (const char *);
double atof (const char *);
long long atoll (const char *);
double atof (const char *);
-float strtof (const char *
, char **
);
-double strtod (const char *
, char **
);
-long double strtold (const char *
, char **
);
+float strtof (const char *
__restrict, char **__restrict
);
+double strtod (const char *
__restrict, char **__restrict
);
+long double strtold (const char *
__restrict, char **__restrict
);
-long strtol (const char *
, char **
, int);
-unsigned long strtoul (const char *
, char **
, int);
-long long strtoll (const char *
, char **
, int);
-unsigned long long strtoull (const char *
, char **
, int);
+long strtol (const char *
__restrict, char **__restrict
, int);
+unsigned long strtoul (const char *
__restrict, char **__restrict
, int);
+long long strtoll (const char *
__restrict, char **__restrict
, int);
+unsigned long long strtoull (const char *
__restrict, char **__restrict
, int);
int rand (void);
void srand (unsigned);
int rand (void);
void srand (unsigned);
@@
-38,11
+40,14
@@
void *malloc (size_t);
void *calloc (size_t, size_t);
void *realloc (void *, size_t);
void free (void *);
void *calloc (size_t, size_t);
void *realloc (void *, size_t);
void free (void *);
+void *aligned_alloc(size_t alignment, size_t size);
-void abort (void);
+
_Noreturn
void abort (void);
int atexit (void (*) (void));
int atexit (void (*) (void));
-void exit (int);
-void _Exit (int);
+_Noreturn void exit (int);
+_Noreturn void _Exit (int);
+int at_quick_exit (void (*) (void));
+_Noreturn void quick_exit (int);
char *getenv (const char *);
char *getenv (const char *);
@@
-64,10
+69,10
@@
ldiv_t ldiv (long, long);
lldiv_t lldiv (long long, long long);
int mblen (const char *, size_t);
lldiv_t lldiv (long long, long long);
int mblen (const char *, size_t);
-int mbtowc (wchar_t *
, const char *
, size_t);
+int mbtowc (wchar_t *
__restrict, const char *__restrict
, size_t);
int wctomb (char *, wchar_t);
int wctomb (char *, wchar_t);
-size_t mbstowcs (wchar_t *
, const char *
, size_t);
-size_t wcstombs (char *
, const wchar_t *
, size_t);
+size_t mbstowcs (wchar_t *
__restrict, const char *__restrict
, size_t);
+size_t wcstombs (char *
__restrict, const wchar_t *__restrict
, size_t);
#define EXIT_FAILURE 1
#define EXIT_SUCCESS 0
#define EXIT_FAILURE 1
#define EXIT_SUCCESS 0
@@
-78,11
+83,18
@@
size_t wcstombs (char *, const wchar_t *, size_t);
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
- || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
+ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
+ || defined(_BSD_SOURCE)
-#ifndef WEXITSTATUS
-#include <bits/wexitstatus.h>
-#endif
+#define WNOHANG 1
+#define WUNTRACED 2
+
+#define WEXITSTATUS(s) (((s) & 0xff00) >> 8)
+#define WTERMSIG(s) ((s) & 0x7f)
+#define WSTOPSIG(s) WEXITSTATUS(s)
+#define WIFEXITED(s) (!WTERMSIG(s))
+#define WIFSTOPPED(s) (((s) & 0xff) == 0x7f)
+#define WIFSIGNALED(s) (((signed char) (((s) & 0x7f) + 1) >> 1) > 0)
int posix_memalign (void **, size_t, size_t);
int setenv (const char *, const char *, int);
int posix_memalign (void **, size_t, size_t);
int setenv (const char *, const char *, int);
@@
-95,20
+107,24
@@
int rand_r (unsigned *);
#endif
#endif
+#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
+ || defined(_BSD_SOURCE)
+char *realpath (const char *__restrict, char *__restrict);
+long int random (void);
+void srandom (unsigned int);
+char *initstate (unsigned int, char *, size_t);
+char *setstate (char *);
+#endif
+
#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
int putenv (char *);
int posix_openpt (int);
int grantpt (int);
int unlockpt (int);
char *ptsname (int);
#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
int putenv (char *);
int posix_openpt (int);
int grantpt (int);
int unlockpt (int);
char *ptsname (int);
-char *realpath (const char *, char *);
char *l64a (long);
long a64l (const char *);
void setkey (const char *);
char *l64a (long);
long a64l (const char *);
void setkey (const char *);
-long int random (void);
-void srandom (unsigned int);
-char *initstate (unsigned int, char *, size_t);
-char *setstate (char *);
double drand48 (void);
double erand48 (unsigned short [3]);
long int lrand48 (void);
double drand48 (void);
double erand48 (unsigned short [3]);
long int lrand48 (void);
@@
-120,13
+136,26
@@
unsigned short *seed48 (unsigned short [3]);
void lcong48 (unsigned short [7]);
#endif
void lcong48 (unsigned short [7]);
#endif
-#if defined(_GNU_SOURCE)
+#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
+#include <alloca.h>
char *mktemp (char *);
void *valloc (size_t);
void *memalign(size_t, size_t);
char *mktemp (char *);
void *valloc (size_t);
void *memalign(size_t, size_t);
+#define WCOREDUMP(s) ((s) & 0x80)
+#define WIFCONTINUED(s) ((s) == 0xffff)
+#endif
+
+#ifdef _GNU_SOURCE
int clearenv(void);
int clearenv(void);
+int ptsname_r(int, char *, size_t);
+char *ecvt(double, int, int *, int *);
+char *fcvt(double, int, int *, int *);
+char *gcvt(double, int, char *);
#endif
#endif
+#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
+#define mkstemp64 mkstemp
+#endif
#ifdef __cplusplus
}
#ifdef __cplusplus
}