summaryrefslogtreecommitdiff
path: root/usr/src/lib/libuutil/common/uu_alloc.c
diff options
context:
space:
mode:
authorLiane Praza <Liane.Praza@Sun.COM>2008-10-20 14:39:03 -0700
committerLiane Praza <Liane.Praza@Sun.COM>2008-10-20 14:39:03 -0700
commit1f6eb0216cb17ca5fdff9563329f1dda47c8b801 (patch)
treeeffd496082281578b99a9135bce175687ab2483b /usr/src/lib/libuutil/common/uu_alloc.c
parent376a7c81d94b461c5a3a73422b53976daac2bab4 (diff)
downloadillumos-joyent-1f6eb0216cb17ca5fdff9563329f1dda47c8b801.tar.gz
PSARC/2008/350 SMF Template Extensions
5100079 svccfg should use restarter-specific templates to validate services 6191768 consadm manifest does not define a stop method 6198434 service_bundle.dtd.1 claims exclude_all requires dependencies to be non-online
Diffstat (limited to 'usr/src/lib/libuutil/common/uu_alloc.c')
-rw-r--r--usr/src/lib/libuutil/common/uu_alloc.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/usr/src/lib/libuutil/common/uu_alloc.c b/usr/src/lib/libuutil/common/uu_alloc.c
index 7cdbf01750..05d8622871 100644
--- a/usr/src/lib/libuutil/common/uu_alloc.c
+++ b/usr/src/lib/libuutil/common/uu_alloc.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -20,12 +19,10 @@
* CDDL HEADER END
*/
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include "libuutil_common.h"
#include <stdarg.h>
@@ -55,6 +52,22 @@ uu_free(void *p)
}
char *
+uu_strdup(const char *str)
+{
+ char *buf = NULL;
+
+ if (str != NULL) {
+ size_t sz;
+
+ sz = strlen(str) + 1;
+ buf = uu_zalloc(sz);
+ if (buf != NULL)
+ (void) memcpy(buf, str, sz);
+ }
+ return (buf);
+}
+
+char *
uu_msprintf(const char *format, ...)
{
va_list args;