blob: 7d13b7ec5b7a7810ab6463f188c19d528d36e98c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
.\" May be distributed under the GNU General Public License
.\" References consulted:
.\" Linux libc source code
.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
.\" 386BSD man pages
.\" Modified Sun Jul 25 10:41:34 1993 by Rik Faith (faith@cs.unc.edu)
.TH STRDUP 3 "April 12, 1993" "GNU" "Linux Programmer's Manual"
.SH NAME
strdup \- duplicate a string
.SH SYNOPSIS
.nf
.B #include <string.h>
.sp
.BI "char *strdup(const char *" s );
.fi
.SH DESCRIPTION
The \fBstrdup()\fP function returns a pointer to a new string which
is a duplicate of the string \fIs\fP. Memory for the new string is
obtained with \fBmalloc\fP(3), and can be freed with \fBfree\fP(3).
.SH "RETURN VALUE"
The \fBstrdup()\fP function returns a pointer to the duplicated
string, or NULL if insufficient memory was available.
.SH "ERRORS"
.TP
.B ENOMEM
Insufficient memory available to allocate duplicate string.
.SH "CONFORMING TO"
SVID 3, BSD 4.3
.SH SEE ALSO
.BR calloc "(3), " malloc "(3), " realloc "(3), " free (3)
|