diff options
| author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2025-04-27 08:29:10 +0200 |
|---|---|---|
| committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2025-04-27 08:29:32 +0200 |
| commit | 873420ca1e6e8a2459684f5b5d3e557a8ef75928 (patch) | |
| tree | 14bfb85ab00ba8dcc3f48349ec0ff97f8001d921 /include | |
| parent | 3bef9b313be73788cd3b77d9b514d292169c442e (diff) | |
libc: Add getenv_r() function.
This is a calque of the NetBSD function of the same name.
MFC after: never
Relontes: yes
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D49979
Diffstat (limited to 'include')
| -rw-r--r-- | include/ssp/stdlib.h | 4 | ||||
| -rw-r--r-- | include/stdlib.h | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/include/ssp/stdlib.h b/include/ssp/stdlib.h index f595ecbcbc0a..0a87be9f17d9 100644 --- a/include/ssp/stdlib.h +++ b/include/ssp/stdlib.h @@ -38,6 +38,10 @@ __BEGIN_DECLS __ssp_redirect(void, arc4random_buf, (void *__buf, size_t __len), (__buf, __len)); +__ssp_redirect(int, getenv_r, + (const char *name, char * _Nonnull __buf, size_t __len), + (name, __buf, __len)); + __ssp_redirect_raw_impl(char *, realpath, realpath, (const char *__restrict path, char *__restrict buf)) { diff --git a/include/stdlib.h b/include/stdlib.h index 162031ab393d..ba0cf4b5e88e 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -95,6 +95,9 @@ div_t div(int, int) __pure2; _Noreturn void exit(int); void free(void *); char *getenv(const char *); +#if __BSD_VISIBLE +int getenv_r(const char *, char * _Nonnull, size_t); +#endif long labs(long) __pure2; ldiv_t ldiv(long, long) __pure2; void *malloc(size_t) __malloc_like __result_use_check __alloc_size(1); |
