asprintf(3) Library Functions Manual asprintf(3) asprintf, vasprintf - (libc -lc) #define _GNU_SOURCE /* feature_test_macros(7) */ #include int asprintf(char **restrict strp, const char *restrict fmt, ...); int vasprintf(char **restrict strp, const char *restrict fmt, va_list ap); asprintf() vasprintf() sprintf(3) vsprintf(3) ('\0') . free(3) . sprintf(3). -1 errno strp . sprintf(3) malloc(3). attributes(7). +----------------------+------------------------------------+---------------------------------------------------------------------------------------------+ | | | | +----------------------+------------------------------------+---------------------------------------------------------------------------------------------+ |asprintf(), | | (locale) (MT-Safe) | |vasprintf() | | | +----------------------+------------------------------------+---------------------------------------------------------------------------------------------+ FreeBSD strp NULL . (BSD). free(3), malloc(3), printf(3) 3 . . : . 6.18 8 2026 asprintf(3)