'\" t .\" Copyright 1993, David Metcalfe .\" Copyright, the authors of the Linux man-pages project .\" .\" SPDX-License-Identifier: Linux-man-pages-copyleft .\" .TH strdupa 3 2026-08-10 "Linux man-pages 6.19" .SH NAME strdupa \- string duplicate using-alloca .SH LIBRARY Standard C library .RI ( libc ,\~ \-lc ) .SH SYNOPSIS .nf .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" .B #include .P .BI "char *strdupa(const char *" s ); .fi .SH DESCRIPTION .BR strdupa () is similar to .BR strdup (3), but uses .BR alloca (3) to allocate the buffer. .P It is equivalent to .P .in +4n .EX strcpy(alloca(strlen(s) + 1), s) .EE .in .SH RETURN VALUE On success, this macro returns a pointer to the duplicated string. .SH ATTRIBUTES For an explanation of the terms used in this section, see .BR attributes (7). .TS allbox; lbx lb lb l l l. Interface Attribute Value T{ .na .nh .BR strdupa () T} Thread safety MT-Safe .TE .SH STANDARDS GNU. .SH HISTORY GNU. .SH CAVEATS See .BR alloca (3). .SH SEE ALSO .BR string (3), .BR alloca (3), .BR strdup (3)