--- old/usr/src/cmd/sendmail/libsm/Makefile	2016-12-11 12:29:27.748667136 -0500
+++ new/usr/src/cmd/sendmail/libsm/Makefile	2016-12-11 12:29:27.785492785 -0500
@@ -23,10 +23,6 @@
 # Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
-# cmd/sendmail/libsm/Makefile
-#
 
 include		../../Makefile.cmd
 include		../Makefile.cmd
@@ -54,6 +50,8 @@
 
 libsm=	libsm.a
 
+CERRWARN +=	-_gcc=-Wno-type-limits
+
 .KEEP_STATE:
 all: $(libsm)
 
--- old/usr/src/lib/libc/i386/Makefile.com	2016-12-11 12:29:28.800849901 -0500
+++ new/usr/src/lib/libc/i386/Makefile.com	2016-12-11 12:29:28.835208425 -0500
@@ -551,7 +551,6 @@
 	scandir.o		\
 	seekdir.o		\
 	select.o		\
-	select_large_fdset.o	\
 	setlabel.o		\
 	setpriority.o		\
 	settimeofday.o		\
--- old/usr/src/lib/libc/port/gen/select.c	2016-12-11 12:29:29.941411306 -0500
+++ new/usr/src/lib/libc/port/gen/select.c	2016-12-11 12:29:29.976168419 -0500
@@ -27,8 +27,6 @@
 /*	Copyright (c) 1988 AT&T	*/
 /*	  All Rights Reserved  	*/
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 /*
  * Emulation of select() system call using poll() system call.
  *
@@ -47,6 +45,7 @@
 #include <values.h>
 #include <pthread.h>
 #include <errno.h>
+#include <stdlib.h>
 #include <sys/time.h>
 #include <sys/types.h>
 #include <sys/select.h>
@@ -54,9 +53,58 @@
 #include <alloca.h>
 #include "libc.h"
 
+/*
+ * STACK_PFD_LIM
+ *
+ *   The limit at which pselect allocates pollfd structures in the heap,
+ *   rather than on the stack.  These limits match the historical behaviour
+ *   with the * _large_fdset implementations.
+ *
+ * BULK_ALLOC_LIM
+ *
+ *   The limit below which we'll just allocate nfds pollfds, rather than
+ *   counting how many we actually need.
+ */
+#if defined(_LP64)
+#define	STACK_PFD_LIM	FD_SETSIZE
+#define	BULK_ALLOC_LIM	8192
+#else
+#define	STACK_PFD_LIM	1024
+#define	BULK_ALLOC_LIM	1024
+#endif
+
+/*
+ * The previous _large_fdset implementations are, unfortunately, baked into
+ * the ABI.
+ */
+#pragma weak select_large_fdset = select
+#pragma weak pselect_large_fdset = pselect
+
+#define	fd_set_size(nfds)	(((nfds) + (NFDBITS - 1)) / NFDBITS)
+
+static nfds_t
+fd_sets_count(int limit, fd_set *in, fd_set *out, fd_set *ex)
+{
+	nfds_t total = 0;
+
+	if (limit <= 0)
+		return (0);
+
+	for (int i = 0; i < fd_set_size(limit); i++) {
+		long v = (in->fds_bits[i] | out->fds_bits[i] | ex->fds_bits[i]);
+
+		while (v != 0) {
+			v &= v - 1;
+			total++;
+		}
+	}
+
+	return (total);
+}
+
 int
 pselect(int nfds, fd_set *in0, fd_set *out0, fd_set *ex0,
-	const timespec_t *tsp, const sigset_t *sigmask)
+    const timespec_t *tsp, const sigset_t *sigmask)
 {
 	long *in, *out, *ex;
 	ulong_t m;	/* bit mask */
@@ -66,6 +114,8 @@
 	struct pollfd *pfd;
 	struct pollfd *p;
 	int lastj = -1;
+	nfds_t npfds = 0;
+	boolean_t heap_pfds = B_FALSE;
 
 	/* "zero" is read-only, it could go in the text segment */
 	static fd_set zero = { 0 };
@@ -80,7 +130,6 @@
 		errno = EINVAL;
 		return (-1);
 	}
