--- old/usr/src/head/Makefile	Wed Oct 28 00:34:09 2015
+++ new/usr/src/head/Makefile	Wed Oct 28 00:34:09 2015
@@ -19,7 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
+# Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
 #
 # Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
@@ -147,6 +147,7 @@
 	prof.h		\
 	project.h	\
 	pthread.h	\
+	pty.h		\
 	pw.h		\
 	pwd.h		\
 	rctl.h		\
--- /dev/null	Wed Oct 28 00:34:09 2015
+++ new/usr/src/head/pty.h	Wed Oct 28 00:34:09 2015
@@ -0,0 +1,39 @@
+/*
+ * 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 2015 Nexenta Systems, Inc. All rights reserved.
+ */
+
+#ifndef _PTY_H
+#define	_PTY_H
+
+#include <termios.h>
+#include <sys/ioctl.h>
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+/*
+ * Pseudo-terminal functions.
+ */
+extern int openpty(int *, int *, char *, const struct termios *,
+    const struct winsize *);
+extern int forkpty(int *, char *, const struct termios *,
+    const struct winsize *);
+extern int login_tty(int);
+
+#ifdef	__cplusplus
+}
+#endif
+
+#endif /* _PTY_H */
--- old/usr/src/lib/libc/amd64/Makefile	Wed Oct 28 00:34:10 2015
+++ new/usr/src/lib/libc/amd64/Makefile	Wed Oct 28 00:34:10 2015
@@ -494,6 +494,7 @@
 	psiginfo.o		\
 	psignal.o		\
 	pt.o			\
+	pty.o			\
 	putpwent.o		\
 	putspent.o		\
 	raise.o			\
--- old/usr/src/lib/libc/i386/Makefile.com	Wed Oct 28 00:34:10 2015
+++ new/usr/src/lib/libc/i386/Makefile.com	Wed Oct 28 00:34:10 2015
@@ -527,6 +527,7 @@
 	psiginfo.o		\
 	psignal.o		\
 	pt.o			\
+	pty.o			\
 	putpwent.o		\
 	putspent.o		\
 	raise.o			\
--- /dev/null	Wed Oct 28 00:34:10 2015
+++ new/usr/src/lib/libc/port/gen/pty.c	Wed Oct 28 00:34:10 2015
@@ -0,0 +1,155 @@
+/*
+ * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+ * Copyright (c) 1990, 1993, 1994
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#include <sys/types.h>
+#include <stropts.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <grp.h>
+#include <stdlib.h>
+#include <string.h>
+#include <termios.h>
+#include <unistd.h>
+#include <limits.h>
+
+int
+openpty(int *amaster, int *aslave, char *name, const struct termios *termp,
+    const struct winsize *winp)
+{
+	const char *slavename;
+	int master, slave;
+	int err;
+
+	if ((master = open("/dev/ptmx", O_RDWR|O_NOCTTY)) == -1)
+		return (-1);
+
+	if (grantpt(master) == -1)
+		goto bad;
+
+	if (unlockpt(master) == -1)
+		goto bad;
+
+	slavename = ptsname(master);
+	if (slavename == NULL) {
+		goto bad;
+	}
+
+	if ((slave = open(slavename, O_RDWR)) == -1)
+		goto bad;
+
+	if (ioctl(slave, I_PUSH, "ptem") < 0 ||
+	    ioctl(slave, I_PUSH, "ldterm") < 0 ||
+	    ioctl(slave, I_PUSH, "ttcompat") < 0) {
+		goto bad;
+	}
+
+	if (termp != NULL) {
+		if (tcsetattr(slave, TCSAFLUSH, termp) != 0) {
+			goto bad;
+		}
+	}
+	if (winp != NULL) {
+		if (ioctl(slave, TIOCSWINSZ, winp) != 0)
+			goto bad;
+	}
+
+	*amaster = master;
+	*aslave = slave;
+
+	if (name != NULL)
+		(void) strncpy(name, slavename, TTYNAME_MAX);
+	return (0);
+
+bad:
+	err = errno;
+	if (master != -1)
+		(void) close(master);
+	if (slave != -1)
+		(void) close(slave);
+	errno = err;  /* restore the original value of errno */
+	return (-1);
+}
+
+int
+login_tty(int fd)
+{
+
+	if (setsid() < 0) {
+		return (-1);
+	}
+
+	if (ioctl(fd, TIOCSCTTY, NULL) < 0)
+		return (-1);
+	if (dup2(fd, 0) < 0 ||
+	    dup2(fd, 1) < 0 ||
+	    dup2(fd, 2) < 0) {
+		return (-1);
+	}
+	if (fd > 2 && close(fd) < 0)
+		return (-1);
+	return (0);
+}
+
+int
+forkpty(int *amaster, char *name, const struct termios *termp,
+    const struct winsize *winp)
+{
+	int master, slave, pid;
+	int err;
+
+	if (openpty(&master, &slave, name, termp, winp) == -1)
+		return (-1);
+	switch (pid = fork()) {
+	case -1:
+		err = errno;
+		(void) close(master);
+		(void) close(slave);
+		errno = err;  /* restore the original value of errno */
+		return (-1);
+		}
+	case 0:
+		/*
+		 * child
+		 */
+		(void) close(master);
+		if (login_tty(slave) < 0) {
+			return (-1);
+		}
+		return (0);
+	}
+	/*
+	 * parent
+	 */
+	*amaster = master;
+	(void) close(slave);
+
+	return (pid);
+}
--- old/usr/src/lib/libc/port/mapfile-vers	Wed Oct 28 00:34:10 2015
+++ new/usr/src/lib/libc/port/mapfile-vers	Wed Oct 28 00:34:10 2015
@@ -21,7 +21,7 @@
 #
 # Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
 #
-# Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
+# Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # Copyright (c) 2012 by Delphix. All rights reserved.
@@ -93,6 +93,13 @@
 $add amd64
 $endif
 
+SYMBOL_VERSION ILLUMOS_0.15 {	# openpty
+    protected:
+	forkpty;
+	login_tty;
+	openpty;
+} ILLUMOS_0.14;
+
 SYMBOL_VERSION ILLUMOS_0.14 {	# strerror_l
     protected:
 	strerror_l;
--- old/usr/src/lib/libc/sparc/Makefile.com	Wed Oct 28 00:34:10 2015
+++ new/usr/src/lib/libc/sparc/Makefile.com	Wed Oct 28 00:34:10 2015
@@ -24,7 +24,7 @@
 # Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
 # Copyright 2013 Garrett D'Amore <garrett@damore.org>
 #
-# Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
+# Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -559,6 +559,7 @@
 	psiginfo.o		\
 	psignal.o		\
 	pt.o			\
+	pty.o			\
 	putpwent.o		\
 	putspent.o		\
 	raise.o			\
--- old/usr/src/lib/libc/sparcv9/Makefile.com	Wed Oct 28 00:34:11 2015
+++ new/usr/src/lib/libc/sparcv9/Makefile.com	Wed Oct 28 00:34:11 2015
@@ -24,7 +24,7 @@
 # Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
 # Copyright 2013 Garrett D'Amore <garrett@damore.org>
 #
-# Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
+# Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
@@ -519,6 +519,7 @@
 	psiginfo.o		\
 	psignal.o		\
 	pt.o			\
+	pty.o			\
 	putpwent.o		\
 	putspent.o		\
 	raise.o			\
--- old/usr/src/man/man3c/Makefile	Wed Oct 28 00:34:11 2015
+++ new/usr/src/man/man3c/Makefile	Wed Oct 28 00:34:11 2015
@@ -216,6 +216,7 @@
 	 	lio_listio.3c					\
 	 	localeconv.3c					\
 	 	lockf.3c					\
+		login_pty.3c					\
 	 	lsearch.3c					\
 	 	madvise.3c					\
 	 	makecontext.3c					\
@@ -352,6 +353,7 @@
 	 	pthread_testcancel.3c				\
 	 	ptrace.3c					\
 	 	ptsname.3c					\
+		pty.3c						\
 	 	putenv.3c					\
 	 	putpwent.3c					\
 	 	puts.3c						\
--- /dev/null	Wed Oct 28 00:34:11 2015
+++ new/usr/src/man/man3c/THIRDPARTYLICENSE.login_tty	Wed Oct 28 00:34:11 2015
@@ -0,0 +1,24 @@
+.\" Copyright (c) 1996 Joerg Wunsch
+.\"
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
+.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
+.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
--- /dev/null	Wed Oct 28 00:34:11 2015
+++ new/usr/src/man/man3c/THIRDPARTYLICENSE.login_tty.descrip	Wed Oct 28 00:34:11 2015
@@ -0,0 +1,1 @@
+LOGIN_TTY MANUAL PAGE
--- /dev/null	Wed Oct 28 00:34:11 2015
+++ new/usr/src/man/man3c/THIRDPARTYLICENSE.pty	Wed Oct 28 00:34:11 2015
@@ -0,0 +1,24 @@
+.\" Copyright (c) 1996 Joerg Wunsch
+.\"
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
+.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
+.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
--- /dev/null	Wed Oct 28 00:34:12 2015
+++ new/usr/src/man/man3c/THIRDPARTYLICENSE.pty.descrip	Wed Oct 28 00:34:12 2015
@@ -0,0 +1,1 @@
+PTY MANUAL PAGE
--- /dev/null	Wed Oct 28 00:34:12 2015
+++ new/usr/src/man/man3c/login_tty.3c	Wed Oct 28 00:34:12 2015
@@ -0,0 +1,69 @@
+.\"
+.\" Copyright 2015 Nexenta Systems, Inc. All Rights Reserved. 
+.\" Copyright (c) 1996 Joerg Wunsch
+.\"
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
+.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
+.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
+.\" "
+.Dd October 10, 2015
+.Dt LOGIN_TTY 3
+.Os
+.Sh NAME
+.Nm login_tty
+.Nd prepare a tty for a new login session
+.Sh SYNOPSIS
+.In pty.h
+.Ft int
+.Fn login_tty "int fd"
+.Sh DESCRIPTION
+The function
+.Fn login_tty
+prepares a terminal for a new login session.
+The file descriptor
+.Ar fd
+passed to
+.Fn login_tty
+must be opened for reading and writing on a terminal device.
+It will be
+made the controlling terminal for the calling process, after allocating
+a new session with
+.Xr setsid 2 .
+This terminal device will also be made the standard input, standard output,
+and standard error output of the calling process.
+.Sh RETURN VALUES
+The function returns -1 if
+.Fn setsid
+fails or
+.Fn login_tty
+could not make the device referenced by
+.Ar fd
+the controlling terminal of the calling process, and 0 otherwise.
+.Sh INTERFACE STABILITY
+.Sy Comitted
+.Sh MT-LEVEL
+.Sy Unsafe
+.Sh SEE ALSO
+.Xr dup2 3 ,
+.Xr ioctl 2 ,
+.Xr setsid 2 ,
+.Xr tty 1
--- /dev/null	Wed Oct 28 00:34:12 2015
+++ new/usr/src/man/man3c/pty.3c	Wed Oct 28 00:34:12 2015
@@ -0,0 +1,140 @@
+.\"
+.\" Copyright 2015 Nexenta Systems, Inc. All Rights Reserved. 
+.\" Copyright (c) 1996 Joerg Wunsch
+.\"
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
+.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
+.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
+.\" "
+.Dd October 10, 2015
+.Dt PTY 3
+.Os
+.Sh NAME
+.Nm openpty ,
+.Nm forkpty
+.Nd auxiliary functions to obtain a pseudo-terminal
+.Sh SYNOPSIS
+.In pty.h
+.Ft int
+.Fn openpty "int *amaster" "int *aslave" "char *name" "const struct termios *termp" "const struct winsize *winp"
+.Ft int
+.Fn forkpty "int *amaster" "char *name" "const struct termios *termp" "const struct winsize *winp"
+.Sh DESCRIPTION
+The function
+.Fn openpty
+attempts to obtain the next available pseudo-terminal from the
+system. If it successfully finds one, it subsequently changes the
+ownership of the slave device to the real UID of the current process,
+the group membership to the group
+.Dq tty
+(if such a group exists in the system), the access permissions for
+reading and writing by the owner, and for writing by the group.
+.Pp
+If the argument
+.Fa name
+is not
+.Dv NULL ,
+the filename of the slave is returned in name.
+.Pp
+If the arguments
+.Fa termp
+or
+.Fa winp
+are not
+.Dv NULL ,
+.Fn openpty
+initializes the termios and window size settings from the structures
+these arguments point to, respectively.
+.Pp
+Upon return, the open file descriptors for the master and slave side
+of the pty are returned in the locations pointed to by
+.Fa amaster
+and
+.Fa aslave ,
+respectively.
+.Pp
+The
+.Fn forkpty
+function first calls
+.Fn openpty
+to obtain the next available pseudo-terminal from the system.
+Upon success,
+it forks off a new process.
+In the child process, it closes the descriptor
+for the master side of the pty, and calls
+.Xr login_tty 3
+for the slave pty.
+In the parent process, it closes the descriptor for the
+slave side of the pty.
+The arguments
+.Fa amaster ,
+.Fa name ,
+.Fa termp ,
+and
+.Fa winp
+have the same meaning as described for
+.Fn openpty .
+.Sh RETURN VALUES
+If a call to
+.Fn openpty
+or
+.Fn forkpty
+is not successful, -1 is returned and errno is set
+to indicate the error.  Otherwise,
+.Fn openpty
+and the child process of
+.Fn forkpty
+return 0, and the parent process of
+.Fn forkpty
+returns the process ID of the child process.
+.Sh ERRORS
+The
+.Fn openpty
+function may fail and set the global variable
+.Dv errno
+for any of the errors specified for the
+.Xr open 2,
+.Xr grantpt 3 ,
+.Xr unlockpt 3,
+.Xr ptsname 3 ,
+.Xr ioctl 2 ,
+and
+.Xr tcsetattr 3
+functions.
+.Pp
+In addition to this,
+.Fn forkpty
+may set it to any value as described for
+.Xr fork 2 .
+.Sh INTERFACE STABILITY
+.Sy Comitted
+.Sh MT-LEVEL
+.Sy MT-Safe
+.Sh SEE ALSO
+.Xr chmod 2 ,
+.Xr chown 2 ,
+.Xr fork 2 ,
+.Xr getuid 2 ,
+.Xr open 2 ,
+.Xr login_tty 3 ,
+.Xr termios 3 ,
+.Xr group 4
--- old/usr/src/pkg/manifests/system-header.mf	Wed Oct 28 00:34:12 2015
+++ new/usr/src/pkg/manifests/system-header.mf	Wed Oct 28 00:34:12 2015
@@ -635,6 +635,7 @@
 file path=usr/include/protocols/rwhod.h
 file path=usr/include/protocols/timed.h
 file path=usr/include/pthread.h
+file path=usr/include/pty.h
 file path=usr/include/pw.h
 file path=usr/include/pwd.h
 file path=usr/include/rcm_module.h
--- old/usr/src/pkg/manifests/system-library.man3c.inc	Wed Oct 28 00:34:12 2015
+++ new/usr/src/pkg/manifests/system-library.man3c.inc	Wed Oct 28 00:34:12 2015
@@ -11,7 +11,7 @@
 
 #
 # Copyright 2011, Richard Lowe
-# Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
+# Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
 # Copyright 2013 OmniTI Computer Consulting, Inc. All rights reserved.
 # Copyright 2014 Garrett D'Amore <garrett@damore.org>
 #
@@ -211,6 +211,7 @@
 file path=usr/share/man/man3c/lio_listio.3c
 file path=usr/share/man/man3c/localeconv.3c
 file path=usr/share/man/man3c/lockf.3c
+file path=usr/share/man/man3c/login_tty.3c
 file path=usr/share/man/man3c/lsearch.3c
 file path=usr/share/man/man3c/madvise.3c
 file path=usr/share/man/man3c/makecontext.3c
@@ -347,6 +348,7 @@
 file path=usr/share/man/man3c/pthread_testcancel.3c
 file path=usr/share/man/man3c/ptrace.3c
 file path=usr/share/man/man3c/ptsname.3c
+file path=usr/share/man/man3c/pty.3c
 file path=usr/share/man/man3c/putenv.3c
 file path=usr/share/man/man3c/putpwent.3c
 file path=usr/share/man/man3c/puts.3c
--- old/usr/src/pkg/manifests/system-library.mf	Wed Oct 28 00:34:12 2015
+++ new/usr/src/pkg/manifests/system-library.mf	Wed Oct 28 00:34:13 2015
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright 2014 Nexenta Systems, Inc.
+# Copyright 2015 Nexenta Systems, Inc.
 # Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
 # Copyright 2012 OmniTI Computer Consulting, Inc.  All rights reserved.
 # Copyright (c) 2013 Gary Mills
@@ -595,6 +595,10 @@
     license=usr/src/man/man3c/THIRDPARTYLICENSE.arc4random
 license usr/src/man/man3c/THIRDPARTYLICENSE.getentropy \
     license=usr/src/man/man3c/THIRDPARTYLICENSE.getentropy
+license usr/src/man/man3c/THIRDPARTYLICENSE.login_tty \
+    license=usr/src/man/man3c/THIRDPARTYLICENSE.login_tty
+license usr/src/man/man3c/THIRDPARTYLICENSE.pty \
+    license=usr/src/man/man3c/THIRDPARTYLICENSE.pty
 license usr/src/uts/common/sys/THIRDPARTYLICENSE.unicode \
     license=usr/src/uts/common/sys/THIRDPARTYLICENSE.unicode
 link path=lib/$(ARCH64)/libadm.so target=libadm.so.1
