diff options
| author | Dmitry Torokhov <[email protected]> | 2023-05-01 15:20:08 -0700 | 
|---|---|---|
| committer | Dmitry Torokhov <[email protected]> | 2023-05-01 15:20:08 -0700 | 
| commit | 9a87ffc99ec8eb8d35eed7c4f816d75f5cc9662e (patch) | |
| tree | d57f3a63479a07b4e0cece029886e76e04feb984 /tools/include/nolibc/stdlib.h | |
| parent | 5dc63e56a9cf8df0b59c234a505a1653f1bdf885 (diff) | |
| parent | 53bea86b5712c7491bb3dae12e271666df0a308c (diff) | |
Merge branch 'next' into for-linus
Prepare input updates for 6.4 merge window.
Diffstat (limited to 'tools/include/nolibc/stdlib.h')
| -rw-r--r-- | tools/include/nolibc/stdlib.h | 30 | 
1 files changed, 30 insertions, 0 deletions
diff --git a/tools/include/nolibc/stdlib.h b/tools/include/nolibc/stdlib.h index 92378c4b9660..894c955d027e 100644 --- a/tools/include/nolibc/stdlib.h +++ b/tools/include/nolibc/stdlib.h @@ -12,6 +12,7 @@  #include "types.h"  #include "sys.h"  #include "string.h" +#include <linux/auxvec.h>  struct nolibc_heap {  	size_t	len; @@ -109,6 +110,32 @@ char *getenv(const char *name)  }  static __attribute__((unused)) +unsigned long getauxval(unsigned long type) +{ +	const unsigned long *auxv = _auxv; +	unsigned long ret; + +	if (!auxv) +		return 0; + +	while (1) { +		if (!auxv[0] && !auxv[1]) { +			ret = 0; +			break; +		} + +		if (auxv[0] == type) { +			ret = auxv[1]; +			break; +		} + +		auxv += 2; +	} + +	return ret; +} + +static __attribute__((unused))  void *malloc(size_t len)  {  	struct nolibc_heap *heap; @@ -419,4 +446,7 @@ char *u64toa(uint64_t in)  	return itoa_buffer;  } +/* make sure to include all global symbols */ +#include "nolibc.h" +  #endif /* _NOLIBC_STDLIB_H */  |