NAME
wcsdup — duplicate
a wide-character string
SYNOPSIS
wchar_t *wcsdup(const wchar_t *string);
DESCRIPTION
The wcsdup () function is the
wide-character equivalent of the strdup(3) function.
The wcsdup () function shall
return a pointer to a new wide-character string, allocated as if by a call
to malloc(3), which is the duplicate of the wide-character
string string. The
returned pointer can be passed to free(3). A null pointer
is returned if the new wide-character string cannot be created.
RETURN VALUE
Upon successful completion, the wcsdup ()
function shall return a pointer to the newly allocated wide-character
string. Otherwise, it shall return a null pointer and set
errno to
indicate the error.
ERRORS
The wcsdup () function shall fail if:
- [ENOMEM]
- Memory large enough for the duplicate string could not be allocated.
EXAMPLES
None.
APPLICATION USAGE
For functions that allocate memory as if by
malloc(3), the application should release such memory when
it is no longer required by a call to free(3). For
wcsdup (), this is the return value.
RATIONALE
None.
FUTURE DIRECTIONS
None.
SEE ALSO
free(3) , strdup(3) , wcscpy(3)
XBD <wchar.h>
CHANGE HISTORY
First released in Issue 7.