summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/cmd/dladm/Makefile4
-rw-r--r--usr/src/cmd/dladm/dladm.c2
-rw-r--r--usr/src/cmd/mailx/Makefile4
-rw-r--r--usr/src/cmd/mailx/hdr/def.h4
-rw-r--r--usr/src/common/brand/lx/tools/Makefile7
-rw-r--r--usr/src/common/brand/lx/tools/gen_errno.c4
-rw-r--r--usr/src/lib/Makefile8
-rw-r--r--usr/src/lib/brand/lx/lx_init/Makefile4
-rw-r--r--usr/src/lib/brand/lx/lx_init/lxinit.c4
-rw-r--r--usr/src/lib/brand/lx/lx_init/run_command.c5
-rw-r--r--usr/src/lib/libcmdutils/Makefile.com3
-rw-r--r--usr/src/lib/libcmdutils/common/mapfile-vers21
-rw-r--r--usr/src/lib/libcmdutils/libcmdutils.h56
-rw-r--r--usr/src/lib/libcustr/Makefile43
-rw-r--r--usr/src/lib/libcustr/Makefile.com38
-rw-r--r--usr/src/lib/libcustr/amd64/Makefile19
-rw-r--r--usr/src/lib/libcustr/common/custr.c (renamed from usr/src/lib/libcmdutils/common/custr.c)3
-rw-r--r--usr/src/lib/libcustr/common/libcustr.h82
-rw-r--r--usr/src/lib/libcustr/common/llib-lcustr19
-rw-r--r--usr/src/lib/libcustr/common/mapfile-vers46
-rw-r--r--usr/src/lib/libcustr/i386/Makefile18
-rw-r--r--usr/src/lib/libcustr/sparc/Makefile18
-rw-r--r--usr/src/lib/libcustr/sparcv9/Makefile19
-rw-r--r--usr/src/lib/varpd/files/Makefile.com4
-rw-r--r--usr/src/lib/varpd/files/common/libvarpd_files_json.h4
-rw-r--r--usr/src/test/libc-tests/tests/symbols/Makefile11
-rw-r--r--usr/src/test/libc-tests/tests/symbols/symbols_test.c4
27 files changed, 354 insertions, 100 deletions
diff --git a/usr/src/cmd/dladm/Makefile b/usr/src/cmd/dladm/Makefile
index 3d3c58b6e2..e68f441519 100644
--- a/usr/src/cmd/dladm/Makefile
+++ b/usr/src/cmd/dladm/Makefile
@@ -22,7 +22,7 @@
#
# Copyright 2010 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
-# Copyright 2015 Joyent, Inc.
+# Copyright 2018 Joyent, Inc.
#
PROG= dladm
@@ -40,7 +40,7 @@ XGETFLAGS += -a -x $(PROG).xcl
LDLIBS += -L$(ROOT)/lib -lsocket
LDLIBS += -ldladm -ldlpi -lkstat -lsecdb -lbsm -lofmt -linetutil -ldevinfo
-LDLIBS += $(ZLAZYLOAD) -lrstp $(ZNOLAZYLOAD) -lnsl -lumem -lcmdutils
+LDLIBS += $(ZLAZYLOAD) -lrstp $(ZNOLAZYLOAD) -lnsl -lumem -lcustr
CERRWARN += -_gcc=-Wno-switch
CERRWARN += -_gcc=-Wno-unused-label
diff --git a/usr/src/cmd/dladm/dladm.c b/usr/src/cmd/dladm/dladm.c
index 1edd13b0cb..d80e68f165 100644
--- a/usr/src/cmd/dladm/dladm.c
+++ b/usr/src/cmd/dladm/dladm.c
@@ -78,7 +78,7 @@
#include <stddef.h>
#include <stp_in.h>
#include <ofmt.h>
-#include <libcmdutils.h>
+#include <libcustr.h>
#define MAXPORT 256
#define MAXVNIC 256
diff --git a/usr/src/cmd/mailx/Makefile b/usr/src/cmd/mailx/Makefile
index 4fb19334f2..a690b95815 100644
--- a/usr/src/cmd/mailx/Makefile
+++ b/usr/src/cmd/mailx/Makefile
@@ -22,7 +22,7 @@
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# Copyright 2014 Joyent, Inc.
+# Copyright 2018 Joyent, Inc.
#
# cmd/mailx/Makefile
@@ -69,7 +69,7 @@ CERRWARN += -_gcc=-Wno-uninitialized
CERRWARN += -_gcc=-Wno-unused-variable
CERRWARN += -_gcc=-Wno-clobbered
LINTFLAGS= -hb
-LDLIBS += -lmail -lcmdutils
+LDLIBS += -lmail -lcustr
LDFLAGS += $(MAPFILE.NGB:%=-M%)
CLOBBERFILES += $(MAILXHELP)
diff --git a/usr/src/cmd/mailx/hdr/def.h b/usr/src/cmd/mailx/hdr/def.h
index 2480cb84da..a343afab38 100644
--- a/usr/src/cmd/mailx/hdr/def.h
+++ b/usr/src/cmd/mailx/hdr/def.h
@@ -20,7 +20,7 @@
*/
/*
- * Copyright 2014 Joyent, Inc.
+ * Copyright 2018 Joyent, Inc.
*/
/*
@@ -65,7 +65,7 @@ extern "C" {
#include <stdlib.h>
#include <ulimit.h>
#include <wait.h>
-#include <libcmdutils.h>
+#include <libcustr.h>
#endif
#ifdef VMUNIX
#include <sys/wait.h>
diff --git a/usr/src/common/brand/lx/tools/Makefile b/usr/src/common/brand/lx/tools/Makefile
index 5ad1240c55..2b5bb92251 100644
--- a/usr/src/common/brand/lx/tools/Makefile
+++ b/usr/src/common/brand/lx/tools/Makefile
@@ -10,7 +10,7 @@
#
#
-# Copyright 2015 Joyent, Inc.
+# Copyright 2018 Joyent, Inc.
#
PROG = gen_errno
@@ -22,6 +22,11 @@ OBJS = gen_errno.o
CLOBBERFILES += $(PROG)
NATIVECC_CFLAGS += $(CFLAGS) $(CCVERBOSE)
+# As evidenced by the use of the NATIVE_ variables, gen_errno is intended
+# to be able to run on the build host. We continue to link it against
+# libcmdutils.so instead of libcustr.so in order to allow it to run on
+# older build hosts (relying on the libcmdutil filter entries if run on
+# newer hosts with libcustr.so).
NATIVECC_LDLIBS += -lcmdutils -lnvpair
.KEEP_STATE:
diff --git a/usr/src/common/brand/lx/tools/gen_errno.c b/usr/src/common/brand/lx/tools/gen_errno.c
index 52b2d76d24..6089fed3bd 100644
--- a/usr/src/common/brand/lx/tools/gen_errno.c
+++ b/usr/src/common/brand/lx/tools/gen_errno.c
@@ -10,7 +10,7 @@
*/
/*
- * Copyright 2015 Joyent, Inc.
+ * Copyright 2018 Joyent, Inc.
*/
/*
@@ -26,7 +26,7 @@
#include <errno.h>
#include <err.h>
#include <sys/sysmacros.h>
-#include <libcmdutils.h>
+#include <libcustr.h>
#include <libnvpair.h>
nvlist_t *native_errors;
diff --git a/usr/src/lib/Makefile b/usr/src/lib/Makefile
index cf842f569b..654a35dd5d 100644
--- a/usr/src/lib/Makefile
+++ b/usr/src/lib/Makefile
@@ -22,7 +22,7 @@
#
# Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2012 by Delphix. All rights reserved.
-# Copyright 2017 Joyent, Inc.
+# Copyright 2018, Joyent, Inc.
# Copyright (c) 2013 Gary Mills
# Copyright 2014 Garrett D'Amore <garrett@damore.org>
# Copyright (c) 2015 Gary Mills
@@ -106,6 +106,7 @@ SUBDIRS += \
libcryptoutil \
libctf \
libcurses \
+ libcustr \
libdevice \
libdevid \
libdevinfo \
@@ -387,6 +388,7 @@ HDRSUBDIRS= \
libcryptoutil \
libctf \
libcurses \
+ libcustr \
libdevice \
libdevid \
libdevinfo \
@@ -580,7 +582,7 @@ dbusdeps: libsecdb libtsol libinetutil libscf libuutil libgen libsmbios
# libc libm libmd libmp libnsl libnvpair libsocket
abi: libctf libmapmalloc libproc
auditd_plugins: libbsm libsecdb libgss libmtmalloc
-brand: libzonecfg libmapmalloc libipadm libcmdutils libproc librpcsvc
+brand: libzonecfg libmapmalloc libipadm libcustr libproc librpcsvc
cfgadm_plugins: libdevice libdevinfo libhotplug librcm hbaapi libkstat libscf
fm: libexacct libipmi libzfs scsi libdevinfo libdevid libcfgadm \
libcontract libsysevent ../cmd/sgs/libelf libdladm libsff \
@@ -718,7 +720,7 @@ sun_fc: libdevinfo libsysevent
sun_sas: libdevinfo libsysevent libkstat libdevid
udapl: libdevinfo libdladm
varpd: libavl libidspace libumem libnsl libnvpair libmd5 librename \
- libbunyan libcmdutils
+ libbunyan libcustr
#
# The reason this rule checks for the existence of the
diff --git a/usr/src/lib/brand/lx/lx_init/Makefile b/usr/src/lib/brand/lx/lx_init/Makefile
index 796e89f9a8..e887e893f5 100644
--- a/usr/src/lib/brand/lx/lx_init/Makefile
+++ b/usr/src/lib/brand/lx/lx_init/Makefile
@@ -19,7 +19,7 @@
# CDDL HEADER END
#
#
-# Copyright 2015 Joyent, Inc.
+# Copyright 2018 Joyent, Inc.
#
PROG = lxinit
@@ -45,7 +45,7 @@ UTSBASE = $(SRC)/uts
CFLAGS += $(CCVERBOSE)
CPPFLAGS += -D_REENTRANT -I$(UTSBASE)/common/brand/lx
-LDLIBS += -lzonecfg -lipadm -lsocket -linetutil -lnsl -lcmdutils -ldhcpagent
+LDLIBS += -lzonecfg -lipadm -lsocket -linetutil -lnsl -lcustr -ldhcpagent
.KEEP_STATE:
diff --git a/usr/src/lib/brand/lx/lx_init/lxinit.c b/usr/src/lib/brand/lx/lx_init/lxinit.c
index 599b62a292..983318c7eb 100644
--- a/usr/src/lib/brand/lx/lx_init/lxinit.c
+++ b/usr/src/lib/brand/lx/lx_init/lxinit.c
@@ -20,7 +20,7 @@
*/
/*
- * Copyright 2017 Joyent, Inc.
+ * Copyright 2018 Joyent, Inc.
*/
/*
@@ -54,7 +54,7 @@
#include <unistd.h>
#include <libintl.h>
#include <locale.h>
-#include <libcmdutils.h>
+#include <libcustr.h>
#include <netinet/dhcp.h>
#include <dhcpagent_util.h>
diff --git a/usr/src/lib/brand/lx/lx_init/run_command.c b/usr/src/lib/brand/lx/lx_init/run_command.c
index ad00b60482..9130838625 100644
--- a/usr/src/lib/brand/lx/lx_init/run_command.c
+++ b/usr/src/lib/brand/lx/lx_init/run_command.c
@@ -10,18 +10,19 @@
*/
/*
- * Copyright 2015 Joyent, Inc.
+ * Copyright 2018 Joyent, Inc.
*/
#include <stdlib.h>
#include <stdio.h>
#include <err.h>
+#include <errno.h>
#include <strings.h>
#include <unistd.h>
#include <wait.h>
#include <sys/types.h>
#include <sys/debug.h>
-#include <libcmdutils.h>
+#include <libcustr.h>
#include "run_command.h"
#include "pipe_stream.h"
diff --git a/usr/src/lib/libcmdutils/Makefile.com b/usr/src/lib/libcmdutils/Makefile.com
index 9cb35f8795..72e7330eba 100644
--- a/usr/src/lib/libcmdutils/Makefile.com
+++ b/usr/src/lib/libcmdutils/Makefile.com
@@ -21,12 +21,13 @@
#
# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2013 RackTop Systems.
+# Copyright 2018, Joyent, Inc.
#
LIBRARY= libcmdutils.a
VERS= .1
CMD_OBJS= avltree.o sysattrs.o writefile.o process_xattrs.o uid.o gid.o \
- custr.o nicenum.o
+ nicenum.o
COM_OBJS= list.o
OBJECTS= $(CMD_OBJS) $(COM_OBJS)
diff --git a/usr/src/lib/libcmdutils/common/mapfile-vers b/usr/src/lib/libcmdutils/common/mapfile-vers
index 0ac77eb010..2a3e95f95c 100644
--- a/usr/src/lib/libcmdutils/common/mapfile-vers
+++ b/usr/src/lib/libcmdutils/common/mapfile-vers
@@ -21,6 +21,7 @@
#
# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2013 RackTop Systems.
+# Copyright 2018, Joyent, Inc.
#
#
@@ -42,16 +43,16 @@ $mapfile_version 2
SYMBOL_VERSION SUNWprivate_1.1 {
global:
add_tnode;
- custr_alloc;
- custr_alloc_buf;
- custr_append;
- custr_appendc;
- custr_append_printf;
- custr_append_vprintf;
- custr_cstr;
- custr_free;
- custr_len;
- custr_reset;
+ custr_alloc { TYPE = FUNCTION; FILTER = libcustr.so.1 };
+ custr_alloc_buf { TYPE = FUNCTION; FILTER = libcustr.so.1 };
+ custr_append { TYPE = FUNCTION; FILTER = libcustr.so.1 };
+ custr_appendc { TYPE = FUNCTION; FILTER = libcustr.so.1 };
+ custr_append_printf { TYPE = FUNCTION; FILTER = libcustr.so.1 };
+ custr_append_vprintf { TYPE = FUNCTION; FILTER = libcustr.so.1 };
+ custr_cstr { TYPE = FUNCTION; FILTER = libcustr.so.1 };
+ custr_free { TYPE = FUNCTION; FILTER = libcustr.so.1 };
+ custr_len { TYPE = FUNCTION; FILTER = libcustr.so.1 };
+ custr_reset { TYPE = FUNCTION; FILTER = libcustr.so.1 };
destroy_tree;
findnextgid;
findnextuid;
diff --git a/usr/src/lib/libcmdutils/libcmdutils.h b/usr/src/lib/libcmdutils/libcmdutils.h
index 5f9957b861..c9a61aab4d 100644
--- a/usr/src/lib/libcmdutils/libcmdutils.h
+++ b/usr/src/lib/libcmdutils/libcmdutils.h
@@ -26,7 +26,7 @@
* Copyright (c) 2013 RackTop Systems.
*/
/*
- * Copyright 2017 Joyent, Inc.
+ * Copyright 2018 Joyent, Inc.
*/
/*
@@ -162,60 +162,6 @@ extern int findnextuid(uid_t, uid_t, uid_t *);
*/
extern int findnextgid(gid_t, gid_t, gid_t *);
-
-
- /* dynamic string utilities */
-
-typedef struct custr custr_t;
-
-/*
- * Allocate and free a "custr_t" dynamic string object. Returns 0 on success
- * and -1 otherwise.
- */
-extern int custr_alloc(custr_t **);
-extern void custr_free(custr_t *);
-
-/*
- * Allocate a "custr_t" dynamic string object that operates on a fixed external
- * buffer.
- */
-extern int custr_alloc_buf(custr_t **, void *, size_t);
-
-/*
- * Append a single character, or a NUL-terminated string of characters, to a
- * dynamic string. Returns 0 on success and -1 otherwise. The dynamic string
- * will be unmodified if the function returns -1.
- */
-extern int custr_appendc(custr_t *, char);
-extern int custr_append(custr_t *, const char *);
-
-/*
- * Append a format string and arguments as though the contents were being parsed
- * through snprintf. Returns 0 on success and -1 otherwise. The dynamic string
- * will be unmodified if the function returns -1.
- */
-extern int custr_append_printf(custr_t *, const char *, ...);
-extern int custr_append_vprintf(custr_t *, const char *, va_list);
-
-/*
- * Determine the length in bytes, not including the NUL terminator, of the
- * dynamic string.
- */
-extern size_t custr_len(custr_t *);
-
-/*
- * Clear the contents of a dynamic string. Does not free the underlying
- * memory.
- */
-extern void custr_reset(custr_t *);
-
-/*
- * Retrieve a const pointer to a NUL-terminated string version of the contents
- * of the dynamic string. Storage for this string should not be freed, and
- * the pointer will be invalidated by any mutations to the dynamic string.
- */
-extern const char *custr_cstr(custr_t *str);
-
#define NN_DIVISOR_1000 (1U << 0)
/* Minimum size for the output of nicenum, including NULL */
diff --git a/usr/src/lib/libcustr/Makefile b/usr/src/lib/libcustr/Makefile
new file mode 100644
index 0000000000..19b08dc521
--- /dev/null
+++ b/usr/src/lib/libcustr/Makefile
@@ -0,0 +1,43 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2018, Joyent, Inc.
+#
+
+include $(SRC)/lib/Makefile.lib
+
+HDRS = libcustr.h
+HDRDIR = common
+
+SUBDIRS = $(MACH)
+$(BUILD64)SUBDIRS += $(MACH64)
+
+all := TARGET= all
+clean := TARGET= clean
+clobber := TARGET= clobber
+install := TARGET= install
+lint := TARGET= lint
+
+.KEEP_STATE:
+
+all clean clobber install lint: $(SUBDIRS)
+
+install_h: $(ROOTHDRS)
+
+check: $(CHECKHDRS)
+
+$(SUBDIRS): FRC
+ @cd $@; pwd; $(MAKE) $(TARGET)
+
+FRC:
+
+include $(SRC)/lib/Makefile.targ
diff --git a/usr/src/lib/libcustr/Makefile.com b/usr/src/lib/libcustr/Makefile.com
new file mode 100644
index 0000000000..747026da89
--- /dev/null
+++ b/usr/src/lib/libcustr/Makefile.com
@@ -0,0 +1,38 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2018, Joyent, Inc.
+#
+
+LIBRARY = libcustr.a
+VERS = .1
+OBJECTS = custr.o
+
+include $(SRC)/lib/Makefile.lib
+
+# Things out of /sbin like dladm require custr, so it should go into /lib so
+# they can work in case /usr is split
+include $(SRC)/lib/Makefile.rootfs
+
+LIBS = $(DYNLIB) $(LINTLIB)
+LDLIBS += -lc
+CPPFLAGS += -D__EXTENSIONS__
+
+SRCDIR = ../common
+
+.KEEP_STATE:
+
+all: $(LIBS)
+
+lint: lintcheck
+
+include $(SRC)/lib/Makefile.targ
diff --git a/usr/src/lib/libcustr/amd64/Makefile b/usr/src/lib/libcustr/amd64/Makefile
new file mode 100644
index 0000000000..4b3c5dd187
--- /dev/null
+++ b/usr/src/lib/libcustr/amd64/Makefile
@@ -0,0 +1,19 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2018, Joyent, Inc.
+#
+
+include ../Makefile.com
+include $(SRC)/lib/Makefile.lib.64
+
+install: all $(ROOTLIBS64) $(ROOTLINKS64)
diff --git a/usr/src/lib/libcmdutils/common/custr.c b/usr/src/lib/libcustr/common/custr.c
index 95d44e431f..429fedf8e9 100644
--- a/usr/src/lib/libcmdutils/common/custr.c
+++ b/usr/src/lib/libcustr/common/custr.c
@@ -19,12 +19,13 @@
#include <stdlib.h>
#include <err.h>
+#include <errno.h>
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
#include <sys/debug.h>
-#include "libcmdutils.h"
+#include "libcustr.h"
typedef enum {
CUSTR_FIXEDBUF = 0x01
diff --git a/usr/src/lib/libcustr/common/libcustr.h b/usr/src/lib/libcustr/common/libcustr.h
new file mode 100644
index 0000000000..7671390d7f
--- /dev/null
+++ b/usr/src/lib/libcustr/common/libcustr.h
@@ -0,0 +1,82 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright 2018, Joyent, Inc.
+ */
+
+#ifndef _LIBCUSTR_H
+#define _LIBCUSTR_H
+
+#include <stdarg.h>
+#include <sys/types.h>
+
+/* dynamic string utilities */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct custr custr_t;
+
+/*
+ * Allocate and free a "custr_t" dynamic string object. Returns 0 on success
+ * and -1 otherwise.
+ */
+int custr_alloc(custr_t **);
+void custr_free(custr_t *);
+
+/*
+ * Allocate a "custr_t" dynamic string object that operates on a fixed external
+ * buffer.
+ */
+int custr_alloc_buf(custr_t **, void *, size_t);
+
+/*
+ * Append a single character, or a NUL-terminated string of characters, to a
+ * dynamic string. Returns 0 on success and -1 otherwise. The dynamic string
+ * will be unmodified if the function returns -1.
+ */
+int custr_appendc(custr_t *, char);
+int custr_append(custr_t *, const char *);
+
+/*
+ * Append a format string and arguments as though the contents were being parsed
+ * through snprintf. Returns 0 on success and -1 otherwise. The dynamic string
+ * will be unmodified if the function returns -1.
+ */
+int custr_append_printf(custr_t *, const char *, ...);
+int custr_append_vprintf(custr_t *, const char *, va_list);
+
+/*
+ * Determine the length in bytes, not including the NUL terminator, of the
+ * dynamic string.
+ */
+size_t custr_len(custr_t *);
+
+/*
+ * Clear the contents of a dynamic string. Does not free the underlying
+ * memory.
+ */
+void custr_reset(custr_t *);
+
+/*
+ * Retrieve a const pointer to a NUL-terminated string version of the contents
+ * of the dynamic string. Storage for this string should not be freed, and
+ * the pointer will be invalidated by any mutations to the dynamic string.
+ */
+const char *custr_cstr(custr_t *str);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _LIBCUSTR_H */
diff --git a/usr/src/lib/libcustr/common/llib-lcustr b/usr/src/lib/libcustr/common/llib-lcustr
new file mode 100644
index 0000000000..5c08550594
--- /dev/null
+++ b/usr/src/lib/libcustr/common/llib-lcustr
@@ -0,0 +1,19 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright 2018, Joyent, Inc.
+ */
+
+/*LINTLIBRARY*/
+/*PROTOLIB1*/
+
+#include <libcustr.h>
diff --git a/usr/src/lib/libcustr/common/mapfile-vers b/usr/src/lib/libcustr/common/mapfile-vers
new file mode 100644
index 0000000000..369771929a
--- /dev/null
+++ b/usr/src/lib/libcustr/common/mapfile-vers
@@ -0,0 +1,46 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2018, Joyent, Inc.
+#
+
+#
+# MAPFILE HEADER START
+#
+# WARNING: STOP NOW. DO NOT MODIFY THIS FILE.
+# Object versioning must comply with the rules detailed in
+#
+# usr/src/lib/README.mapfiles
+#
+# You should not be making modifications here until you've read the most current
+# copy of that file. If you need help, contact a gatekeeper for guidance.
+#
+# MAPFILE HEADER END
+#
+
+$mapfile_version 2
+
+SYMBOL_VERSION ILLUMOSprivate {
+ global:
+ custr_alloc;
+ custr_alloc_buf;
+ custr_append;
+ custr_appendc;
+ custr_append_printf;
+ custr_append_vprintf;
+ custr_cstr;
+ custr_free;
+ custr_len;
+ custr_reset;
+ local:
+ *;
+};
diff --git a/usr/src/lib/libcustr/i386/Makefile b/usr/src/lib/libcustr/i386/Makefile
new file mode 100644
index 0000000000..f32d7a5b91
--- /dev/null
+++ b/usr/src/lib/libcustr/i386/Makefile
@@ -0,0 +1,18 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2018, Joyent, Inc.
+#
+
+include ../Makefile.com
+
+install: all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
diff --git a/usr/src/lib/libcustr/sparc/Makefile b/usr/src/lib/libcustr/sparc/Makefile
new file mode 100644
index 0000000000..f32d7a5b91
--- /dev/null
+++ b/usr/src/lib/libcustr/sparc/Makefile
@@ -0,0 +1,18 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2018, Joyent, Inc.
+#
+
+include ../Makefile.com
+
+install: all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
diff --git a/usr/src/lib/libcustr/sparcv9/Makefile b/usr/src/lib/libcustr/sparcv9/Makefile
new file mode 100644
index 0000000000..4b3c5dd187
--- /dev/null
+++ b/usr/src/lib/libcustr/sparcv9/Makefile
@@ -0,0 +1,19 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2018, Joyent, Inc.
+#
+
+include ../Makefile.com
+include $(SRC)/lib/Makefile.lib.64
+
+install: all $(ROOTLIBS64) $(ROOTLINKS64)
diff --git a/usr/src/lib/varpd/files/Makefile.com b/usr/src/lib/varpd/files/Makefile.com
index 1f6a7c03b1..cdd4d019a4 100644
--- a/usr/src/lib/varpd/files/Makefile.com
+++ b/usr/src/lib/varpd/files/Makefile.com
@@ -10,7 +10,7 @@
#
#
-# Copyright 2015 Joyent, Inc.
+# Copyright 2018 Joyent, Inc.
#
LIBRARY = libvarpd_files.a
@@ -22,7 +22,7 @@ include ../../../Makefile.lib
include ../../Makefile.plugin
LIBS = $(DYNLIB)
-LDLIBS += -lc -lumem -lnvpair -lsocket -lnsl -lcmdutils
+LDLIBS += -lc -lumem -lnvpair -lsocket -lnsl -lcustr
CPPFLAGS += -I../common
LINTFLAGS += -erroff=E_BAD_PTR_CAST_ALIGN
diff --git a/usr/src/lib/varpd/files/common/libvarpd_files_json.h b/usr/src/lib/varpd/files/common/libvarpd_files_json.h
index 27506e22d6..9fe765741b 100644
--- a/usr/src/lib/varpd/files/common/libvarpd_files_json.h
+++ b/usr/src/lib/varpd/files/common/libvarpd_files_json.h
@@ -10,14 +10,14 @@
*/
/*
- * Copyright 2015 Joyent, Inc.
+ * Copyright 2018 Joyent, Inc.
*/
#ifndef _LIBVARPD_FILES_JSON_H
#define _LIBVARPD_FILES_JSON_H
#include <libnvpair.h>
-#include <libcmdutils.h>
+#include <libcustr.h>
#ifdef __cplusplus
extern "C" {
diff --git a/usr/src/test/libc-tests/tests/symbols/Makefile b/usr/src/test/libc-tests/tests/symbols/Makefile
index cd499add8c..a5eef8a3a8 100644
--- a/usr/src/test/libc-tests/tests/symbols/Makefile
+++ b/usr/src/test/libc-tests/tests/symbols/Makefile
@@ -11,6 +11,7 @@
#
# Copyright 2014 Garrett D'Amore <garrett@damore.org>
+# Copyright 2018, Joyent, Inc.
#
include $(SRC)/Makefile.master
@@ -49,14 +50,8 @@ EXTRAPROG += $(SYMTESTS)
include ../Makefile.com
-#
-# Since we use libcmdutils which is LF64, we need to be LF64 even though we're
-# not using the LF64 related features at the moment, lint catches us otherwise.
-#
-CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-
-LDLIBS += -lcmdutils
-LDLIBS64 += -lcmdutils
+LDLIBS += -lcustr
+LDLIBS64 += -lcustr
$(SYMTESTS:%=$(TESTDIR)/%): $(TESTDIR)/setup
-$(RM) $@
diff --git a/usr/src/test/libc-tests/tests/symbols/symbols_test.c b/usr/src/test/libc-tests/tests/symbols/symbols_test.c
index 53e0d015de..ac92feb2b6 100644
--- a/usr/src/test/libc-tests/tests/symbols/symbols_test.c
+++ b/usr/src/test/libc-tests/tests/symbols/symbols_test.c
@@ -11,7 +11,7 @@
/*
* Copyright 2015 Garrett D'Amore <garrett@damore.org>
- * Copyright 2016 Joyent, Inc.
+ * Copyright 2018 Joyent, Inc.
*/
/*
@@ -27,7 +27,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <note.h>
-#include <libcmdutils.h>
+#include <libcustr.h>
#include <sys/wait.h>
#include "test_common.h"