STRDUP(3ast) STRDUP(3ast)

# [NAME](#NAME)

strdup - duplicate null-terminated string

# [SYNOPSIS](#SYNOPSIS)

char* strdup(const char* s)

# [DESCRIPTION](#DESCRIPTION)

*strdup* copies the null-terminated string *s* to a new location provided by [*malloc*(3)](/man/os/ksh/malloc.3) and returns a pointer to the new copy. 0 is returned if [*malloc*(3)](/man/os/ksh/malloc.3) failed.

# [SEE ALSO](#SEE_ALSO)

[malloc(3)](/man/os/ksh/malloc.3), [memdup(3)](/man/os/ksh/memdup.3)

---

Document: strdup(3ast) from ksh 1.0.10-r36 (Chainguard OS)
Source: https://github.com/ksh93/ksh
