1 .\" This file is part of the Public Domain C Library (PDCLib).
\r
2 .\" Permission is granted to use, modify, and / or redistribute at will.
\r
10 .Nd string duplication
\r
13 .Sy #define _XOPEN_SOURCE || _POSIX_C_SOURCE >= 200809L
\r
15 .Fn "char *strdup" "const char *str"
\r
17 .Sy #define _POSIX_C_SOURCE >= 200809L
\r
19 .Fn "char *strndup" "const char *str" "size_t len"
\r
23 allocates a new buffer of sufficient size as to be able to hold the entirety of
\r
25 including the terminating character, and copies the contents of
\r
31 allocates a buffer large enough to contain
\r
33 characters, plus a trailing null character, or sufficient to contain the
\r
36 including the trailing null character, whichever is smaller. The first
\r
40 are then copied into it, and a null character appended.
\r
43 The buffers returned by these functions must be released by a call to
\r
56 Moved into POSIX, and
\r