summaryrefslogtreecommitdiff
path: root/usr/src/lib/libnls
diff options
context:
space:
mode:
authorstevel@tonic-gate <none@none>2005-06-14 00:00:00 -0700
committerstevel@tonic-gate <none@none>2005-06-14 00:00:00 -0700
commit7c478bd95313f5f23a4c958a745db2134aa03244 (patch)
treec871e58545497667cbb4b0a4f2daf204743e1fe7 /usr/src/lib/libnls
downloadillumos-joyent-7c478bd95313f5f23a4c958a745db2134aa03244.tar.gz
OpenSolaris Launch
Diffstat (limited to 'usr/src/lib/libnls')
-rw-r--r--usr/src/lib/libnls/Makefile82
-rw-r--r--usr/src/lib/libnls/Makefile.com68
-rw-r--r--usr/src/lib/libnls/amd64/Makefile40
-rw-r--r--usr/src/lib/libnls/common/llib-lnls34
-rw-r--r--usr/src/lib/libnls/common/nlsdata.c35
-rw-r--r--usr/src/lib/libnls/common/nlsenv.c230
-rw-r--r--usr/src/lib/libnls/common/nlsrequest.c133
-rw-r--r--usr/src/lib/libnls/i386/Makefile38
-rw-r--r--usr/src/lib/libnls/sparc/Makefile38
-rw-r--r--usr/src/lib/libnls/sparcv9/Makefile41
-rw-r--r--usr/src/lib/libnls/spec/Makefile29
-rw-r--r--usr/src/lib/libnls/spec/Makefile.targ34
-rw-r--r--usr/src/lib/libnls/spec/amd64/Makefile44
-rw-r--r--usr/src/lib/libnls/spec/i386/Makefile43
-rw-r--r--usr/src/lib/libnls/spec/nls.spec78
-rw-r--r--usr/src/lib/libnls/spec/sparc/Makefile43
-rw-r--r--usr/src/lib/libnls/spec/sparcv9/Makefile44
-rw-r--r--usr/src/lib/libnls/spec/versions46
18 files changed, 1100 insertions, 0 deletions
diff --git a/usr/src/lib/libnls/Makefile b/usr/src/lib/libnls/Makefile
new file mode 100644
index 0000000000..90b52272da
--- /dev/null
+++ b/usr/src/lib/libnls/Makefile
@@ -0,0 +1,82 @@
+#
+# 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.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (c) 1997, by Sun Microsystems, Inc.
+# All rights reserved.
+#
+#ident "%Z%%M% %I% %E% SMI"
+#
+# lib/libnls/Makefile
+
+include ../../Makefile.master
+
+SUBDIRS= spec .WAIT $(MACH) $(BUILD64) $(MACH64)
+
+all := TARGET= all
+clean := TARGET= clean
+clobber := TARGET= clobber
+delete := TARGET= delete
+install := TARGET= install
+lint := TARGET= lint
+_msg := TARGET= _msg
+package := TARGET= package
+
+LIBRARY= libnls.a
+TEXT_DOMAIN= SUNW_OST_OSLIB
+XGETFLAGS= -a
+POFILE= $(LIBRARY:.a=.po)
+POFILES= generic.po
+
+SED= sed
+GREP= grep
+CP= cp
+
+.KEEP_STATE:
+
+all clean clobber delete install lint package: $(SUBDIRS)
+
+# install rule for install_h target
+$(ROOTHDRDIR)/%: %
+ $(INS.file)
+
+install_h: $(ROOTHDRS)
+
+check: $(CHECKHDRS)
+
+$(MACH) $(MACH64) spec: FRC
+ @cd $@; pwd; $(MAKE) $(TARGET)
+
+_msg: $(MSGDOMAIN) $(POFILE)
+ $(RM) $(MSGDOMAIN)/$(POFILE)
+ $(CP) $(POFILE) $(MSGDOMAIN)
+
+$(POFILE): $(POFILES)
+ $(RM) $@
+ $(CAT) $(POFILES) > $@
+
+$(POFILES):
+ $(RM) messages.po
+ $(XGETTEXT) $(XGETFLAGS) *.[ch]* */*.[ch]*
+ $(SED) -e '/^# msg/d' -e '/^domain/d' messages.po > $@
+ $(RM) messages.po
+
+FRC:
diff --git a/usr/src/lib/libnls/Makefile.com b/usr/src/lib/libnls/Makefile.com
new file mode 100644
index 0000000000..2ca52e72c2
--- /dev/null
+++ b/usr/src/lib/libnls/Makefile.com
@@ -0,0 +1,68 @@
+#
+# 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.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+#
+# lib/libnls/Makefile.com
+#
+
+LIBRARY= libnls.a
+VERS= .1
+
+OBJECTS= nlsdata.o nlsenv.o nlsrequest.o
+
+# include library definitions
+include ../../Makefile.lib
+
+MAPFILE= $(MAPDIR)/mapfile
+SRCS= $(OBJECTS:%.o=../common/%.c)
+
+LIBS = $(DYNLIB) $(LINTLIB)
+
+LINTSRC= $(LINTLIB:%.ln=%)
+
+CFLAGS += $(CCVERBOSE)
+DYNFLAGS += -M $(MAPFILE)
+LDLIBS += -lnsl -lc
+
+.KEEP_STATE:
+
+lint: lintcheck
+
+$(MAPFILE):
+ @cd $(MAPDIR); $(MAKE) mapfile
+
+$(DYNLIB): $(MAPFILE)
+
+# include library targets
+include ../../Makefile.targ
+
+pics/%.o: ../common/%.c
+ $(COMPILE.c) -o $@ $<
+ $(POST_PROCESS_O)
+
+# install rule for lint library target
+$(ROOTLINTDIR)/%: ../common/%
+ $(INS.file)
diff --git a/usr/src/lib/libnls/amd64/Makefile b/usr/src/lib/libnls/amd64/Makefile
new file mode 100644
index 0000000000..29ebb8f58b
--- /dev/null
+++ b/usr/src/lib/libnls/amd64/Makefile
@@ -0,0 +1,40 @@
+#
+# 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.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+#
+
+MAPDIR= ../spec/amd64
+
+include ../Makefile.com
+include ../../Makefile.lib.64
+
+LIBS= $(DYNLIB) $(LINTLIB)
+
+.KEEP_STATE:
+
+all: $(LIBS)
+
+install: all $(ROOTLIBS64) $(ROOTLINKS64)
diff --git a/usr/src/lib/libnls/common/llib-lnls b/usr/src/lib/libnls/common/llib-lnls
new file mode 100644
index 0000000000..6dc0e03b3a
--- /dev/null
+++ b/usr/src/lib/libnls/common/llib-lnls
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/* LINTLIBRARY */
+/* PROTOLIB1 */
+
+/*
+ * Copyright (c) 1997 by Sun Microsystems, Inc.
+ * All rights reserved.
+ */
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * usr/src/lib/libnls
+ */
diff --git a/usr/src/lib/libnls/common/nlsdata.c b/usr/src/lib/libnls/common/nlsdata.c
new file mode 100644
index 0000000000..7616be8f6b
--- /dev/null
+++ b/usr/src/lib/libnls/common/nlsdata.c
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
+/* All Rights Reserved */
+
+
+#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.3 */
+
+/*
+ * data used by network listener service library routines
+ */
+
+#include "sys/tiuser.h"
+
+int _nlslog; /* non-zero allows use of stderr for messages */
+struct t_call *_nlscall; /* call struct allocated by routines */
diff --git a/usr/src/lib/libnls/common/nlsenv.c b/usr/src/lib/libnls/common/nlsenv.c
new file mode 100644
index 0000000000..45c5f9f760
--- /dev/null
+++ b/usr/src/lib/libnls/common/nlsenv.c
@@ -0,0 +1,230 @@
+/*
+ * 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.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
+/* All Rights Reserved */
+
+
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * nlsenv.c:
+ *
+ * Utilities for servers to access environment set by listener.
+ *
+ * nlsgetcall: Returns pointer to t_call structure listener recieved during
+ * the t_listen. Gets data from environment and converts
+ * the data to internal address form.
+ *
+ * nlsprovider: Returns name of provider from environment.
+ *
+ */
+
+#include <ctype.h>
+#include <strings.h>
+#include <sys/tiuser.h>
+#include "listen.h"
+
+/*
+ * define DEBUGMODE for diagnostic printf's to stderr
+ */
+
+/* #define DEBUGMODE */
+
+#ifdef DEBUGMODE
+#include <stdio.h>
+#endif
+
+/*
+ * nlsenv: (static)
+ *
+ * Given an environment variable name, a receiving buffer and the length
+ * of the receiving buffer, getenv gets the environment variable, decodes
+ * it and places the decoded data in addr. The return value is the length
+ * of "addr" if succesful, or a negative value if unsuccessful.
+ */
+
+extern char *getenv();
+
+int
+nlsenv(struct netbuf *buf, char *envname)
+{
+ char *charaddr;
+ extern char *calloc();
+ extern int nlsc2addr();
+ int length;
+
+ if (!(charaddr = getenv(envname)))
+ return(-11);
+
+#ifdef DEBUGMODE
+ fprintf(stderr, "nlsenv: environ %s = %s len = %d\n",
+ envname, charaddr, strlen(charaddr));
+#endif
+
+ if ((int)strlen(charaddr) & 1)
+ return(-12);
+
+ length = (strlen(charaddr) + 1) / 2;
+ if (!(buf->buf = calloc(1, length)))
+ return(-13);
+ else
+ buf->maxlen = length;
+ return(nlsc2addr(buf->buf, buf->maxlen, charaddr));
+}
+
+
+/*
+ * nlsgetcall: Get calling data provided by the client via the listener.
+ *
+ * nlsgetcall allows network server processes started by the
+ * network listener process to access the callers 't_call'
+ * structure provided in the client's t_connect primitive.
+ *
+ * This routine gets this data from the environment
+ * via putenv(3C), interprets the data and places the data
+ * in a t_call structure allocated via t_alloc.
+ *
+ * synopsis:
+ *
+ * struct t_call *nlsgetcall(fd);
+ * int fd; arg now ignored
+ *
+ *
+ * returns: Address of an allocated t_call structure
+ * or
+ * NULL for failure. (calloc failed)
+ * If calloc succeeds, non-existant
+ * env. variables or data is indicated
+ * by a negative 'len' field in the approp.
+ * netbuf structure. A length of zero in the
+ * netbuf structure is valid.
+ *
+ */
+
+struct t_call *
+nlsgetcall(int fd)
+{
+ struct t_call *call;
+ extern char *calloc();
+
+ if (!(call = (struct t_call *) calloc(1, sizeof(struct t_call))))
+ return((struct t_call *)0);
+
+/*
+ * Note: space for buffers gets allocated by nlsenv on the fly
+ */
+
+ call->addr.len = nlsenv(&call->addr, NLSADDR);
+ call->opt.len = nlsenv(&call->opt, NLSOPT);
+ call->udata.len = nlsenv(&call->udata, NLSUDATA);
+
+ return (call);
+}
+
+
+/*
+ * nlsprovider: Return the name of the transport provider
+ * as placed in the environment by the Network listener
+ * process. If the variable is not defined in the
+ * environment, a NULL pointer is returned.
+ *
+ * If the provider is "/dev/starlan", nlsprovider
+ * returns a pointer to the null terminated character string:
+ * "/dev/starlan" if this calling process is a child of the
+ * network listener process.
+ */
+
+char *
+nlsprovider()
+{
+ return(getenv(NLSPROVIDER));
+}
+
+
+/*
+ * nlsc2addr: Convert external address to internal form.
+ * (from nlsaddr.c)
+ */
+
+/*
+ * asctohex(X): convert char X to integer value
+ * assumes isxdigit(X). returns integer value.
+ * Note that 'a' > 'A'. See usage in code below.
+ */
+
+#define asctohex(X) \
+ ((int)(isdigit(X) ? (int)(X-'0') : (X>='a') ? (X-'a')+10 : (X-'A')+10))
+
+/*
+ * nlsc2addr: Given a buffer containing the hex/ascii representation
+ * of a logical address, the buffer's size and an address
+ * of a receiving buffer, char2addr converts the logical
+ * addr to internal format and returns the size of the logical
+ * address. A negative value is returned and the receiving
+ * buffers contents are undefined if:
+ *
+ * A. The receiving buffer is not large enough. (rc = -1)
+ * B. If 'charaddr' does not contain a series of octets
+ * (strlen(charaddr) must be even). (rc = -2)
+ * C. Any character in 'charaddr' is not an ASCII hex digit.
+ * (rc = -3)
+ *
+ * NOTE: that even if the internal representation of an address is
+ * an ASCII string, there is no guarantee that the output will be
+ * null terminated, thus the returned length must be used when
+ * accessing the internal address.
+ */
+
+
+int
+nlsc2addr(char *addr, int maxlen, char *charaddr)
+{
+ int len;
+ int i;
+ char c;
+ unsigned char val;
+
+ if (strlen(charaddr) & 1)
+ return(-1);
+
+ for (len = 0; ((maxlen--) && (*charaddr)); ++len) {
+ for (i = 2, val = 0; i--; ) {
+ c = *charaddr++;
+ if (!(isxdigit(c)))
+ return(-3);
+ val = (val << 4) | (unsigned char)asctohex(c);
+ }
+
+ *addr++ = (char)val;
+ }
+
+#ifdef DEBUGMODE
+ fprintf(stderr, "nlsc2addr: returned length = %d\n", len);
+#endif
+
+ return(*charaddr ? -2 : len);
+}
diff --git a/usr/src/lib/libnls/common/nlsrequest.c b/usr/src/lib/libnls/common/nlsrequest.c
new file mode 100644
index 0000000000..547aeff2f2
--- /dev/null
+++ b/usr/src/lib/libnls/common/nlsrequest.c
@@ -0,0 +1,133 @@
+/*
+ * 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.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
+/* All Rights Reserved */
+
+
+#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.5.1.1 */
+
+/*
+ *
+ * nlsrequest(3):
+ *
+ * Send service request message to remote listener
+ * on previously established virtual circuit to remote
+ * listener process.
+ *
+ * If an error occurrs, t_errno will contain an error code.
+ *
+ * Setting the external integer "_nlslog" to any non-zero
+ * value before calling nlsrequest, will cause nlsrequest
+ * to print debug information on stderr.
+ *
+ * client/server process pairs should include their own
+ * initial handshake to insure connectivity.
+ *
+ * This version of nlsrequest includes the
+ * service request response message.
+ */
+
+
+#include <stdio.h>
+#include <ctype.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <string.h>
+#include <stdlib.h>
+#include <sys/tiuser.h>
+#include "listen.h"
+
+extern int _nlslog; /* non-zero allows use of stderr */
+char *_nlsrmsg = (char *)0;
+static char _nlsbuf[256];
+
+
+int
+nlsrequest(int fd, char *svc_code)
+{
+ int len, err, flags;
+ char buf[256];
+ char *p;
+ int version, ret;
+ extern int t_errno;
+
+ t_errno = 0; /* indicates a 'name' problem */
+ buf[0] = 0;
+
+ /*
+ * Validate service code
+ */
+
+ if (!svc_code || !strlen(svc_code) ||
+ (strlen(svc_code) >= (size_t)SVC_CODE_SZ)) {
+ if (_nlslog)
+ fprintf(stderr, "nlsrequest: invalid service code format\n");
+ return(-1);
+ }
+
+ /*
+ * send protocol message requesting the service
+ */
+
+ len = sprintf(buf, nls_v2_msg, svc_code)+1;/* inc trailing null */
+
+ if (t_snd(fd, buf, len, 0) < len) {
+ if (_nlslog)
+ t_error("t_snd of listener request message failed");
+ return(-1);
+ }
+
+ p = _nlsbuf;
+ len = 0;
+
+ do {
+ if (++len > sizeof(_nlsbuf)) {
+ if (_nlslog)
+ fprintf(stderr, "nlsrequest: _nlsbuf not large enough\n");
+ return(-1);
+ }
+ if (t_rcv(fd, p, sizeof(char), &flags) != sizeof(char)) {
+ if (_nlslog)
+ t_error("t_rcv of listener response msg failed");
+ return(-1);
+ }
+
+ } while (*p++ != '\0');
+
+
+ if ((p = strtok(_nlsbuf, ":")) == (char *)0)
+ goto parsefail;
+ version = atoi(p);
+
+ if ((p = strtok((char *)0, ":")) == (char *)0)
+ goto parsefail;
+ ret = atoi(p);
+ _nlsrmsg = p + strlen(p) + 1;
+ if (ret && _nlslog)
+ fprintf(stderr, "%s\n", _nlsrmsg); /* debug only */
+ return(ret);
+
+parsefail:
+ if (_nlslog)
+ fprintf(stderr, "nlsrequest: failed parse of response message\n");
+ return(-1);
+}
diff --git a/usr/src/lib/libnls/i386/Makefile b/usr/src/lib/libnls/i386/Makefile
new file mode 100644
index 0000000000..6e3d767267
--- /dev/null
+++ b/usr/src/lib/libnls/i386/Makefile
@@ -0,0 +1,38 @@
+#
+# 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.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (c) 1997-2000 by Sun Microsystems, Inc.
+# All rights reserved.
+#
+#pragma ident "%Z%%M% %I% %E% SMI"
+#
+# lib/libnls/i386/Makefile
+
+MAPDIR= ../spec/i386
+
+include ../Makefile.com
+
+.KEEP_STATE:
+
+all: $(LIBS)
+
+install: all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
diff --git a/usr/src/lib/libnls/sparc/Makefile b/usr/src/lib/libnls/sparc/Makefile
new file mode 100644
index 0000000000..2064733355
--- /dev/null
+++ b/usr/src/lib/libnls/sparc/Makefile
@@ -0,0 +1,38 @@
+#
+# 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.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (c) 1997-2000 by Sun Microsystems, Inc.
+# All rights reserved.
+#
+#pragma ident "%Z%%M% %I% %E% SMI"
+#
+# lib/libnls/sparc/Makefile
+
+MAPDIR= ../spec/sparc
+
+include ../Makefile.com
+
+.KEEP_STATE:
+
+all: $(LIBS)
+
+install: all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
diff --git a/usr/src/lib/libnls/sparcv9/Makefile b/usr/src/lib/libnls/sparcv9/Makefile
new file mode 100644
index 0000000000..191668cd5c
--- /dev/null
+++ b/usr/src/lib/libnls/sparcv9/Makefile
@@ -0,0 +1,41 @@
+#
+# 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.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (c) 1998-2000 by Sun Microsystems, Inc.
+# All rights reserved.
+#
+#pragma ident "%Z%%M% %I% %E% SMI"
+#
+# lib/libnls/sparcv9/Makefile
+
+MAPDIR= ../spec/sparcv9
+
+include ../Makefile.com
+include ../../Makefile.lib.64
+
+LIBS= $(DYNLIB) $(LINTLIB)
+
+.KEEP_STATE:
+
+all: $(LIBS)
+
+install: all $(ROOTLIBS64) $(ROOTLINKS64)
diff --git a/usr/src/lib/libnls/spec/Makefile b/usr/src/lib/libnls/spec/Makefile
new file mode 100644
index 0000000000..440aa5d46d
--- /dev/null
+++ b/usr/src/lib/libnls/spec/Makefile
@@ -0,0 +1,29 @@
+#
+# 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.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#ident "%W% %E% SMI"
+#
+# Copyright (c) 1998-2000 by Sun Microsystems, Inc.
+# All rights reserved.
+#
+# lib/libnls/spec/Makefile
+
+include $(SRC)/lib/Makefile.spec.arch
diff --git a/usr/src/lib/libnls/spec/Makefile.targ b/usr/src/lib/libnls/spec/Makefile.targ
new file mode 100644
index 0000000000..a425f94e50
--- /dev/null
+++ b/usr/src/lib/libnls/spec/Makefile.targ
@@ -0,0 +1,34 @@
+#
+# 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.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#ident "%W% %E% SMI"
+#
+# Copyright (c) 1998-2000 by Sun Microsystems, Inc.
+# All rights reserved.
+#
+# lib/libnls/spec/Makefile.targ
+
+LIBRARY = libnls.a
+VERS = .1
+
+OBJECTS = nls.o
+
+SPECCPP =
diff --git a/usr/src/lib/libnls/spec/amd64/Makefile b/usr/src/lib/libnls/spec/amd64/Makefile
new file mode 100644
index 0000000000..a1ab35dfb4
--- /dev/null
+++ b/usr/src/lib/libnls/spec/amd64/Makefile
@@ -0,0 +1,44 @@
+#
+# 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.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+#
+
+.KEEP_STATE:
+
+include ../Makefile.targ
+
+# Add arch specific objects here
+OBJECTS +=
+
+include $(SRC)/lib/Makefile.lib
+include $(SRC)/lib/Makefile.lib.64
+
+# Uncomment the following if the linker complains
+#amd64_C_PICFLAGS = $(amd64_C_BIGPICFLAGS)
+
+include $(SRC)/lib/Makefile.spec
+
+install: $(ROOTABILIB64)
diff --git a/usr/src/lib/libnls/spec/i386/Makefile b/usr/src/lib/libnls/spec/i386/Makefile
new file mode 100644
index 0000000000..c7c14867b3
--- /dev/null
+++ b/usr/src/lib/libnls/spec/i386/Makefile
@@ -0,0 +1,43 @@
+#
+# 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.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#ident "%W% %E% SMI"
+#
+# Copyright (c) 1998-2000 by Sun Microsystems, Inc.
+# All rights reserved.
+#
+# lib/libadm/spec/sparc/Makefile
+
+.KEEP_STATE:
+
+include ../Makefile.targ
+
+# Add arch specific objects here
+OBJECTS +=
+
+include $(SRC)/lib/Makefile.lib
+
+# Uncomment the following if the linker complains
+#sparc_C_PICFLAGS = -K PIC
+
+include $(SRC)/lib/Makefile.spec
+
+install: $(ROOTABILIB)
diff --git a/usr/src/lib/libnls/spec/nls.spec b/usr/src/lib/libnls/spec/nls.spec
new file mode 100644
index 0000000000..a494450df9
--- /dev/null
+++ b/usr/src/lib/libnls/spec/nls.spec
@@ -0,0 +1,78 @@
+#
+# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# 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.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#ident "%W% %E% SMI"
+#
+# lib/libnls/spec/nls.spec
+
+Data _lib_version
+Version SUNWprivate_1.1
+Arch all
+End
+
+Data _nlscall
+Version SUNWprivate_1.1
+Arch all
+End
+
+Data _nlslog
+Version SUNWprivate_1.1
+Arch all
+End
+
+Data _nlsrmsg
+Version SUNWprivate_1.1
+Arch all
+End
+
+Function nlsc2addr
+Version SUNWprivate_1.1
+Arch all
+End
+
+Function nlsenv
+Version SUNWprivate_1.1
+Arch all
+End
+
+Function nlsgetcall
+Include <sys/tiuser.h>
+Declaration struct t_call *nlsgetcall(int fildes)
+Version SUNW_1.1
+Arch all
+End
+
+Function nlsprovider
+Declaration char *nlsprovider(void)
+Version SUNW_1.1
+Arch all
+End
+
+Function nlsrequest
+Include <listen.h>
+Declaration int nlsrequest(int fildes, char *service_code)
+Version SUNW_1.1
+Arch all
+End
+
diff --git a/usr/src/lib/libnls/spec/sparc/Makefile b/usr/src/lib/libnls/spec/sparc/Makefile
new file mode 100644
index 0000000000..c7c14867b3
--- /dev/null
+++ b/usr/src/lib/libnls/spec/sparc/Makefile
@@ -0,0 +1,43 @@
+#
+# 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.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#ident "%W% %E% SMI"
+#
+# Copyright (c) 1998-2000 by Sun Microsystems, Inc.
+# All rights reserved.
+#
+# lib/libadm/spec/sparc/Makefile
+
+.KEEP_STATE:
+
+include ../Makefile.targ
+
+# Add arch specific objects here
+OBJECTS +=
+
+include $(SRC)/lib/Makefile.lib
+
+# Uncomment the following if the linker complains
+#sparc_C_PICFLAGS = -K PIC
+
+include $(SRC)/lib/Makefile.spec
+
+install: $(ROOTABILIB)
diff --git a/usr/src/lib/libnls/spec/sparcv9/Makefile b/usr/src/lib/libnls/spec/sparcv9/Makefile
new file mode 100644
index 0000000000..81d78b5cb2
--- /dev/null
+++ b/usr/src/lib/libnls/spec/sparcv9/Makefile
@@ -0,0 +1,44 @@
+#
+# 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.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#ident "%W% %E% SMI"
+#
+# Copyright (c) 1998-2000 by Sun Microsystems, Inc.
+# All rights reserved.
+#
+# lib/libadm/spec/sparc/Makefile
+
+.KEEP_STATE:
+
+include ../Makefile.targ
+
+# Add arch specific objects here
+OBJECTS +=
+
+include $(SRC)/lib/Makefile.lib
+include $(SRC)/lib/Makefile.lib.64
+
+# Uncomment the following if the linker complains
+#sparcv9_C_PICFLAGS = -K PIC
+
+include $(SRC)/lib/Makefile.spec
+
+install: $(ROOTABILIB64)
diff --git a/usr/src/lib/libnls/spec/versions b/usr/src/lib/libnls/spec/versions
new file mode 100644
index 0000000000..7b49152118
--- /dev/null
+++ b/usr/src/lib/libnls/spec/versions
@@ -0,0 +1,46 @@
+#
+# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# 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.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# ident "%Z%%M% %I% %E% SMI"
+#
+
+sparc {
+ SUNW_1.1;
+ SUNWprivate_1.1;
+}
+
+sparcv9 {
+ SUNW_1.1;
+ SUNWprivate_1.1;
+}
+
+i386 {
+ SUNW_1.1;
+ SUNWprivate_1.1;
+}
+
+amd64 {
+ SUNW_1.1;
+ SUNWprivate_1.1;
+}