getenv(3) Library Functions Manual getenv(3) getenv, secure_getenv - C (libc, -lc) #include char *getenv(const char *name); char *secure_getenv(const char *name); glibc (. feature_test_macros(7)): secure_getenv(): _GNU_SOURCE getenv() name value. The secure_getenv() function is just like getenv() except that it returns NULL in cases where "secure execution" is required. Secure execution is required if one of the following conditions was true when the program run by the calling process was loaded: o ID ID ID ID ( set-user-ID set-group-ID); o ; o . Linux. secure_getenv() , , set-user-ID set-group-ID . getenv() NULL, . attributes(7). +----------------------------+----------------------------------------------------------+--------------------------+ | | | | +----------------------------+----------------------------------------------------------+--------------------------+ |getenv(), secure_getenv() | | MT-Safe env | +----------------------------+----------------------------------------------------------+--------------------------+ getenv() C11, POSIX.1-2008. secure_getenv() POSIX.1-2024. getenv() POSIX.1-2001, C89, C99, SVr4, 4.3BSD. secure_getenv() POSIX.1-2024, glibc 2.17. =. getenv() . , . getenv() . , getenv(), getenv() putenv(3), setenv(3) unsetenv(3). << >> secure_getenv() AT_SECURE , . clearenv(3), getauxval(3), putenv(3), setenv(3), unsetenv(3), capabilities(7), environ(7) () Azamat Hackimov , Dmitry Bolkhovskikh , Vladislav , Yuri Kozlov ; GNU (GNU General Public License - GPL, 3 ) , - . - , , () () () <>. Linux 6.17 8 2026 . getenv(3)