diff --git a/src/node_main.cc b/src/node_main.cc index e92c0df9..70be5b83 100644 --- a/src/node_main.cc +++ b/src/node_main.cc @@ -74,13 +74,7 @@ int wmain(int argc, wchar_t* wargv[]) { #else // UNIX #ifdef __linux__ -#include -#ifdef __LP64__ -#define Elf_auxv_t Elf64_auxv_t -#else -#define Elf_auxv_t Elf32_auxv_t -#endif // __LP64__ -extern char** environ; +#include #endif // __linux__ #if defined(__POSIX__) && defined(NODE_SHARED_MODE) #include @@ -109,15 +103,7 @@ int main(int argc, char* argv[]) { #endif #if defined(__linux__) - char** envp = environ; - while (*envp++ != nullptr) {} - Elf_auxv_t* auxv = reinterpret_cast(envp); - for (; auxv->a_type != AT_NULL; auxv++) { - if (auxv->a_type == AT_SECURE) { - node::per_process::linux_at_secure = auxv->a_un.a_val; - break; - } - } + node::per_process::linux_at_secure = getauxval(AT_SECURE); #endif // Disable stdio buffering, it interacts poorly with printf() // calls elsewhere in the program (e.g., any logging from V8.)