summaryrefslogtreecommitdiff
path: root/usr/src/lib/libuutil/common
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
parent376a7c81d94b461c5a3a73422b53976daac2bab4 (diff)
downloadillumos-gate-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')
-rw-r--r--usr/src/lib/libuutil/common/libuutil.h10
-rw-r--r--usr/src/lib/libuutil/common/mapfile-vers5
-rw-r--r--usr/src/lib/libuutil/common/uu_alloc.c25
3 files changed, 25 insertions, 15 deletions
diff --git a/usr/src/lib/libuutil/common/libuutil.h b/usr/src/lib/libuutil/common/libuutil.h
index ab6b012eef..ccd46b9774 100644
--- a/usr/src/lib/libuutil/common/libuutil.h
+++ b/usr/src/lib/libuutil/common/libuutil.h
@@ -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,15 +19,13 @@
* CDDL HEADER END
*/
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _LIBUUTIL_H
#define _LIBUUTIL_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/types.h>
#include <stdarg.h>
@@ -148,6 +145,7 @@ extern int uu_open_tmp(const char *dir, uint_t uflags);
/*PRINTFLIKE1*/
extern char *uu_msprintf(const char *format, ...);
extern void *uu_zalloc(size_t);
+extern char *uu_strdup(const char *);
extern void uu_free(void *);
/*
diff --git a/usr/src/lib/libuutil/common/mapfile-vers b/usr/src/lib/libuutil/common/mapfile-vers
index 9794b33328..7d3fdb4a65 100644
--- a/usr/src/lib/libuutil/common/mapfile-vers
+++ b/usr/src/lib/libuutil/common/mapfile-vers
@@ -19,11 +19,9 @@
# CDDL HEADER END
#
#
-# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
SUNWprivate_1.1 {
global:
@@ -87,6 +85,7 @@ SUNWprivate_1.1 {
uu_msprintf;
uu_open_tmp;
uu_setpname;
+ uu_strdup;
uu_strerror;
uu_strtoint;
uu_strtouint;
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;