rtld: provide private getenv(3)

Reviewed by:	arichardson, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D31545
This commit is contained in:
Konstantin Belousov 2021-08-16 17:02:48 +03:00
parent bfd4c875a1
commit b4b2748891
2 changed files with 7 additions and 1 deletions

View File

@ -27,7 +27,7 @@ SRCS+= rtld_libc.c
# Now build the remaining files from libc:
.PATH: ${LIBC_SRCTOP}/stdlib
SRCS+= reallocf.c realpath.c getenv.c merge.c reallocarray.c
SRCS+= reallocf.c realpath.c merge.c reallocarray.c
# TODO: fix merge.c to build with WARNS=6
.if ${COMPILER_TYPE} == "clang"
CFLAGS.merge.c+=-Wno-error=null-pointer-arithmetic

View File

@ -6027,6 +6027,12 @@ rtld_strerror(int errnum)
return (sys_errlist[errnum]);
}
char *
getenv(const char *name)
{
return (rtld_get_env_val(environ, name, strlen(name)));
}
/* malloc */
void *
malloc(size_t nbytes)