summaryrefslogtreecommitdiff
path: root/usr/src/lib/libresolv2/common/bsd/strdup.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/lib/libresolv2/common/bsd/strdup.c')
-rw-r--r--usr/src/lib/libresolv2/common/bsd/strdup.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/usr/src/lib/libresolv2/common/bsd/strdup.c b/usr/src/lib/libresolv2/common/bsd/strdup.c
new file mode 100644
index 0000000000..d92ed9e91d
--- /dev/null
+++ b/usr/src/lib/libresolv2/common/bsd/strdup.c
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 1997, by Sun Microsystems, Inc.
+ * All rights reserved.
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include "port_before.h"
+
+#include <stdlib.h>
+
+#include "port_after.h"
+
+#ifndef NEED_STRDUP
+int __bind_strdup_unneeded;
+#else
+char *
+strdup(const char *src) {
+ char *dst = malloc(strlen(src) + 1);
+
+ if (dst)
+ strcpy(dst, src);
+ return (dst);
+}
+#endif