xref: /titanic_52/usr/src/lib/libresolv2/common/bsd/strdup.c (revision fb3fb4f3d76d55b64440afd0af72775dfad3bd1d)
1 /*
2  * Copyright (c) 1997, by Sun Microsystems, Inc.
3  * All rights reserved.
4  */
5 
6 
7 #pragma ident	"%Z%%M%	%I%	%E% SMI"
8 
9 #include "port_before.h"
10 
11 #include <stdlib.h>
12 
13 #include "port_after.h"
14 
15 #ifndef NEED_STRDUP
16 int __bind_strdup_unneeded;
17 #else
18 char *
19 strdup(const char *src) {
20 	char *dst = malloc(strlen(src) + 1);
21 
22 	if (dst)
23 		strcpy(dst, src);
24 	return (dst);
25 }
26 #endif
27