tempnam(3) Library Functions Manual tempnam(3) tempnam - LIBRARY Standard C library (libc, -lc) #include char *tempnam(const char *dir, const char *pfx); glibc (. feature_test_macros(7)): tempnam(): glibc 2.19: _DEFAULT_SOURCE glibc 2.19 : _BSD_SOURCE || _SVID_SOURCE . mkstemp(3) tmpfile(3). tempnam() , tempnam() . pfx ( , pfx -- NULL- ). , , , <<>> ( , , ). : ) TMPDIR, , . ) , dir NULL , . 3. P_tmpdir ( ), . 4. , , , . , tempnam(), malloc(3) free(3). On success, the tempnam() function returns a pointer to a unique temporary filename. It returns NULL if a unique name cannot be generated, with errno set to indicate the error. ENOMEM . attributes(7). +----------------------------+----------------------------------------------------------+--------------------------+ | | | | +----------------------------+----------------------------------------------------------+--------------------------+ |tempnam() | | MT-Safe env | +----------------------------+----------------------------------------------------------+--------------------------+ POSIX.1-2008. SVr4, 4.3BSD, POSIX.1-2001. Obsoleted in POSIX.1-2008. tempnam() , , , , , tempnam() , open(2) , . , open(2) O_EXCL. -- mkstemp(3) tmpfile(3). SUSv2 TMPDIR; glibc , set-user-ID. SVr4, 4. -- /tmp ( glibc). tempnam() , , , ( tmpnam(3)). tempnam() , TMP_MAX ( ). TMP_MAX , . tempnam() pfx. tempnam() glibc EEXIST, . <<>> . , . . mkstemp(3), mktemp(3), tmpfile(3), tmpnam(3) Azamat Hackimov , Dmitry Bolkhovskikh , Yuri Kozlov ; GNU 3 , . . , , . Linux man-pages 6.06 31 2023 . tempnam(3)