Browse Source

add secure_getenv function

This function is a GNU extension introduced in glibc 2.17.
master
Petr Vaněk 7 years ago
committed by Rich Felker
parent
commit
7844ecb590
  1. 1
      include/stdlib.h
  2. 8
      src/env/secure_getenv.c

1
include/stdlib.h

@ -152,6 +152,7 @@ int ptsname_r(int, char *, size_t);
char *ecvt(double, int, int *, int *);
char *fcvt(double, int, int *, int *);
char *gcvt(double, int, char *);
char *secure_getenv(const char *);
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 *);

8
src/env/secure_getenv.c

@ -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);
}
Loading…
Cancel
Save