add secure_getenv function

This function is a GNU extension introduced in glibc 2.17.
This commit is contained in:
Petr Vaněk 2019-05-28 22:47:48 +02:00 committed by Rich Felker
parent 0847902ab9
commit 7844ecb590
2 changed files with 9 additions and 0 deletions

View File

@ -152,6 +152,7 @@ int ptsname_r(int, char *, size_t);
char *ecvt(double, int, int *, int *); char *ecvt(double, int, int *, int *);
char *fcvt(double, int, int *, int *); char *fcvt(double, int, int *, int *);
char *gcvt(double, int, char *); char *gcvt(double, int, char *);
char *secure_getenv(const char *);
struct __locale_struct; struct __locale_struct;
float strtof_l(const char *__restrict, char **__restrict, struct __locale_struct *); float strtof_l(const char *__restrict, char **__restrict, struct __locale_struct *);
double strtod_l(const char *__restrict, char **__restrict, struct __locale_struct *); double strtod_l(const char *__restrict, char **__restrict, struct __locale_struct *);

8
src/env/secure_getenv.c vendored Normal file
View File

@ -0,0 +1,8 @@
#define _GNU_SOURCE
#include <stdlib.h>
#include "libc.h"
char *secure_getenv(const char *name)
{
return libc.secure ? NULL : getenv(name);
}