mirror of
https://github.com/ziglang/zig.git
synced 2025-12-14 10:13:07 +00:00
also start prefering NtDll API. so far: * NtQueryInformationFile * NtClose adds a performance workaround for windows unicode conversion. but that should probably be removed before merging
14 lines
288 B
C
14 lines
288 B
C
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <unistd.h>
|
|
|
|
char *getenv(const char *name)
|
|
{
|
|
size_t l = __strchrnul(name, '=') - name;
|
|
if (l && !name[l] && __environ)
|
|
for (char **e = __environ; *e; e++)
|
|
if (!strncmp(name, *e, l) && l[*e] == '=')
|
|
return *e + l+1;
|
|
return 0;
|
|
}
|