-	p = pfd = (struct pollfd *)alloca(nfds * sizeof (struct pollfd));
 
 	if (tsp != NULL) {
 		/* check timespec validity */
@@ -102,6 +151,21 @@
 	if (ex0 == NULL)
 		ex0 = &zero;
 
+	if (nfds <= BULK_ALLOC_LIM) {
+		p = pfd = alloca(nfds * sizeof (struct pollfd));
+	} else {
+		npfds = fd_sets_count(nfds, in0, out0, ex0);
+
+		if (npfds > STACK_PFD_LIM) {
+			p = pfd = malloc(npfds * sizeof (struct pollfd));
+			if (p == NULL)
+				return (-1);
+			heap_pfds = B_TRUE;
+		} else {
+			p = pfd = alloca(npfds * sizeof (struct pollfd));
+		}
+	}
+
 	/*
 	 * For each fd, if any bits are set convert them into
 	 * the appropriate pollfd struct.
@@ -134,13 +198,13 @@
 	/*
 	 * Now do the poll.
 	 */
-	n = (int)(p - pfd);		/* number of pollfd's */
+	npfds = (int)(p - pfd);
 	do {
-		rv = _pollsys(pfd, (nfds_t)n, tsp, sigmask);
+		rv = _pollsys(pfd, npfds, tsp, sigmask);
 	} while (rv < 0 && errno == EAGAIN);
 
 	if (rv < 0)		/* no need to set bit masks */
-		return (rv);
+		goto out;
 
 	if (rv == 0) {
 		/*
@@ -163,14 +227,15 @@
 			for (n = 0; n < nfds; n += NFDBITS)
 				*ex++ = 0;
 		}
-		return (0);
+		rv = 0;
+		goto out;
 	}
 
 	/*
 	 * Check for EINVAL error case first to avoid changing any bits
 	 * if we're going to return an error.
 	 */
-	for (p = pfd, j = n; j-- > 0; p++) {
+	for (p = pfd, n = npfds; n-- > 0; p++) {
 		/*
 		 * select will return EBADF immediately if any fd's
 		 * are bad.  poll will complete the poll on the
@@ -181,7 +246,8 @@
 		 */
 		if (p->revents & POLLNVAL) {
 			errno = EBADF;
-			return (-1);
+			rv = -1;
+			goto out;
 		}
 		/*
 		 * We would like to make POLLHUP available to select,
@@ -194,7 +260,8 @@
 		 * if ((p->revents & POLLHUP) &&
 		 *	!(p->revents & (POLLRDNORM|POLLRDBAND))) {
 		 *	errno = EINTR;
-		 *	return (-1);
+		 *	rv = -1;
+		 *	goto out;
 		 * }
 		 */
 	}
@@ -212,7 +279,7 @@
 	 * (as the man page says, and as poll() does).
 	 */
 	rv = 0;
-	for (p = pfd; n-- > 0; p++) {
+	for (p = pfd, n = npfds; n-- > 0; p++) {
 		j = (int)(p->fd / NFDBITS);
 		/* have we moved into another word of the bit mask yet? */
 		if (j != lastj) {
@@ -278,6 +345,9 @@
 			}
 		}
 	}
+out:
+	if (heap_pfds)
+		free(pfd);
 	return (rv);
 }
 
--- old/usr/src/lib/libc/port/gen/select_large_fdset.c	2016-12-11 12:29:30.947382667 -0500
+++ /dev/null	2016-12-11 12:29:30.000000000 -0500
@@ -1,392 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * 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.
- * 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 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-/*	Copyright (c) 1988 AT&T	*/
-/*	  All Rights Reserved  	*/
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-/*
- * Emulation of select() system call using _pollsys() system call.
- *
- * Assumptions:
- *	polling for input only is most common.
- *	polling for exceptional conditions is very rare.
- *
- * Note that is it not feasible to emulate all error conditions,
- * in particular conditions that would return EFAULT are far too
- * difficult to check for in a library routine.
- *
- * This is the alternate large fd_set select.
- *
- */
-
-/*
- * Must precede any include files
- */
-#ifdef FD_SETSIZE
-#undef FD_SETSIZE
-#endif
-#define	FD_SETSIZE 65536
-
-#include "lint.h"
-#include <values.h>
-#include <stdlib.h>
-#include <string.h>
-#include <pthread.h>
-#include <errno.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/poll.h>
-#include <string.h>
-#include <stdlib.h>
-#include "libc.h"
-
-#define	DEFAULT_POLL_SIZE 64
-
-static struct pollfd *realloc_fds(int *, struct pollfd **, struct pollfd *);
-
-int
-pselect_large_fdset(int nfds, fd_set *in0, fd_set *out0, fd_set *ex0,
-	const timespec_t *tsp, const sigset_t *sigmask)
-{
-	long *in, *out, *ex;
-	ulong_t m;	/* bit mask */
-	int j;		/* loop counter */
-	ulong_t b;	/* bits to test */
-	int n, rv;
-	int lastj = -1;
-	int nused;
-
-	/*
-	 * Rather than have a mammoth pollfd (65K) list on the stack
-	 * we start with a small one and then malloc larger chunks
-	 * on the heap if necessary.
-	 */
-
-	struct pollfd pfd[DEFAULT_POLL_SIZE];
-	struct pollfd *p;
-	struct pollfd *pfd_list;
-	int nfds_on_list;
-
-	fd_set zero;
-
-	/*
-	 * Check for invalid conditions at outset.
-	 * Required for spec1170.
-	 * SUSV3: We must behave as a cancellation point even if we fail early.
-	 */
-	if (nfds >= 0 && nfds <= FD_SETSIZE) {
-		if (tsp != NULL) {
-			if (tsp->tv_nsec < 0 || tsp->tv_nsec >= NANOSEC ||
-			    tsp->tv_sec < 0) {
-				pthread_testcancel();
-				errno = EINVAL;
-				return (-1);
-			}
-		}
-	} else {
-		pthread_testcancel();
-		errno = EINVAL;
-		return (-1);
-	}
-
-	/*
-	 * If any input args are null, point them at the null array.
-	 */
-	(void) memset(&zero, 0, sizeof (fd_set));
-	if (in0 == NULL)
-		in0 = &zero;
-	if (out0 == NULL)
-		out0 = &zero;
-	if (ex0 == NULL)
-		ex0 = &zero;
-
-	nfds_on_list = DEFAULT_POLL_SIZE;
-	pfd_list = pfd;
-	p = pfd_list;
-	(void) memset(pfd, 0, sizeof (pfd));
-	/*
-	 * For each fd, if any bits are set convert them into
-	 * the appropriate pollfd struct.
-	 */
-	in = (long *)in0->fds_bits;
-	out = (long *)out0->fds_bits;
-	ex = (long *)ex0->fds_bits;
-	nused = 0;
-	/*
-	 * nused reflects the number of pollfd structs currently used
-	 * less one. If realloc_fds returns NULL it is because malloc
-	 * failed. We expect malloc() to have done the proper
-	 * thing with errno.
-	 */
-	for (n = 0; n < nfds; n += NFDBITS) {
-		b = (ulong_t)(*in | *out | *ex);
-		for (j = 0, m = 1; b != 0; j++, b >>= 1, m <<= 1) {
-			if (b & 1) {
-				p->fd = n + j;
-				if (p->fd < nfds) {
-					p->events = 0;
-					if (*in & m)
-						p->events |= POLLRDNORM;
-					if (*out & m)
-						p->events |= POLLWRNORM;
-					if (*ex & m)
-						p->events |= POLLRDBAND;
-					if (nused < (nfds_on_list - 1)) {
-						p++;
-					} else if ((p = realloc_fds(
-					    &nfds_on_list, &pfd_list, pfd))
-					    == NULL) {
-						if (pfd_list != pfd)
-							free(pfd_list);
-						pthread_testcancel();
-						return (-1);
-					}
-					nused++;
-				} else
-					goto done;
-			}
-		}
-		in++;
-		out++;
-		ex++;
-	}
-done:
-	/*
-	 * Now do the poll.
-	 */
-	do {
-		rv = _pollsys(pfd_list, (nfds_t)nused, tsp, sigmask);
-	} while (rv < 0 && errno == EAGAIN);
-
-	if (rv < 0) {		/* no need to set bit masks */
-		if (pfd_list != pfd)
-			free(pfd_list);
-		return (rv);
-	} else if (rv == 0) {
-		/*
-		 * Clear out bit masks, just in case.
-		 * On the assumption that usually only
-		 * one bit mask is set, use three loops.
-		 */
-		if (in0 != &zero) {
-			in = (long *)in0->fds_bits;
-			for (n = 0; n < nfds; n += NFDBITS)
-				*in++ = 0;
-		}
-		if (out0 != &zero) {
-			out = (long *)out0->fds_bits;
-			for (n = 0; n < nfds; n += NFDBITS)
-				*out++ = 0;
-		}
-		if (ex0 != &zero) {
-			ex = (long *)ex0->fds_bits;
-			for (n = 0; n < nfds; n += NFDBITS)
-				*ex++ = 0;
-		}
-		if (pfd_list != pfd)
-			free(pfd_list);
-		return (0);
-	}
-
-	/*
-	 * Check for EINVAL error case first to avoid changing any bits
-	 * if we're going to return an error.
-	 */
-	for (p = pfd_list, j = nused; j-- > 0; p++) {
-		/*
-		 * select will return EBADF immediately if any fd's
-		 * are bad.  poll will complete the poll on the
-		 * rest of the fd's and include the error indication
-		 * in the returned bits.  This is a rare case so we
-		 * accept this difference and return the error after
-		 * doing more work than select would've done.
-		 */
-		if (p->revents & POLLNVAL) {
-			errno = EBADF;
-			if (pfd_list != pfd)
-				free(pfd_list);
-			return (-1);
-		}
-		/*
-		 * We would like to make POLLHUP available to select,
-		 * checking to see if we have pending data to be read.
-		 * BUT until we figure out how not to break Xsun's
-		 * dependencies on select's existing features...
-		 * This is what we _thought_ would work ... sigh!
-		 */
-		/*
-		 * if ((p->revents & POLLHUP) &&
-		 *	!(p->revents & (POLLRDNORM|POLLRDBAND))) {
-		 *	errno = EINTR;
-		 *	return (-1);
-		 * }
-		 */
-	}
-
-	/*
-	 * Convert results of poll back into bits
-	 * in the argument arrays.
-	 *
-	 * We assume POLLRDNORM, POLLWRNORM, and POLLRDBAND will only be set
-	 * on return from poll if they were set on input, thus we don't
-	 * worry about accidentally setting the corresponding bits in the
-	 * zero array if the input bit masks were null.
-	 *
-	 * Must return number of bits set, not number of ready descriptors
-	 * (as the man page says, and as poll() does).
-	 */
-	rv = 0;
-	for (p = pfd_list; nused-- > 0; p++) {
-		j = (int)(p->fd / NFDBITS);
-		/* have we moved into another word of the bit mask yet? */
-		if (j != lastj) {
-			/* clear all output bits to start with */
-			in = (long *)&in0->fds_bits[j];
-			out = (long *)&out0->fds_bits[j];
-			ex = (long *)&ex0->fds_bits[j];
-			/*
-			 * In case we made "zero" read-only (e.g., with
-			 * cc -R), avoid actually storing into it.
-			 */
-			if (in0 != &zero)
-				*in = 0;
-			if (out0 != &zero)
-				*out = 0;
-			if (ex0 != &zero)
-				*ex = 0;
-			lastj = j;
-		}
-		if (p->revents) {
-			m = 1L << (p->fd % NFDBITS);
-			if (p->revents & POLLRDNORM) {
-				*in |= m;
-				rv++;
-			}
-			if (p->revents & POLLWRNORM) {
-				*out |= m;
-				rv++;
-			}
-			if (p->revents & POLLRDBAND) {
-				*ex |= m;
-				rv++;
-			}
-			/*
-			 * Only set this bit on return if we asked about
-			 * input conditions.
-			 */
-			if ((p->revents & (POLLHUP|POLLERR)) &&
-			    (p->events & POLLRDNORM)) {
-				if ((*in & m) == 0)
-					rv++;	/* wasn't already set */
-				*in |= m;
-			}
-			/*
-			 * Only set this bit on return if we asked about
-			 * output conditions.
-			 */
-			if ((p->revents & (POLLHUP|POLLERR)) &&
-			    (p->events & POLLWRNORM)) {
-				if ((*out & m) == 0)
-					rv++;	/* wasn't already set */
-				*out |= m;
-			}
-			/*
-			 * Only set this bit on return if we asked about
-			 * output conditions.
-			 */
-			if ((p->revents & (POLLHUP|POLLERR)) &&
-			    (p->events & POLLRDBAND)) {
-				if ((*ex & m) == 0)
-					rv++;   /* wasn't already set */
-				*ex |= m;
-			}
-		}
-	}
-	if (pfd_list != pfd)
-		free(pfd_list);
-	return (rv);
-}
-
-int
-select_large_fdset(int nfds, fd_set *in0, fd_set *out0, fd_set *ex0,
-	struct timeval *tv)
-{
-	timespec_t ts;
-	timespec_t *tsp;
-
-	if (tv == NULL)
-		tsp = NULL;
-	else {
-		/* check timeval validity */
-		if (tv->tv_usec < 0 || tv->tv_usec >= MICROSEC) {
-			errno = EINVAL;
-			return (-1);
-		}
-		/*
-		 * Convert timeval to timespec.
-		 * To preserve compatibility with past behavior,
-		 * when select was built upon poll(2), which has a
-		 * minimum non-zero timeout of 1 millisecond, force
-		 * a minimum non-zero timeout of 500 microseconds.
-		 */
-		ts.tv_sec = tv->tv_sec;
-		ts.tv_nsec = tv->tv_usec * 1000;
-		if (ts.tv_nsec != 0 && ts.tv_nsec < 500000)
-			ts.tv_nsec = 500000;
-		tsp = &ts;
-	}
-
-	return (pselect_large_fdset(nfds, in0, out0, ex0, tsp, NULL));
-}
-
-/*
- * Reallocate buffers of pollfds for our list. We malloc a new buffer
- * and, in the case where the old buffer does not match what is passed
- * in orig, free the buffer after copying the contents.
- */
-struct pollfd *
-realloc_fds(int *num, struct pollfd **list_head, struct pollfd *orig)
-{
-	struct pollfd *b;
-	int nta;
-	int n2;
-
-	n2 = *num * 2;
-	nta = n2 * sizeof (struct pollfd);
-	b = malloc(nta);
-	if (b) {
-		(void) memset(b, 0, (size_t)nta);
-		(void) memcpy(b, *list_head, nta / 2);
-		if (*list_head != orig)
-			free(*list_head);
-		*list_head = b;
-		b += *num;
-		*num = n2;
-	}
-	return (b);
-}
--- old/usr/src/lib/libc/sparc/Makefile.com	2016-12-11 12:29:31.302511938 -0500
+++ new/usr/src/lib/libc/sparc/Makefile.com	2016-12-11 12:29:31.336389923 -0500
@@ -583,7 +583,6 @@
 	scandir.o		\
 	seekdir.o		\
 	select.o		\
-	select_large_fdset.o	\
 	setlabel.o		\
 	setpriority.o		\
 	settimeofday.o		\
--- old/usr/src/lib/libnsl/Makefile.com	2016-12-11 12:29:32.548145651 -0500
+++ new/usr/src/lib/libnsl/Makefile.com	2016-12-11 12:29:32.582056528 -0500
@@ -69,8 +69,7 @@
 clnt_raw.o	clnt_simple.o	clnt_vc.o	fdsync.o	getdname.o \
 inet_ntoa.o	key_call.o	key_prot.o	mt_misc.o \
 netname.o	netnamer.o	pmap_clnt.o	pmap_prot.o \
-rpc_callmsg.o	rpc_comdata.o	rpc_comdata1.o	rpc_generic.o	rpc_prot.o \
-rpc_sel2poll.o \
+rpc_callmsg.o	rpc_comdata.o	rpc_generic.o	rpc_prot.o rpc_sel2poll.o \
 rpc_soc.o	rpc_td.o	rpcb_clnt.o	rpcb_prot.o \
 rpcb_st_xdr.o	rpcdname.o	rpcsec_gss_if.o	rtime_tli.o	svc.o \
 svc_auth.o	svc_auth_loopb.o	svc_auth_sys.o	svc_dg.o \
--- old/usr/src/lib/libnsl/rpc/rpc_comdata.c	2016-12-11 12:29:33.519925607 -0500
+++ new/usr/src/lib/libnsl/rpc/rpc_comdata.c	2016-12-11 12:29:33.554232746 -0500
@@ -33,8 +33,6 @@
  * California.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #include "mt.h"
 #include <rpc/rpc.h>
 
@@ -44,5 +42,12 @@
  */
 struct opaque_auth _null_auth;
 fd_set svc_fdset;
+#if !defined(_LP64)
+/*
+ * This used to be how we dealt with larger than default fdsets on 32bit
+ * systems, the symbol is unfortunately part of the ABI.
+ */
+fd_set _new_svc_fdset;
+#endif
 pollfd_t *svc_pollfd;
 void (*_svc_getreqset_proc)();
--- old/usr/src/lib/libnsl/rpc/rpc_comdata1.c	2016-12-11 12:29:34.461995080 -0500
+++ /dev/null	2016-12-11 12:29:34.000000000 -0500
@@ -1,64 +0,0 @@
-/*
- * 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 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-/*
- * FD_SETSIZE definition must precede any save isa_defs.h since that
- * is where _LP64 is defined....
- */
-#include "mt.h"
-#include <sys/isa_defs.h>
-#if !defined(_LP64)
-#ifdef FD_SETSIZE
-#undef FD_SETSIZE
-#endif
-#define	FD_SETSIZE 65536
-
-#include <sys/select.h>
-
-/*
- * This file should only contain common data (global data) that is exported
- * by public interfaces
- */
-
-/*
- * Definition of alternate fd_set for svc_fdset to be used when
- * someone redefine SVC_FDSETSIZE. This is here solely to
- * protect against someone doing a svc_fdset = a_larger_fd_set.
- * If we're not a 64 bit app and someone defines fd_setsize > 1024
- * then svc_fdset is redefined to be _new_svc_fdset (in <rpc/svc.h>)
- * which we size here at the maximum size.
- */
-
-fd_set _new_svc_fdset;
-#else
-
-#include <sys/select.h>
-
-extern fd_set svc_fdset;	/* to avoid "empty translation unit" */
-#endif
--- old/usr/src/lib/libnsl/rpc/svc.c	2016-12-11 12:29:34.809003946 -0500
+++ new/usr/src/lib/libnsl/rpc/svc.c	2016-12-11 12:29:34.843659055 -0500
@@ -103,7 +103,9 @@
 extern mutex_t xprtlist_lock;
 extern void __svc_rm_from_xlist();
 
+#if !defined(_LP64)
 extern fd_set _new_svc_fdset;
+#endif
 
 /*
  * If the allocated array of reactor is too small, this value is used as a
@@ -854,7 +856,7 @@
  */
 bool_t
 svc_reg(const SVCXPRT *xprt, const rpcprog_t prog, const rpcvers_t vers,
-			void (*dispatch)(), const struct netconfig *nconf)
+    void (*dispatch)(), const struct netconfig *nconf)
 {
 	struct svc_callout *prev;
 	struct svc_callout *s, **s2;
@@ -966,7 +968,7 @@
  */
 bool_t
 svc_register(SVCXPRT *xprt, rpcprog_t prog, rpcvers_t vers,
-					void (*dispatch)(), int protocol)
+    void (*dispatch)(), int protocol)
 {
 	struct svc_callout *prev;
 	struct svc_callout *s;
@@ -1092,7 +1094,7 @@
  */
 bool_t
 svc_sendreply(const SVCXPRT *xprt, const xdrproc_t xdr_results,
-						const caddr_t xdr_location)
+    const caddr_t xdr_location)
 {
 	struct rpc_msg rply;
 
@@ -1227,7 +1229,7 @@
  */
 void
 svcerr_progvers(const SVCXPRT *xprt, const rpcvers_t low_vers,
-						const rpcvers_t high_vers)
+    const rpcvers_t high_vers)
 {
 	struct rpc_msg rply;
 
@@ -1764,7 +1766,7 @@
  */
 int
 __svc_dup(struct svc_req *req, caddr_t *resp_buf, uint_t *resp_bufsz,
-	char *xprt_cache)
+    char *xprt_cache)
 {
 	uint32_t drxid, drhash;
 	int rc;
@@ -1812,7 +1814,7 @@
  */
 static int
 __svc_dupcache_check(struct svc_req *req, caddr_t *resp_buf, uint_t *resp_bufsz,
-		struct dupcache *dc, uint32_t drxid, uint32_t drhash)
+    struct dupcache *dc, uint32_t drxid, uint32_t drhash)
 {
 	struct dupreq *dr = NULL;
 
@@ -1971,7 +1973,7 @@
  */
 static int
 __svc_dupcache_enter(struct svc_req *req, struct dupreq *dr,
-	struct dupcache *dc, uint32_t drxid, uint32_t drhash, time_t timenow)
+    struct dupcache *dc, uint32_t drxid, uint32_t drhash, time_t timenow)
 {
 	dr->dr_xid = drxid;
 	dr->dr_prog = req->rq_prog;
@@ -2014,7 +2016,7 @@
  */
 int
 __svc_dupdone(struct svc_req *req, caddr_t resp_buf, uint_t resp_bufsz,
-		int status, char *xprt_cache)
+    int status, char *xprt_cache)
 {
 	uint32_t drxid, drhash;
 	int rc;
@@ -2060,7 +2062,7 @@
  */
 static int
 __svc_dupcache_update(struct svc_req *req, caddr_t resp_buf, uint_t resp_bufsz,
-	int status, struct dupcache *dc, uint32_t drxid, uint32_t drhash)
+    int status, struct dupcache *dc, uint32_t drxid, uint32_t drhash)
 {
 	struct dupreq *dr = NULL;
 	time_t timenow = time(NULL);
--- old/usr/src/uts/common/conf/param.c	2016-12-11 12:29:36.157925470 -0500
+++ new/usr/src/uts/common/conf/param.c	2016-12-11 12:29:36.192838262 -0500
@@ -404,10 +404,10 @@
 kmutex_t execsw_lock;	/* Used for allocation of execsw entries */
 
 /*
- * symbols added to make changing max-file-descriptors
+ * symbols added to make changing proc.max-file-descriptor
  * simple via /etc/system
  */
-#define	RLIM_FD_CUR 0x100
+#define	RLIM_FD_CUR 0x10000
 #define	RLIM_FD_MAX 0x10000
 
 uint_t rlim_fd_cur = RLIM_FD_CUR;
--- old/usr/src/uts/common/rpc/svc.h	2016-12-11 12:29:37.296203830 -0500
+++ new/usr/src/uts/common/rpc/svc.h	2016-12-11 12:29:37.333165304 -0500
@@ -852,14 +852,6 @@
 extern pollfd_t	*svc_pollfd;
 extern int	svc_max_pollfd;
 extern fd_set	svc_fdset;
-#if !defined(_LP64) && FD_SETSIZE > 1024
-extern fd_set	_new_svc_fdset;
-#ifdef __PRAGMA_REDEFINE_EXTNAME
-#pragma redefine_extname	svc_fdset	_new_svc_fdset
-#else   /* __PRAGMA_REDEFINE_EXTNAME */
-#define	svc_fdset	_new_svc_fdset
-#endif  /* __PRAGMA_REDEFINE_EXTNAME */
-#endif	/* LP64 && FD_SETSIZE > 1024 */
 #define	svc_fds svc_fdset.fds_bits[0]	/* compatibility */
 
 /*
--- old/usr/src/uts/common/sys/select.h	2016-12-11 12:29:38.415786843 -0500
+++ new/usr/src/uts/common/sys/select.h	2016-12-11 12:29:38.449932502 -0500
@@ -82,26 +82,10 @@
  * Select uses bit masks of file descriptors in longs.
  * These macros manipulate such bit fields.
  * FD_SETSIZE may be defined by the user, but the default here
- * should be >= NOFILE (param.h).
+ * should be >= RLIM_FD_MAX.
  */
 #ifndef	FD_SETSIZE
-#ifdef _LP64
 #define	FD_SETSIZE	65536
-#else
-#define	FD_SETSIZE	1024
-#endif	/* _LP64 */
-#elif FD_SETSIZE > 1024 && !defined(_LP64)
-#ifdef __PRAGMA_REDEFINE_EXTNAME
-#pragma	redefine_extname	select	select_large_fdset
-#if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || defined(__EXTENSIONS__)
-#pragma	redefine_extname	pselect	pselect_large_fdset
-#endif
-#else	/* __PRAGMA_REDEFINE_EXTNAME */
-#define	select	select_large_fdset
-#if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || defined(__EXTENSIONS__)
-#define	pselect	pselect_large_fdset
-#endif
-#endif	/* __PRAGMA_REDEFINE_EXTNAME */
 #endif	/* FD_SETSIZE */
 
 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
