summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2015-10-21 11:46:19 +0300
committerIgor Pashev <pashev.igor@gmail.com>2015-10-21 11:46:19 +0300
commitb01ba1daf4b36ff92a96415075dcb2e3cb7c2fb7 (patch)
tree95a23c0b9a42532fa8f5edc0112278f979d8066c
parenta26e5b562d25b5391aab278be9bed8096b8d238c (diff)
downloadillumos-packaging-b01ba1daf4b36ff92a96415075dcb2e3cb7c2fb7.tar.gz
Updated patches
-rw-r--r--libc/debian/changelog6
-rw-r--r--libc/debian/patches/features.patch137
-rw-r--r--libc/debian/patches/gnu-basename.patch21
-rw-r--r--libc/debian/patches/illumos-3243-getent-shadow.patch148
-rw-r--r--libc/debian/patches/illumos-3244-ret_val-uninitialized.patch18
-rw-r--r--libc/debian/patches/illumos-4688-getlogin_r.patch86
-rw-r--r--libc/debian/patches/libc-add-mkostemp.patch69
-rw-r--r--libc/debian/patches/libc-add-qsort_r.patch75
-rw-r--r--libc/debian/patches/libc-add-tdestroy.patch16
-rw-r--r--libc/debian/patches/libc-include-time.h.patch18
-rw-r--r--libc/debian/patches/libc-no-gets.patch12
-rw-r--r--libc/debian/patches/libc-vhangup-returns-int.patch22
-rw-r--r--libc/debian/patches/libnsl-illumos-updates.patch1380
-rw-r--r--libc/debian/patches/librpcsvc-use-system-x.patch13
-rw-r--r--libc/debian/patches/localedef-only.patch17
-rw-r--r--libc/debian/patches/localedef.patch (renamed from libc/debian/patches/localedef-bison.patch)15
-rw-r--r--libc/debian/patches/series9
-rw-r--r--libc/debian/patches/struct-tm.patch25
-rw-r--r--libc/debian/patches/use-posix-functions.patch172
19 files changed, 186 insertions, 2073 deletions
diff --git a/libc/debian/changelog b/libc/debian/changelog
index df1dfc5..293d2d1 100644
--- a/libc/debian/changelog
+++ b/libc/debian/changelog
@@ -1,3 +1,9 @@
+libc (5.10.18.git.2a44663-1) unstable; urgency=medium
+
+ * New upstream snapshot
+
+ -- Igor Pashev <pashev.igor@gmail.com> Wed, 21 Oct 2015 10:58:41 +0300
+
libc (4.3.1.git.35107df-1) unstable; urgency=medium
* Use 3.0 (quilt) format with new dh_illumos_gate
diff --git a/libc/debian/patches/features.patch b/libc/debian/patches/features.patch
index 6139130..2d923ea 100644
--- a/libc/debian/patches/features.patch
+++ b/libc/debian/patches/features.patch
@@ -9,8 +9,8 @@ Index: libc/usr/src/head/aio.h
--- libc.orig/usr/src/head/aio.h
+++ libc/usr/src/head/aio.h
@@ -29,7 +29,7 @@
-
- #pragma ident "%Z%%M% %I% %E% SMI"
+ #ifndef _AIO_H
+ #define _AIO_H
-#include <sys/feature_tests.h>
+#include <features.h>
@@ -21,7 +21,7 @@ Index: libc/usr/src/head/arpa/inet.h
===================================================================
--- libc.orig/usr/src/head/arpa/inet.h
+++ libc/usr/src/head/arpa/inet.h
-@@ -35,7 +35,7 @@
+@@ -37,7 +37,7 @@
#ifndef _ARPA_INET_H
#define _ARPA_INET_H
@@ -35,8 +35,8 @@ Index: libc/usr/src/head/dirent.h
--- libc.orig/usr/src/head/dirent.h
+++ libc/usr/src/head/dirent.h
@@ -32,7 +32,7 @@
-
- #pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.6.1.5 */
+ #ifndef _DIRENT_H
+ #define _DIRENT_H
-#include <sys/feature_tests.h>
+#include <features.h>
@@ -47,7 +47,7 @@ Index: libc/usr/src/head/dlfcn.h
===================================================================
--- libc.orig/usr/src/head/dlfcn.h
+++ libc/usr/src/head/dlfcn.h
-@@ -29,7 +29,7 @@
+@@ -30,7 +30,7 @@
#ifndef _DLFCN_H
#define _DLFCN_H
@@ -61,8 +61,8 @@ Index: libc/usr/src/head/fcntl.h
--- libc.orig/usr/src/head/fcntl.h
+++ libc/usr/src/head/fcntl.h
@@ -32,7 +32,7 @@
-
- #pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.6.1.7 */
+ #ifndef _FCNTL_H
+ #define _FCNTL_H
-#include <sys/feature_tests.h>
+#include <features.h>
@@ -74,8 +74,8 @@ Index: libc/usr/src/head/float.h
--- libc.orig/usr/src/head/float.h
+++ libc/usr/src/head/float.h
@@ -33,7 +33,7 @@
-
- #pragma ident "%Z%%M% %I% %E% SMI"
+ #ifndef _FLOAT_H
+ #define _FLOAT_H
-#include <sys/feature_tests.h>
+#include <features.h>
@@ -87,8 +87,8 @@ Index: libc/usr/src/head/fmtmsg.h
--- libc.orig/usr/src/head/fmtmsg.h
+++ libc/usr/src/head/fmtmsg.h
@@ -33,7 +33,7 @@
-
- #pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.3 */
+ #ifndef _FMTMSG_H
+ #define _FMTMSG_H
-#include <sys/feature_tests.h>
+#include <features.h>
@@ -100,8 +100,8 @@ Index: libc/usr/src/head/ftw.h
--- libc.orig/usr/src/head/ftw.h
+++ libc/usr/src/head/ftw.h
@@ -32,7 +32,7 @@
-
- #pragma ident "%Z%%M% %I% %E% SMI"
+ #ifndef _FTW_H
+ #define _FTW_H
-#include <sys/feature_tests.h>
+#include <features.h>
@@ -125,7 +125,7 @@ Index: libc/usr/src/head/glob.h
===================================================================
--- libc.orig/usr/src/head/glob.h
+++ libc/usr/src/head/glob.h
-@@ -67,7 +67,7 @@
+@@ -68,7 +68,7 @@
#ifndef _GLOB_H
#define _GLOB_H
@@ -139,8 +139,8 @@ Index: libc/usr/src/head/grp.h
--- libc.orig/usr/src/head/grp.h
+++ libc/usr/src/head/grp.h
@@ -33,7 +33,7 @@
-
- #pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.3.3.1 */
+ #ifndef _GRP_H
+ #define _GRP_H
-#include <sys/feature_tests.h>
+#include <features.h>
@@ -152,8 +152,8 @@ Index: libc/usr/src/head/iconv.h
--- libc.orig/usr/src/head/iconv.h
+++ libc/usr/src/head/iconv.h
@@ -29,7 +29,7 @@
-
- #pragma ident "%Z%%M% %I% %E% SMI"
+ #ifndef _ICONV_H
+ #define _ICONV_H
-#include <sys/feature_tests.h>
+#include <features.h>
@@ -177,9 +177,9 @@ Index: libc/usr/src/head/iso/ctype_iso.h
===================================================================
--- libc.orig/usr/src/head/iso/ctype_iso.h
+++ libc/usr/src/head/iso/ctype_iso.h
-@@ -45,7 +45,7 @@
-
- #pragma ident "%Z%%M% %I% %E% SMI"
+@@ -44,7 +44,7 @@
+ #ifndef _ISO_CTYPE_ISO_H
+ #define _ISO_CTYPE_ISO_H
-#include <sys/feature_tests.h>
+#include <features.h>
@@ -191,8 +191,8 @@ Index: libc/usr/src/head/iso/locale_iso.h
--- libc.orig/usr/src/head/iso/locale_iso.h
+++ libc/usr/src/head/iso/locale_iso.h
@@ -45,7 +45,7 @@
-
- #pragma ident "%Z%%M% %I% %E% SMI"
+ #ifndef _ISO_LOCALE_ISO_H
+ #define _ISO_LOCALE_ISO_H
-#include <sys/feature_tests.h>
+#include <features.h>
@@ -203,7 +203,7 @@ Index: libc/usr/src/head/iso/setjmp_iso.h
===================================================================
--- libc.orig/usr/src/head/iso/setjmp_iso.h
+++ libc/usr/src/head/iso/setjmp_iso.h
-@@ -43,7 +43,7 @@
+@@ -44,7 +44,7 @@
#ifndef _ISO_SETJMP_ISO_H
#define _ISO_SETJMP_ISO_H
@@ -229,7 +229,7 @@ Index: libc/usr/src/head/iso/stdio_iso.h
===================================================================
--- libc.orig/usr/src/head/iso/stdio_iso.h
+++ libc/usr/src/head/iso/stdio_iso.h
-@@ -46,7 +46,7 @@
+@@ -48,7 +48,7 @@
#ifndef _ISO_STDIO_ISO_H
#define _ISO_STDIO_ISO_H
@@ -242,7 +242,7 @@ Index: libc/usr/src/head/iso/stdlib_iso.h
===================================================================
--- libc.orig/usr/src/head/iso/stdlib_iso.h
+++ libc/usr/src/head/iso/stdlib_iso.h
-@@ -43,7 +43,7 @@
+@@ -45,7 +45,7 @@
#ifndef _ISO_STDLIB_ISO_H
#define _ISO_STDLIB_ISO_H
@@ -256,8 +256,8 @@ Index: libc/usr/src/head/iso/string_iso.h
--- libc.orig/usr/src/head/iso/string_iso.h
+++ libc/usr/src/head/iso/string_iso.h
@@ -45,7 +45,7 @@
-
- #pragma ident "%Z%%M% %I% %E% SMI"
+ #ifndef _ISO_STRING_ISO_H
+ #define _ISO_STRING_ISO_H
-#include <sys/feature_tests.h>
+#include <features.h>
@@ -269,8 +269,8 @@ Index: libc/usr/src/head/iso/wctype_iso.h
--- libc.orig/usr/src/head/iso/wctype_iso.h
+++ libc/usr/src/head/iso/wctype_iso.h
@@ -45,7 +45,7 @@
-
- #pragma ident "%Z%%M% %I% %E% SMI"
+ #ifndef _ISO_WCTYPE_ISO_H
+ #define _ISO_WCTYPE_ISO_H
-#include <sys/feature_tests.h>
+#include <features.h>
@@ -282,27 +282,14 @@ Index: libc/usr/src/head/langinfo.h
--- libc.orig/usr/src/head/langinfo.h
+++ libc/usr/src/head/langinfo.h
@@ -33,7 +33,7 @@
-
- #pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.2 */
+ #ifndef _LANGINFO_H
+ #define _LANGINFO_H
-#include <sys/feature_tests.h>
+#include <features.h>
#include <nl_types.h>
#ifdef __cplusplus
-Index: libc/usr/src/head/libgen.h
-===================================================================
---- libc.orig/usr/src/head/libgen.h
-+++ libc/usr/src/head/libgen.h
-@@ -37,7 +37,7 @@
-
- #pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 2.4.2.8 */
-
--#include <sys/feature_tests.h>
-+#include <features.h>
-
- #include <sys/types.h>
- #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
Index: libc/usr/src/head/limits.h
===================================================================
--- libc.orig/usr/src/head/limits.h
@@ -321,8 +308,8 @@ Index: libc/usr/src/head/monetary.h
--- libc.orig/usr/src/head/monetary.h
+++ libc/usr/src/head/monetary.h
@@ -29,7 +29,7 @@
-
- #pragma ident "%Z%%M% %I% %E% SMI"
+ #ifndef _MONETARY_H
+ #define _MONETARY_H
-#include <sys/feature_tests.h>
+#include <features.h>
@@ -334,8 +321,8 @@ Index: libc/usr/src/head/mqueue.h
--- libc.orig/usr/src/head/mqueue.h
+++ libc/usr/src/head/mqueue.h
@@ -29,7 +29,7 @@
-
- #pragma ident "%Z%%M% %I% %E% SMI"
+ #ifndef _MQUEUE_H
+ #define _MQUEUE_H
-#include <sys/feature_tests.h>
+#include <features.h>
@@ -347,8 +334,8 @@ Index: libc/usr/src/head/ndbm.h
--- libc.orig/usr/src/head/ndbm.h
+++ libc/usr/src/head/ndbm.h
@@ -41,7 +41,7 @@
-
- #pragma ident "%Z%%M% %I% %E% SMI"
+ #ifndef _NDBM_H
+ #define _NDBM_H
-#include <sys/feature_tests.h>
+#include <features.h>
@@ -359,7 +346,7 @@ Index: libc/usr/src/head/netdb.h
===================================================================
--- libc.orig/usr/src/head/netdb.h
+++ libc/usr/src/head/netdb.h
-@@ -76,7 +76,7 @@
+@@ -78,7 +78,7 @@
#if !defined(_XPG4_2) || defined(_XPG6) || defined(__EXTENSIONS__)
#include <sys/socket.h>
#endif /* !defined(_XPG4_2) || defined(_XPG6) || defined(__EXTENSIONS__) */
@@ -372,7 +359,7 @@ Index: libc/usr/src/head/poll.h
===================================================================
--- libc.orig/usr/src/head/poll.h
+++ libc/usr/src/head/poll.h
-@@ -33,7 +33,7 @@
+@@ -34,7 +34,7 @@
* Poll system call interface definitions.
*/
@@ -385,7 +372,7 @@ Index: libc/usr/src/head/pthread.h
===================================================================
--- libc.orig/usr/src/head/pthread.h
+++ libc/usr/src/head/pthread.h
-@@ -27,7 +27,7 @@
+@@ -29,7 +29,7 @@
#ifndef _PTHREAD_H
#define _PTHREAD_H
@@ -399,8 +386,8 @@ Index: libc/usr/src/head/pwd.h
--- libc.orig/usr/src/head/pwd.h
+++ libc/usr/src/head/pwd.h
@@ -33,7 +33,7 @@
-
- #pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.3.1.9 */
+ #ifndef _PWD_H
+ #define _PWD_H
-#include <sys/feature_tests.h>
+#include <features.h>
@@ -412,8 +399,8 @@ Index: libc/usr/src/head/re_comp.h
--- libc.orig/usr/src/head/re_comp.h
+++ libc/usr/src/head/re_comp.h
@@ -29,7 +29,7 @@
-
- #pragma ident "%Z%%M% %I% %E% SMI"
+ #ifndef _RE_COMP_H
+ #define _RE_COMP_H
-#include <sys/feature_tests.h>
+#include <features.h>
@@ -424,7 +411,7 @@ Index: libc/usr/src/head/regex.h
===================================================================
--- libc.orig/usr/src/head/regex.h
+++ libc/usr/src/head/regex.h
-@@ -36,7 +36,7 @@
+@@ -38,7 +38,7 @@
#ifndef _REGEX_H
#define _REGEX_H
@@ -438,8 +425,8 @@ Index: libc/usr/src/head/semaphore.h
--- libc.orig/usr/src/head/semaphore.h
+++ libc/usr/src/head/semaphore.h
@@ -29,7 +29,7 @@
-
- #pragma ident "%Z%%M% %I% %E% SMI"
+ #ifndef _SEMAPHORE_H
+ #define _SEMAPHORE_H
-#include <sys/feature_tests.h>
+#include <features.h>
@@ -450,7 +437,7 @@ Index: libc/usr/src/head/spawn.h
===================================================================
--- libc.orig/usr/src/head/spawn.h
+++ libc/usr/src/head/spawn.h
-@@ -31,7 +31,7 @@
+@@ -33,7 +33,7 @@
#ifndef _SPAWN_H
#define _SPAWN_H
@@ -464,7 +451,7 @@ Index: libc/usr/src/head/strings.h
--- libc.orig/usr/src/head/strings.h
+++ libc/usr/src/head/strings.h
@@ -30,7 +30,7 @@
- #pragma ident "%Z%%M% %I% %E% SMI"
+ #define _STRINGS_H
#include <sys/types.h>
-#include <sys/feature_tests.h>
@@ -476,7 +463,7 @@ Index: libc/usr/src/head/stropts.h
===================================================================
--- libc.orig/usr/src/head/stropts.h
+++ libc/usr/src/head/stropts.h
-@@ -37,7 +37,7 @@
+@@ -36,7 +36,7 @@
* Streams user options definitions.
*/
@@ -503,8 +490,8 @@ Index: libc/usr/src/head/utmpx.h
--- libc.orig/usr/src/head/utmpx.h
+++ libc/usr/src/head/utmpx.h
@@ -37,7 +37,7 @@
-
- #pragma ident "%Z%%M% %I% %E% SMI"
+ #ifndef _UTMPX_H
+ #define _UTMPX_H
-#include <sys/feature_tests.h>
+#include <features.h>
@@ -528,7 +515,7 @@ Index: libc/usr/src/head/wchar.h
===================================================================
--- libc.orig/usr/src/head/wchar.h
+++ libc/usr/src/head/wchar.h
-@@ -26,7 +26,7 @@
+@@ -27,7 +27,7 @@
#ifndef _WCHAR_H
#define _WCHAR_H
@@ -542,21 +529,21 @@ Index: libc/usr/src/head/widec.h
--- libc.orig/usr/src/head/widec.h
+++ libc/usr/src/head/widec.h
@@ -35,7 +35,7 @@
-
- #pragma ident "%Z%%M% %I% %E% SMI"
+ #ifndef _WIDEC_H
+ #define _WIDEC_H
-#include <sys/feature_tests.h>
+#include <features.h>
- #if defined(__STDC__)
#include <stdio.h> /* For definition of FILE */
+ #include <euc.h>
Index: libc/usr/src/head/wordexp.h
===================================================================
--- libc.orig/usr/src/head/wordexp.h
+++ libc/usr/src/head/wordexp.h
@@ -33,7 +33,7 @@
-
- #pragma ident "%Z%%M% %I% %E% SMI"
+ #ifndef _WORDEXP_H
+ #define _WORDEXP_H
-#include <sys/feature_tests.h>
+#include <features.h>
@@ -568,8 +555,8 @@ Index: libc/usr/src/head/iso/wchar_iso.h
--- libc.orig/usr/src/head/iso/wchar_iso.h
+++ libc/usr/src/head/iso/wchar_iso.h
@@ -41,7 +41,7 @@
-
- #pragma ident "%Z%%M% %I% %E% SMI"
+ #ifndef _ISO_WCHAR_ISO_H
+ #define _ISO_WCHAR_ISO_H
-#include <sys/feature_tests.h>
+#include <features.h>
diff --git a/libc/debian/patches/gnu-basename.patch b/libc/debian/patches/gnu-basename.patch
index 7231d38..29ff0fb 100644
--- a/libc/debian/patches/gnu-basename.patch
+++ b/libc/debian/patches/gnu-basename.patch
@@ -2,24 +2,31 @@ Index: libc/usr/src/head/libgen.h
===================================================================
--- libc.orig/usr/src/head/libgen.h
+++ libc/usr/src/head/libgen.h
-@@ -49,10 +49,9 @@
+@@ -37,7 +37,7 @@
+ #ifndef _LIBGEN_H
+ #define _LIBGEN_H
+
+-#include <sys/feature_tests.h>
++#include <features.h>
+
+ #include <sys/types.h>
+ #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
+@@ -49,7 +49,10 @@
extern "C" {
#endif
--#ifdef __STDC__
+#ifndef basename
+#define basename basename
extern char *basename(char *);
--#else
--extern char *basename();
- #endif
++#endif
+ extern char *dirname(char *);
- #ifdef __STDC__
+ #if !defined(_XPG6) || defined(__EXTENSIONS__)
Index: libc/usr/src/head/string.h
===================================================================
--- libc.orig/usr/src/head/string.h
+++ libc/usr/src/head/string.h
-@@ -136,6 +136,10 @@ extern char *strdup(const char *);
+@@ -150,6 +150,10 @@ extern char *strdup(const char *);
extern void *mempcpy(void *, const void *, size_t);
extern void *memrchr(const void *, int, size_t);
extern void *rawmemchr(const void *, int);
diff --git a/libc/debian/patches/illumos-3243-getent-shadow.patch b/libc/debian/patches/illumos-3243-getent-shadow.patch
deleted file mode 100644
index ca496d6..0000000
--- a/libc/debian/patches/illumos-3243-getent-shadow.patch
+++ /dev/null
@@ -1,148 +0,0 @@
-Description: Add shadow support to getent(1)
- sudo package uses 'getent shadow root'
-Bug: https://www.illumos.org/issues/3243
-Index: b/usr/src/cmd/getent/getent.c
-===================================================================
---- a/usr/src/cmd/getent/getent.c 2014-03-02 23:20:16.561911384 +0400
-+++ b/usr/src/cmd/getent/getent.c 2014-03-02 23:22:03.943281209 +0400
-@@ -42,6 +42,7 @@
-
- static struct table t[] = {
- { "passwd", dogetpw },
-+ { "shadow", dogetsp },
- { "group", dogetgr },
- { "hosts", dogethost },
- { "ipnodes", dogetipnodes },
-Index: b/usr/src/cmd/getent/Makefile
-===================================================================
---- a/usr/src/cmd/getent/Makefile 2014-03-02 23:22:01.564110989 +0400
-+++ b/usr/src/cmd/getent/Makefile 2014-03-02 23:22:03.944799150 +0400
-@@ -41,6 +41,7 @@
- dogetproject.o \
- dogetproto.o \
- dogetpw.o \
-+ dogetsp.o \
- dogetserv.o \
- getent.o
-
-Index: b/usr/src/cmd/getent/dogetsp.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ b/usr/src/cmd/getent/dogetsp.c 2014-03-02 23:22:03.946237426 +0400
-@@ -0,0 +1,62 @@
-+/*
-+ * 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.
-+ * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
-+ * Use is subject to license terms.
-+ */
-+
-+#include <stdio.h>
-+#include <shadow.h>
-+#include <stdlib.h>
-+#include <errno.h>
-+#include "getent.h"
-+
-+/*
-+ * getspnam - get entries from shadow database
-+ */
-+int
-+dogetsp(const char **list)
-+{
-+ struct spwd *sp;
-+ int rc = EXC_SUCCESS;
-+ char *ptr;
-+ uid_t uid;
-+
-+
-+ if (list == NULL || *list == NULL) {
-+ setspent();
-+ while ((sp = getspent()) != NULL)
-+ (void) putspent(sp, stdout);
-+ endspent();
-+ } else {
-+ for (; *list != NULL; list++) {
-+ sp = getspnam(*list);
-+ if (sp == NULL)
-+ rc = EXC_NAME_NOT_FOUND;
-+ else
-+ (void) putspent(sp, stdout);
-+ }
-+ }
-+
-+ return (rc);
-+}
-Index: b/usr/src/cmd/getent/getent.h
-===================================================================
---- a/usr/src/cmd/getent/getent.h 2014-03-02 23:20:16.561856197 +0400
-+++ b/usr/src/cmd/getent/getent.h 2014-03-02 23:22:03.947307846 +0400
-@@ -42,6 +42,7 @@
- #define EXC_ENUM_NOT_SUPPORTED 3
-
- extern int dogetpw(const char **);
-+extern int dogetsp(const char **);
- extern int dogetgr(const char **);
- extern int dogethost(const char **);
- extern int dogetipnodes(const char **);
-Index: b/usr/src/man/man1m/getent.1m
-===================================================================
---- a/usr/src/man/man1m/getent.1m 2014-03-02 23:20:16.561984530 +0400
-+++ b/usr/src/man/man1m/getent.1m 2014-03-02 23:22:03.949619471 +0400
-@@ -21,10 +21,10 @@
- .sp
- .LP
- \fIdatabase\fR is the name of the database to be examined. This can be
--\fBpasswd\fR, \fBgroup\fR, \fBhosts\fR, \fBipnodes\fR, \fBservices\fR,
-+\fBpasswd\fR, \fBshadow\fR, \fBgroup\fR, \fBhosts\fR, \fBipnodes\fR, \fBservices\fR,
- \fBprotocols\fR, \fBethers\fR, \fBproject\fR, \fBnetworks\fR, or
- \fBnetmasks\fR. For each of these databases, \fBgetent\fR uses the appropriate
--library routines described in \fBgetpwnam\fR(3C), \fBgetgrnam\fR(3C),
-+library routines described in \fBgetpwnam\fR(3C), \fBgetspnam\fR(3C), \fBgetgrnam\fR(3C),
- \fBgethostbyaddr\fR(3NSL), \fBgethostbyname\fR(3NSL),
- \fBgetipnodebyaddr\fR(3SOCKET), \fBgetipnodebyname\fR(3SOCKET),
- \fBgetservbyname\fR(3SOCKET), \fBgetprotobyname\fR(3SOCKET),
-@@ -41,7 +41,7 @@
- .LP
- \fBgetent\fR prints out the database entries that match each of the supplied
- keys, one per line, in the format of the matching administrative file:
--\fBpasswd\fR(4), \fBgroup\fR(4), \fBproject\fR(4), \fBhosts\fR(4),
-+\fBpasswd\fR(4), \fBshadow\fR(4), \fBgroup\fR(4), \fBproject\fR(4), \fBhosts\fR(4),
- \fBservices\fR(4), \fBprotocols\fR(4), \fBethers\fR(3SOCKET),
- \fBnetworks\fR(4), or \fBnetmasks\fR(4). If no key is given, all entries
- returned by the corresponding enumeration library routine, for example,
-@@ -149,6 +149,15 @@
- .RE
-
- .sp
-+.ne 2
-+.na
-+\fB\fB/etc/shadow\fR\fR
-+.ad
-+.RS 22n
-+shadowed password file
-+.RE
-+
-+.sp
- .ne 2
- .na
- \fB\fB/etc/group\fR\fR
diff --git a/libc/debian/patches/illumos-3244-ret_val-uninitialized.patch b/libc/debian/patches/illumos-3244-ret_val-uninitialized.patch
deleted file mode 100644
index 437cbc2..0000000
--- a/libc/debian/patches/illumos-3244-ret_val-uninitialized.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-Description: 'ret_val' may be used uninitialized
- utmpd.c: In function 'wait_for_pids':
- utmpd.c:406:5: error: 'ret_val' may be used uninitialized
- in this function [-Werror=uninitialized]
-Bug: https://www.illumos.org/issues/3244
-Index: b/usr/src/cmd/utmpd/utmpd.c
-===================================================================
---- a/usr/src/cmd/utmpd/utmpd.c 2014-03-02 23:20:15.957682277 +0400
-+++ b/usr/src/cmd/utmpd/utmpd.c 2014-03-02 23:22:07.029127601 +0400
-@@ -351,7 +351,7 @@
- register struct pollfd *pfd;
- register int i;
- pid_t pid;
-- int ret_val;
-+ int ret_val = 0;
- int timeout;
- static time_t last_timeout = 0;
- static int bad_error = 0; /* Count of POLL errors */
diff --git a/libc/debian/patches/illumos-4688-getlogin_r.patch b/libc/debian/patches/illumos-4688-getlogin_r.patch
deleted file mode 100644
index b53db4a..0000000
--- a/libc/debian/patches/illumos-4688-getlogin_r.patch
+++ /dev/null
@@ -1,86 +0,0 @@
-commit 61f9f3e6dc0a66ec5c243562765c1b4a3297e8a4
-Author: Robert Mustacchi <rm@joyent.com>
-Date: Sat Mar 15 20:01:40 2014 +0000
-
- 4688 getlogin_r shouldn't clobber memory
- Reviewed by: Marcel Telka <marcel.telka@nexenta.com>
- Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
- Reviewed by: Gary Mills <gary_mills@fastmail.fm>
- Reviewed by: Toomas Soome <tsoome@me.com>
- Approved by: Dan McDonald <danmcd@omniti.com>
-
-diff --git a/usr/src/lib/libc/port/gen/getlogin.c b/usr/src/lib/libc/port/gen/getlogin.c
-index a46d209..fadf3e0 100644
---- a/usr/src/lib/libc/port/gen/getlogin.c
-+++ b/usr/src/lib/libc/port/gen/getlogin.c
-@@ -85,6 +85,7 @@ getl_r_common(char *answer, size_t namelen, size_t maxlen)
- int uf;
- off64_t me;
- struct futmpx ubuf;
-+ size_t ulen;
-
- if ((me = (off64_t)ttyslot()) < 0)
- return (NULL);
-@@ -100,13 +101,22 @@ getl_r_common(char *answer, size_t namelen, size_t maxlen)
- return (NULL);
-
- /* Insufficient buffer size */
-- if (namelen < strnlen(&ubuf.ut_user[0], maxlen)) {
-+ ulen = strnlen(ubuf.ut_user, maxlen);
-+ if (namelen <= ulen) {
- errno = ERANGE;
- return (NULL);
- }
-- (void) strncpy(&answer[0], &ubuf.ut_user[0], maxlen);
-- answer[maxlen] = '\0';
-- return (&answer[0]);
-+
-+ /*
-+ * While the interface to getlogin_r says that a user should supply a
-+ * buffer with at least LOGIN_NAME_MAX bytes, we shouldn't assume they
-+ * have, especially since we've been supplied with its actual size.
-+ * Doing otherwise is just asking us to corrupt memory (and has in the
-+ * past).
-+ */
-+ (void) strncpy(answer, ubuf.ut_user, ulen);
-+ answer[ulen] = '\0';
-+ return (answer);
- }
-
- /*
-diff --git a/usr/src/man/man3c/getlogin.3c b/usr/src/man/man3c/getlogin.3c
-index 6813834..cbd4bbc 100644
---- a/usr/src/man/man3c/getlogin.3c
-+++ b/usr/src/man/man3c/getlogin.3c
-@@ -10,7 +10,7 @@
- .\" 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]
--.TH GETLOGIN 3C "May 25, 2013"
-+.TH GETLOGIN 3C "Mar 15, 2014"
- .SH NAME
- getlogin, getlogin_r \- get login name
- .SH SYNOPSIS
-@@ -71,12 +71,17 @@ login name is to call \fBcuserid\fR(3C), or to call \fBgetlogin()\fR and if it
- fails to call \fBgetpwuid\fR(3C).
- .sp
- .LP
-+
- The \fBgetlogin_r()\fR function has the same functionality as \fBgetlogin()\fR
--except that the caller must supply a buffer \fIname\fR with length
--\fInamelen\fR to store the result. The \fIname\fR buffer must be at least
--\fBLOGIN_NAME_MAX\fR bytes in size (defined in <\fBlimits.h\fR>). The
--POSIX version (see \fBstandards\fR(5)) of \fBgetlogin_r()\fR takes a
--\fInamesize\fR parameter of type \fBsize_t\fR.
-+except that the caller must supply a buffer \fIname\fR with length \fInamelen\fR
-+to store the result. The \fIname\fR buffer should be at least
-+\fBLOGIN_NAME_MAX\fR bytes in size (defined in <\fBlimits.h\fR>). The POSIX
-+version (see \fBstandards\fR(5)) of \fBgetlogin_r()\fR takes a \fInamesize\fR
-+parameter of type \fBsize_t\fR. If the size of the supplied buffer is less than
-+the size of \fBLOGIN_NAME_MAX\fR and the name, including the null
-+terminator, does not fit inside the buffer, than an error will be generated.
-+Otherwise, the buffer \fIname\fR will be updated with the login name.
-+
- .SH RETURN VALUES
- .sp
- .LP
diff --git a/libc/debian/patches/libc-add-mkostemp.patch b/libc/debian/patches/libc-add-mkostemp.patch
index c5e722a..6f13af2 100644
--- a/libc/debian/patches/libc-add-mkostemp.patch
+++ b/libc/debian/patches/libc-add-mkostemp.patch
@@ -1,8 +1,8 @@
-Index: b/usr/src/lib/libc/port/mapfile-vers
+Index: libc/usr/src/lib/libc/port/mapfile-vers
===================================================================
---- a/usr/src/lib/libc/port/mapfile-vers 2014-03-02 23:24:53.941324987 +0400
-+++ b/usr/src/lib/libc/port/mapfile-vers 2014-03-02 23:24:57.222356447 +0400
-@@ -116,14 +116,7 @@
+--- libc.orig/usr/src/lib/libc/port/mapfile-vers
++++ libc/usr/src/lib/libc/port/mapfile-vers
+@@ -258,14 +258,7 @@ SYMBOL_VERSION ILLUMOS_0.4 { # Illumos a
protected:
pipe2;
dup3;
@@ -18,7 +18,7 @@ Index: b/usr/src/lib/libc/port/mapfile-vers
SYMBOL_VERSION DYSON_1 {
global:
-@@ -145,6 +138,8 @@
+@@ -287,6 +280,8 @@ SYMBOL_VERSION DYSON_1 {
gnu_strerror_r;
mempcpy;
memrchr;
@@ -27,7 +27,7 @@ Index: b/usr/src/lib/libc/port/mapfile-vers
program_invocation_name;
program_invocation_short_name;
qsort_r;
-@@ -152,6 +147,8 @@
+@@ -294,6 +289,8 @@ SYMBOL_VERSION DYSON_1 {
sendfile;
sendfilev;
$if _ELF32
@@ -36,58 +36,11 @@ Index: b/usr/src/lib/libc/port/mapfile-vers
sendfile64;
sendfilev64;
$endif
-Index: b/usr/src/head/stdlib.h
+Index: libc/usr/src/head/stdlib.h
===================================================================
---- a/usr/src/head/stdlib.h 2014-03-02 23:24:53.949923251 +0400
-+++ b/usr/src/head/stdlib.h 2014-03-02 23:24:57.224298130 +0400
-@@ -102,9 +102,17 @@
- #ifdef __PRAGMA_REDEFINE_EXTNAME
- #pragma redefine_extname mkstemp mkstemp64
- #pragma redefine_extname mkstemps mkstemps64
-+#if defined(_GNU_SOURCE) || defined(__EXTENSIONS__)
-+#pragma redefine_extname mkostemp mkostemp64
-+#pragma redefine_extname mkostemps mkostemps64
-+#endif
- #else /* __PRAGMA_REDEFINE_EXTNAME */
- #define mkstemp mkstemp64
- #define mkstemps mkstemps64
-+#if defined(_GNU_SOURCE) || defined(__EXTENSIONS__)
-+#define mkostemp mkostemp64
-+#define mkostemps mkostemps64
-+#endif
- #endif /* __PRAGMA_REDEFINE_EXTNAME */
-
- #endif /* _FILE_OFFSET_BITS == 64 */
-@@ -115,9 +123,17 @@
- #ifdef __PRAGMA_REDEFINE_EXTNAME
- #pragma redefine_extname mkstemp64 mkstemp
- #pragma redefine_extname mkstemps64 mkstemps
-+#if defined(_GNU_SOURCE) || defined(__EXTENSIONS__)
-+#pragma redefine_extname mkostemp64 mkostemp
-+#pragma redefine_extname mkostemps64 mkostemps
-+#endif
- #else /* __PRAGMA_REDEFINE_EXTNAME */
- #define mkstemp64 mkstemp
- #define mkstemps64 mkstemps
-+#if defined(_GNU_SOURCE) || defined(__EXTENSIONS__)
-+#define mkostemp64 mkostemp
-+#define mkostemps64 mkostemps
-+#endif
- #endif /* __PRAGMA_REDEFINE_EXTNAME */
-
- #endif /* _LP64 && _LARGEFILE64_SOURCE */
-@@ -176,6 +192,10 @@
- #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
- extern int mkstemps(char *, int);
- #endif
-+#if defined(_GNU_SOURCE) || defined(__EXTENSIONS__)
-+int mkostemp(char *, int);
-+int mkostemps(char *, int, int);
-+#endif
- #endif /* defined(__EXTENSIONS__) ... */
-
- #if defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
-@@ -184,6 +204,10 @@
+--- libc.orig/usr/src/head/stdlib.h
++++ libc/usr/src/head/stdlib.h
+@@ -195,6 +195,10 @@ extern int mkstemp64(char *);
#if !defined(_XPG4_2) || defined(__EXTENSIONS__)
extern int mkstemps64(char *, int);
#endif
@@ -97,4 +50,4 @@ Index: b/usr/src/head/stdlib.h
+#endif
#endif /* _LARGEFILE64_SOURCE... */
- #if defined(__EXTENSIONS__) || \
+ #if !defined(_STRICT_SYMBOLS) || defined(_XPG7)
diff --git a/libc/debian/patches/libc-add-qsort_r.patch b/libc/debian/patches/libc-add-qsort_r.patch
index 4a932e5..db4eab9 100644
--- a/libc/debian/patches/libc-add-qsort_r.patch
+++ b/libc/debian/patches/libc-add-qsort_r.patch
@@ -1,8 +1,8 @@
-Index: b/usr/src/common/util/qsort.c
+Index: libc/usr/src/common/util/qsort.c
===================================================================
---- a/usr/src/common/util/qsort.c 2014-03-02 23:19:25.516020281 +0400
-+++ b/usr/src/common/util/qsort.c 2014-03-02 23:24:53.936886596 +0400
-@@ -50,9 +50,15 @@
+--- libc.orig/usr/src/common/util/qsort.c
++++ libc/usr/src/common/util/qsort.c
+@@ -50,9 +50,15 @@ static void swapb(char *r1, char *r2, si
* note: cstyle specifically prohibits nested conditional operators
* but this is the only way to do the median of 3 function in-line
*/
@@ -18,7 +18,7 @@ Index: b/usr/src/common/util/qsort.c
#define THRESH_L 5 /* threshold for insertion sort */
#define THRESH_M3 20 /* threshold for median of 3 */
-@@ -104,12 +110,22 @@
+@@ -104,12 +110,22 @@ typedef struct {
* 9) The user compare function modifies the data records
*/
@@ -41,7 +41,7 @@ Index: b/usr/src/common/util/qsort.c
{
size_t i; /* temporary variable */
-@@ -209,7 +225,12 @@
+@@ -209,7 +225,12 @@ qsort(
b_par = t_par;
while (b_par > b_lim) {
b_par -= rsiz;
@@ -55,7 +55,7 @@ Index: b/usr/src/common/util/qsort.c
break;
}
(*swapf)(b_par, b_par + rsiz, loops);
-@@ -323,7 +344,11 @@
+@@ -323,7 +344,11 @@ qsort(
if (b_par == m2) {
continue;
}
@@ -67,7 +67,7 @@ Index: b/usr/src/common/util/qsort.c
if (cv > 0) {
break;
}
-@@ -342,7 +367,11 @@
+@@ -342,7 +367,11 @@ qsort(
if (t_par == m2) {
continue;
}
@@ -79,11 +79,11 @@ Index: b/usr/src/common/util/qsort.c
if (cv < 0) {
break;
}
-Index: b/usr/src/lib/libc/port/mapfile-vers
+Index: libc/usr/src/lib/libc/port/mapfile-vers
===================================================================
---- a/usr/src/lib/libc/port/mapfile-vers 2014-03-02 23:24:41.444344258 +0400
-+++ b/usr/src/lib/libc/port/mapfile-vers 2014-03-02 23:24:53.941324987 +0400
-@@ -147,6 +147,7 @@
+--- libc.orig/usr/src/lib/libc/port/mapfile-vers
++++ libc/usr/src/lib/libc/port/mapfile-vers
+@@ -289,6 +289,7 @@ SYMBOL_VERSION DYSON_1 {
memrchr;
program_invocation_name;
program_invocation_short_name;
@@ -91,11 +91,11 @@ Index: b/usr/src/lib/libc/port/mapfile-vers
rawmemchr;
sendfile;
sendfilev;
-Index: b/usr/src/lib/libc/i386/Makefile.com
+Index: libc/usr/src/lib/libc/i386/Makefile.com
===================================================================
---- a/usr/src/lib/libc/i386/Makefile.com 2014-03-02 23:24:43.817337941 +0400
-+++ b/usr/src/lib/libc/i386/Makefile.com 2014-03-02 23:24:53.944783778 +0400
-@@ -96,6 +96,7 @@
+--- libc.orig/usr/src/lib/libc/i386/Makefile.com
++++ libc/usr/src/lib/libc/i386/Makefile.com
+@@ -101,6 +101,7 @@ COMOBJS= \
bsearch.o \
bzero.o \
qsort.o \
@@ -103,18 +103,18 @@ Index: b/usr/src/lib/libc/i386/Makefile.com
strtol.o \
strtoul.o \
strtoll.o \
-Index: b/usr/src/common/util/qsort_r.c
+Index: libc/usr/src/common/util/qsort_r.c
===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ b/usr/src/common/util/qsort_r.c 2014-03-02 23:24:53.946009441 +0400
+--- /dev/null
++++ libc/usr/src/common/util/qsort_r.c
@@ -0,0 +1,2 @@
+#define QSORT_R
+#include "qsort.c"
-Index: b/usr/src/lib/libc/amd64/Makefile
+Index: libc/usr/src/lib/libc/amd64/Makefile
===================================================================
---- a/usr/src/lib/libc/amd64/Makefile 2014-03-02 23:24:43.814945646 +0400
-+++ b/usr/src/lib/libc/amd64/Makefile 2014-03-02 23:24:53.947847452 +0400
-@@ -95,6 +95,7 @@
+--- libc.orig/usr/src/lib/libc/amd64/Makefile
++++ libc/usr/src/lib/libc/amd64/Makefile
+@@ -100,6 +100,7 @@ COMOBJS= \
bsearch.o \
bzero.o \
qsort.o \
@@ -122,11 +122,11 @@ Index: b/usr/src/lib/libc/amd64/Makefile
strtol.o \
strtoul.o \
strtoll.o \
-Index: b/usr/src/head/stdlib.h
+Index: libc/usr/src/head/stdlib.h
===================================================================
---- a/usr/src/head/stdlib.h 2014-03-02 23:23:31.363268917 +0400
-+++ b/usr/src/head/stdlib.h 2014-03-02 23:24:53.949923251 +0400
-@@ -33,6 +33,8 @@
+--- libc.orig/usr/src/head/stdlib.h
++++ libc/usr/src/head/stdlib.h
+@@ -34,6 +34,8 @@
#ifndef _STDLIB_H
#define _STDLIB_H
@@ -135,14 +135,21 @@ Index: b/usr/src/head/stdlib.h
#include <iso/stdlib_iso.h>
#include <iso/stdlib_c99.h>
-@@ -266,6 +268,10 @@
+@@ -43,6 +45,7 @@
+
+ #if defined(_GNU_SOURCE) || defined(__EXTENSIONS__)
+ # include <alloca.h>
++void qsort_r(void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
+ #endif
- #endif /* defined(__EXTENSIONS__) || !defined(_STRICT_STDC) ... */
+@@ -73,6 +76,9 @@ using std::mblen;
+ using std::mbstowcs;
+ using std::mbtowc;
+ using std::qsort;
+#if defined(_GNU_SOURCE) || defined(__EXTENSIONS__)
-+void qsort_r(void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
++using std::qsort_r;
+#endif
-+
- #else /* not __STDC__ */
-
- #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
+ using std::rand;
+ using std::realloc;
+ using std::srand;
diff --git a/libc/debian/patches/libc-add-tdestroy.patch b/libc/debian/patches/libc-add-tdestroy.patch
index 441909d..cdbc9e0 100644
--- a/libc/debian/patches/libc-add-tdestroy.patch
+++ b/libc/debian/patches/libc-add-tdestroy.patch
@@ -2,31 +2,31 @@ Index: libc/usr/src/head/search.h
===================================================================
--- libc.orig/usr/src/head/search.h
+++ libc/usr/src/head/search.h
-@@ -33,7 +33,7 @@
-
- #pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.3.1.11 */
+@@ -32,7 +32,7 @@
+ #ifndef _SEARCH_H
+ #define _SEARCH_H
-#include <sys/feature_tests.h>
+#include <features.h>
#include <sys/types.h>
#ifdef __cplusplus
-@@ -90,6 +90,10 @@ void *tsearch();
- void twalk();
- #endif
+@@ -69,6 +69,10 @@ void *tfind(const void *, void *const *,
+ void *tsearch(const void *, void **, int (*)(const void *, const void *));
+ void twalk(const void *, void (*)(const void *, VISIT, int));
+#if defined(__EXTENSIONS__) || defined(_GNU_SOURCE)
+extern void tdestroy(void *root, void (*)(void *));
+#endif
+
- #if defined(__STDC__)
#if defined(__EXTENSIONS__) || !defined(_XOPEN_SOURCE)
+ /* BSEARCH(3C) */
Index: libc/usr/src/lib/libc/port/mapfile-vers
===================================================================
--- libc.orig/usr/src/lib/libc/port/mapfile-vers
+++ libc/usr/src/lib/libc/port/mapfile-vers
-@@ -138,6 +138,7 @@ SYMBOL_VERSION DYSON_1 {
+@@ -280,6 +280,7 @@ SYMBOL_VERSION DYSON_1 {
program_invocation_name;
program_invocation_short_name;
rawmemchr;
diff --git a/libc/debian/patches/libc-include-time.h.patch b/libc/debian/patches/libc-include-time.h.patch
index a684708..cf279a1 100644
--- a/libc/debian/patches/libc-include-time.h.patch
+++ b/libc/debian/patches/libc-include-time.h.patch
@@ -1,7 +1,7 @@
-Index: b/usr/src/lib/libc/port/gen/waitpid.c
+Index: libc/usr/src/lib/libc/port/gen/waitpid.c
===================================================================
---- a/usr/src/lib/libc/port/gen/waitpid.c 2014-03-02 23:20:02.495047876 +0400
-+++ b/usr/src/lib/libc/port/gen/waitpid.c 2014-03-02 23:22:58.980666619 +0400
+--- libc.orig/usr/src/lib/libc/port/gen/waitpid.c
++++ libc/usr/src/lib/libc/port/gen/waitpid.c
@@ -42,6 +42,7 @@
#include <wait.h>
#include <sys/types.h>
@@ -10,15 +10,15 @@ Index: b/usr/src/lib/libc/port/gen/waitpid.c
#include <sys/times.h>
#include <sys/resource.h>
-Index: b/usr/src/lib/libc/port/locale/strftime.c
+Index: libc/usr/src/lib/libc/port/locale/strftime.c
===================================================================
---- a/usr/src/lib/libc/port/locale/strftime.c 2014-03-02 23:20:02.494956593 +0400
-+++ b/usr/src/lib/libc/port/locale/strftime.c 2014-03-02 23:22:58.984284004 +0400
-@@ -22,6 +22,7 @@
+--- libc.orig/usr/src/lib/libc/port/locale/strftime.c
++++ libc/usr/src/lib/libc/port/locale/strftime.c
+@@ -23,6 +23,7 @@
#include <sys/stat.h>
#include <string.h>
#include <stdio.h>
+#include <time.h>
+ #include <locale.h>
#include "timelocal.h"
-
- static char *_add(const char *, char *, const char *);
+ #include "localeimpl.h"
diff --git a/libc/debian/patches/libc-no-gets.patch b/libc/debian/patches/libc-no-gets.patch
index aa61124..8f8ed21 100644
--- a/libc/debian/patches/libc-no-gets.patch
+++ b/libc/debian/patches/libc-no-gets.patch
@@ -2,7 +2,7 @@ Index: libc/usr/src/head/iso/stdio_iso.h
===================================================================
--- libc.orig/usr/src/head/iso/stdio_iso.h
+++ libc/usr/src/head/iso/stdio_iso.h
-@@ -245,7 +245,6 @@ extern int putc(int, FILE *);
+@@ -238,7 +238,6 @@ extern int putc(int, FILE *);
extern int getchar(void);
extern int putchar(int);
#endif
@@ -10,19 +10,11 @@ Index: libc/usr/src/head/iso/stdio_iso.h
extern int puts(const char *);
extern int ungetc(int, FILE *);
extern size_t fread(void *_RESTRICT_KYWD, size_t, size_t,
-@@ -299,7 +298,6 @@ extern int fputc();
- extern int fputs();
- extern int getc();
- extern int getchar();
--extern char *gets();
- extern int putc();
- extern int putchar();
- extern int puts();
Index: libc/usr/src/head/stdio.h
===================================================================
--- libc.orig/usr/src/head/stdio.h
+++ libc/usr/src/head/stdio.h
-@@ -121,7 +121,6 @@ using std::fputc;
+@@ -122,7 +122,6 @@ using std::fputc;
using std::fputs;
using std::getc;
using std::getchar;
diff --git a/libc/debian/patches/libc-vhangup-returns-int.patch b/libc/debian/patches/libc-vhangup-returns-int.patch
deleted file mode 100644
index 57048f2..0000000
--- a/libc/debian/patches/libc-vhangup-returns-int.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-Index: b/usr/src/head/unistd.h
-===================================================================
---- a/usr/src/head/unistd.h 2014-03-02 23:25:01.891531913 +0400
-+++ b/usr/src/head/unistd.h 2014-03-02 23:25:04.183106017 +0400
-@@ -569,7 +569,7 @@
- extern pid_t vfork(void) __RETURNS_TWICE;
- #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
- #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
--extern void vhangup(void);
-+extern int vhangup(void);
- #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
- extern ssize_t write(int, const void *, size_t);
- #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
-@@ -885,7 +885,7 @@
- extern pid_t vfork();
- #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
- #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
--extern void vhangup();
-+extern int vhangup();
- #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
- extern ssize_t write();
- #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
diff --git a/libc/debian/patches/libnsl-illumos-updates.patch b/libc/debian/patches/libnsl-illumos-updates.patch
deleted file mode 100644
index 85dca3a..0000000
--- a/libc/debian/patches/libnsl-illumos-updates.patch
+++ /dev/null
@@ -1,1380 +0,0 @@
-Description: fixes illumos bugs:
- 4867 Uninitialized variables in libnsl
- 4812 libnsl: Some nisplus leftovers
- 4808 libnsl: SI_SRPC_DOMAIN is always defined
- 4803 libnsl: recursive mutex lock in return_xprt_copy()
- 4724 Possible memory leak in _clnt_vc_create_timed()
- 4462 clnt_vc_control()/clnt_dg_control() could return RPC_FAILED instead of FALSE
-Index: libc/usr/src/lib/libnsl/common/llib-lnsl
-===================================================================
---- libc.orig/usr/src/lib/libnsl/common/llib-lnsl 2014-03-01 16:18:15.000000000 +0400
-+++ libc/usr/src/lib/libnsl/common/llib-lnsl 2014-05-26 00:04:41.067232784 +0400
-@@ -23,7 +23,7 @@
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- *
-- * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
-+ * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
- */
-
-
-@@ -836,9 +836,6 @@
- /* svc_vc.c */
- SVCXPRT *svc_vc_create(int fd, uint_t sendsize, uint_t recvsize);
- SVCXPRT *svc_fd_create(int fd, uint_t sendsize, uint_t recvsize);
--void __svc_nisplus_fdcleanup_hack(void);
--void __svc_nisplus_enable_timestamps(void);
--void __svc_nisplus_purge_since(long since);
- bool_t __svc_vc_dupcache_init(SVCXPRT *xprt, void *condition, int basis);
- int __svc_vc_dup(struct svc_req *req, caddr_t *resp_buf, uint_t *resp_bufsz);
- int __svc_vc_dupdone(struct svc_req *req, caddr_t resp_buf, uint_t resp_bufsz,
-Index: libc/usr/src/lib/libnsl/common/mapfile-vers
-===================================================================
---- libc.orig/usr/src/lib/libnsl/common/mapfile-vers 2014-03-01 16:18:15.000000000 +0400
-+++ libc/usr/src/lib/libnsl/common/mapfile-vers 2014-05-26 00:04:41.077921847 +0400
-@@ -20,7 +20,7 @@
- #
- #
- # Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
--# Copyright 2011 Nexenta Systems, Inc. All rights reserved.
-+# Copyright 2014 Nexenta Systems, Inc. All rights reserved.
- #
-
- #
-@@ -467,8 +467,8 @@
-
- SYMBOL_VERSION SUNWprivate_1.5 {
- global:
-- inet_matchaddr;
- clnt_create_service_timed;
-+ inet_matchaddr;
- } SUNWprivate_1.4;
-
- SYMBOL_VERSION SUNWprivate_1.4 {
-@@ -663,9 +663,6 @@
- svc_get_local_cred;
- _svc_getreqset_proc;
- __svc_get_svcauth;
-- __svc_nisplus_enable_timestamps;
-- __svc_nisplus_fdcleanup_hack;
-- __svc_nisplus_purge_since;
- __svc_set_proc_cleanup_cb;
- __svc_vc_dup;
- __svc_vc_dupcache_init;
-Index: libc/usr/src/lib/libnsl/key/publickey.c
-===================================================================
---- libc.orig/usr/src/lib/libnsl/key/publickey.c 2014-03-01 16:18:15.000000000 +0400
-+++ libc/usr/src/lib/libnsl/key/publickey.c 2014-05-26 00:04:41.082413649 +0400
-@@ -23,6 +23,9 @@
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-+/*
-+ * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
-+ */
-
- /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
- /* All Rights Reserved */
-@@ -580,6 +583,7 @@
- syslog(LOG_INFO, "Unknown publickey nameservice '%s'",
- look->service_name);
- err = __NSW_UNAVAIL;
-+ res = 0;
- }
-
- switch (look->actions[err]) {
-@@ -662,6 +666,7 @@
- syslog(LOG_INFO, "Unknown publickey nameservice '%s'",
- look->service_name);
- err = __NSW_UNAVAIL;
-+ res = 0;
- }
- switch (look->actions[err]) {
- case __NSW_CONTINUE :
-Index: libc/usr/src/lib/libnsl/nsl/t_sndvudata.c
-===================================================================
---- libc.orig/usr/src/lib/libnsl/nsl/t_sndvudata.c 2014-03-01 16:18:15.000000000 +0400
-+++ libc/usr/src/lib/libnsl/nsl/t_sndvudata.c 2014-05-26 00:04:41.086556645 +0400
-@@ -24,8 +24,9 @@
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
--
--#pragma ident "%Z%%M% %I% %E% SMI"
-+/*
-+ * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
-+ */
-
- /*
- * t_sndudata.c and t_sndvudata.c are very similar and contain common code.
-@@ -56,7 +57,7 @@
- struct _ti_user *tiptr;
- int sv_errno;
- int didalloc;
-- char *dataptr;
-+ char *dataptr = NULL;
- unsigned int nbytes;
-
- assert(api_semantics == TX_XTI_XNS5_API);
-@@ -157,7 +158,6 @@
-
- ctlbuf.len = size;
-
-- dataptr = NULL;
- if (nbytes != 0) {
- if ((dataptr = malloc((size_t)nbytes)) == NULL) {
- t_errno = TSYSERR;
-@@ -187,13 +187,12 @@
- sig_mutex_lock(&tiptr->ti_lock);
-
- _T_TX_NEXTSTATE(T_SNDUDATA, tiptr,
-- "t_sndvudata: invalid state event T_SNDUDATA");
-+ "t_sndvudata: invalid state event T_SNDUDATA");
- if (didalloc)
- free(ctlbuf.buf);
- else
- tiptr->ti_ctlbuf = ctlbuf.buf;
-- if (dataptr != NULL)
-- free(dataptr);
-+ free(dataptr);
- sig_mutex_unlock(&tiptr->ti_lock);
- return (0);
- err_out:
-@@ -202,8 +201,7 @@
- free(ctlbuf.buf);
- else
- tiptr->ti_ctlbuf = ctlbuf.buf;
-- if (dataptr != NULL)
-- free(dataptr);
-+ free(dataptr);
- sig_mutex_unlock(&tiptr->ti_lock);
- errno = sv_errno;
- return (-1);
-Index: libc/usr/src/lib/libnsl/nss/getexecattr.c
-===================================================================
---- libc.orig/usr/src/lib/libnsl/nss/getexecattr.c 2014-03-01 16:18:15.000000000 +0400
-+++ libc/usr/src/lib/libnsl/nss/getexecattr.c 2014-05-26 00:04:41.099010929 +0400
-@@ -22,6 +22,9 @@
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-+/*
-+ * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
-+ */
-
- #include "mt.h"
- #include <stdio.h>
-@@ -167,36 +170,37 @@
- {
- int getby_flag;
- char policy_buf[BUFSIZ];
-- const char *empty = NULL;
- nss_status_t res = NSS_NOTFOUND;
- nss_XbyY_args_t arg;
- _priv_execattr _priv_exec;
- static mutex_t _nsw_exec_lock = DEFAULTMUTEX;
-
-+ if ((name != NULL) && (id != NULL)) {
-+ getby_flag = NSS_DBOP_EXECATTR_BYNAMEID;
-+ } else if (name != NULL) {
-+ getby_flag = NSS_DBOP_EXECATTR_BYNAME;
-+ } else if (id != NULL) {
-+ getby_flag = NSS_DBOP_EXECATTR_BYID;
-+ } else {
-+ return (NULL);
-+ }
-+
- NSS_XbyY_INIT(&arg, result, buffer, buflen, str2execattr);
-
-- _priv_exec.name = (name == NULL) ? empty : (const char *)name;
-- _priv_exec.type = (type == NULL) ? empty : (const char *)type;
-- _priv_exec.id = (id == NULL) ? empty : (const char *)id;
-+ _priv_exec.name = name;
-+ _priv_exec.type = type;
-+ _priv_exec.id = id;
- #ifdef SI_SECPOLICY
- if (sysinfo(SI_SECPOLICY, policy_buf, BUFSIZ) == -1)
- #endif /* SI_SECPOLICY */
- (void) strncpy(policy_buf, DEFAULT_POLICY, BUFSIZ);
-
- retry_policy:
-- _priv_exec.policy = IS_SEARCH_ALL(search_flag) ? empty : policy_buf;
-+ _priv_exec.policy = IS_SEARCH_ALL(search_flag) ? NULL : policy_buf;
- _priv_exec.search_flag = search_flag;
- _priv_exec.head_exec = NULL;
- _priv_exec.prev_exec = NULL;
-
-- if ((name != NULL) && (id != NULL)) {
-- getby_flag = NSS_DBOP_EXECATTR_BYNAMEID;
-- } else if (name != NULL) {
-- getby_flag = NSS_DBOP_EXECATTR_BYNAME;
-- } else if (id != NULL) {
-- getby_flag = NSS_DBOP_EXECATTR_BYID;
-- }
--
- arg.key.attrp = &(_priv_exec);
-
- switch (getby_flag) {
-Index: libc/usr/src/lib/libnsl/rpc/clnt_dg.c
-===================================================================
---- libc.orig/usr/src/lib/libnsl/rpc/clnt_dg.c 2014-05-11 14:28:41.008749610 +0400
-+++ libc/usr/src/lib/libnsl/rpc/clnt_dg.c 2014-05-26 00:04:41.121149212 +0400
-@@ -24,6 +24,10 @@
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-+/*
-+ * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
-+ */
-+
- /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
- /* All Rights Reserved */
- /*
-@@ -32,8 +36,6 @@
- * California.
- */
-
--#pragma ident "%Z%%M% %I% %E% SMI"
--
- /*
- * Implements a connectionless client side RPC.
- */
-@@ -164,7 +166,7 @@
- */
- if (tinfo.servtype == T_CLTS)
- (void) __rpc_tli_set_options(fd, SOL_SOCKET, SO_DGRAM_ERRIND,
-- 1);
-+ 1);
- /*
- * Find the receive and the send size
- */
-@@ -212,11 +214,9 @@
- }
- cu->cu_xdrpos = XDR_GETPOS(&(cu->cu_outxdrs));
- XDR_DESTROY(&(cu->cu_outxdrs));
-- xdrmem_create(&(cu->cu_outxdrs), cu->cu_outbuf_start, ssz,
-- XDR_ENCODE);
-+ xdrmem_create(&(cu->cu_outxdrs), cu->cu_outbuf_start, ssz, XDR_ENCODE);
- /* LINTED pointer alignment */
-- tr_data = (struct t_unitdata *)t_alloc(fd,
-- T_UNITDATA, T_ADDR | T_OPT);
-+ tr_data = (struct t_unitdata *)t_alloc(fd, T_UNITDATA, T_ADDR | T_OPT);
- if (tr_data == NULL) {
- goto err1;
- }
-@@ -310,9 +310,9 @@
-
- if (cl->cl_auth->ah_cred.oa_flavor != RPCSEC_GSS) {
- if ((!XDR_PUTBYTES(xdrs, cu->cu_outbuf, cu->cu_xdrpos)) ||
-- (!XDR_PUTINT32(xdrs, (int32_t *)&proc)) ||
-- (!AUTH_MARSHALL(cl->cl_auth, xdrs)) ||
-- (!xargs(xdrs, argsp))) {
-+ (!XDR_PUTINT32(xdrs, (int32_t *)&proc)) ||
-+ (!AUTH_MARSHALL(cl->cl_auth, xdrs)) ||
-+ (!xargs(xdrs, argsp))) {
- rpc_fd_unlock(dgtbl, cu->cu_fd);
- return (rpc_callerr.re_status = RPC_CANTENCODEARGS);
- }
-@@ -368,7 +368,7 @@
- }
-
- if (poll_time.tv_sec < 0 || (poll_time.tv_sec == 0 &&
-- poll_time.tv_usec == 0)) {
-+ poll_time.tv_usec == 0)) {
- /*
- * this could happen if time_waited >= timeout
- */
-@@ -377,8 +377,8 @@
- }
-
- if (poll_time.tv_sec > retransmit_time.tv_sec ||
-- (poll_time.tv_sec == retransmit_time.tv_sec &&
-- poll_time.tv_usec > retransmit_time.tv_usec))
-+ (poll_time.tv_sec == retransmit_time.tv_sec &&
-+ poll_time.tv_usec > retransmit_time.tv_usec))
- poll_time = retransmit_time;
-
-
-@@ -387,7 +387,7 @@
- (void) gettimeofday(&startime, NULL);
-
- switch (poll(&cu->pfdp, 1,
-- __rpc_timeval_to_msec(&poll_time))) {
-+ __rpc_timeval_to_msec(&poll_time))) {
- case -1:
- if (errno != EINTR && errno != EAGAIN) {
- rpc_callerr.re_errno = errno;
-@@ -404,7 +404,7 @@
- timeout: (void) gettimeofday(&curtime, NULL);
- time_waited.tv_sec += curtime.tv_sec - startime.tv_sec;
- time_waited.tv_usec += curtime.tv_usec -
-- startime.tv_usec;
-+ startime.tv_usec;
- while (time_waited.tv_usec >= 1000000) {
- time_waited.tv_usec -= 1000000;
- time_waited.tv_sec++;
-@@ -432,8 +432,7 @@
- * if there's time left to poll, poll again
- */
- if (poll_time.tv_sec > 0 ||
-- (poll_time.tv_sec == 0 &&
-- poll_time.tv_usec > 0))
-+ (poll_time.tv_sec == 0 && poll_time.tv_usec > 0))
- continue;
-
- /*
-@@ -441,8 +440,8 @@
- * otherwise, return timeout error
- */
- if (time_waited.tv_sec < timeout.tv_sec ||
-- (time_waited.tv_sec == timeout.tv_sec &&
-- time_waited.tv_usec < timeout.tv_usec)) {
-+ (time_waited.tv_sec == timeout.tv_sec &&
-+ time_waited.tv_usec < timeout.tv_usec)) {
- /*
- * update retransmit_time
- */
-@@ -454,16 +453,16 @@
- }
- if (retransmit_time.tv_sec >= RPC_MAX_BACKOFF) {
- retransmit_time.tv_sec =
-- RPC_MAX_BACKOFF;
-+ RPC_MAX_BACKOFF;
- retransmit_time.tv_usec = 0;
- }
- /*
- * redo AUTH_MARSHAL if AUTH_DES or RPCSEC_GSS.
- */
- if (cl->cl_auth->ah_cred.oa_flavor ==
-- AUTH_DES ||
-- cl->cl_auth->ah_cred.oa_flavor ==
-- RPCSEC_GSS)
-+ AUTH_DES ||
-+ cl->cl_auth->ah_cred.oa_flavor ==
-+ RPCSEC_GSS)
- goto call_again;
- else
- goto send_again;
-@@ -538,8 +537,8 @@
- /* see if reply transaction id matches sent id */
- /* LINTED pointer alignment */
- if (*((uint32_t *)(cu->cu_inbuf)) !=
-- /* LINTED pointer alignment */
-- *((uint32_t *)(cu->cu_outbuf)))
-+ /* LINTED pointer alignment */
-+ *((uint32_t *)(cu->cu_outbuf)))
- goto timeout;
- /* we now assume we have the proper reply */
- break;
-@@ -550,32 +549,34 @@
- */
-
- xdrmem_create(&reply_xdrs, cu->cu_inbuf,
-- (uint_t)cu->cu_tr_data->udata.len, XDR_DECODE);
-+ (uint_t)cu->cu_tr_data->udata.len, XDR_DECODE);
- ok = xdr_replymsg(&reply_xdrs, &reply_msg);
- /* XDR_DESTROY(&reply_xdrs); save a few cycles on noop destroy */
- if (ok) {
- if ((reply_msg.rm_reply.rp_stat == MSG_ACCEPTED) &&
-- (reply_msg.acpted_rply.ar_stat == SUCCESS))
-+ (reply_msg.acpted_rply.ar_stat == SUCCESS))
- rpc_callerr.re_status = RPC_SUCCESS;
- else
- __seterr_reply(&reply_msg, &(rpc_callerr));
-
- if (rpc_callerr.re_status == RPC_SUCCESS) {
- if (!AUTH_VALIDATE(cl->cl_auth,
-- &reply_msg.acpted_rply.ar_verf)) {
-+ &reply_msg.acpted_rply.ar_verf)) {
- rpc_callerr.re_status = RPC_AUTHERROR;
- rpc_callerr.re_why = AUTH_INVALIDRESP;
- } else if (cl->cl_auth->ah_cred.oa_flavor !=
-- RPCSEC_GSS) {
-+ RPCSEC_GSS) {
- if (!(*xresults)(&reply_xdrs, resultsp)) {
-- if (rpc_callerr.re_status == RPC_SUCCESS)
-- rpc_callerr.re_status =
-- RPC_CANTDECODERES;
-+ if (rpc_callerr.re_status ==
-+ RPC_SUCCESS)
-+ rpc_callerr.re_status =
-+ RPC_CANTDECODERES;
- }
- } else if (!__rpc_gss_unwrap(cl->cl_auth, &reply_xdrs,
-- xresults, resultsp)) {
-+ xresults, resultsp)) {
- if (rpc_callerr.re_status == RPC_SUCCESS)
-- rpc_callerr.re_status = RPC_CANTDECODERES;
-+ rpc_callerr.re_status =
-+ RPC_CANTDECODERES;
- }
- } /* end successful completion */
- /*
-@@ -600,10 +601,10 @@
- /* end of unsuccessful completion */
- /* free verifier */
- if (reply_msg.rm_reply.rp_stat == MSG_ACCEPTED &&
-- reply_msg.acpted_rply.ar_verf.oa_base != NULL) {
-+ reply_msg.acpted_rply.ar_verf.oa_base != NULL) {
- xdrs->x_op = XDR_FREE;
- (void) xdr_opaque_auth(xdrs,
-- &(reply_msg.acpted_rply.ar_verf));
-+ &(reply_msg.acpted_rply.ar_verf));
- }
- } /* end of valid reply message */
- else {
-@@ -647,9 +648,9 @@
-
- if (cl->cl_auth->ah_cred.oa_flavor != RPCSEC_GSS) {
- if ((!XDR_PUTBYTES(xdrs, cu->cu_outbuf, cu->cu_xdrpos)) ||
-- (!XDR_PUTINT32(xdrs, (int32_t *)&proc)) ||
-- (!AUTH_MARSHALL(cl->cl_auth, xdrs)) ||
-- (!xargs(xdrs, argsp))) {
-+ (!XDR_PUTINT32(xdrs, (int32_t *)&proc)) ||
-+ (!AUTH_MARSHALL(cl->cl_auth, xdrs)) ||
-+ (!xargs(xdrs, argsp))) {
- rpc_fd_unlock(dgtbl, cu->cu_fd);
- return (rpc_callerr.re_status = RPC_CANTENCODEARGS);
- }
-@@ -717,7 +718,7 @@
- struct netbuf *addr;
- if (rpc_fd_lock(dgtbl, cu->cu_fd)) {
- rpc_fd_unlock(dgtbl, cu->cu_fd);
-- return (RPC_FAILED);
-+ return (FALSE);
- }
-
- switch (request) {
-@@ -815,14 +816,14 @@
- */
- /* LINTED pointer alignment */
- *(uint32_t *)info = ntohl(*(uint32_t *)(cu->cu_outbuf +
-- 4 * BYTES_PER_XDR_UNIT));
-+ 4 * BYTES_PER_XDR_UNIT));
- break;
-
- case CLSET_VERS:
- /* LINTED pointer alignment */
- *(uint32_t *)(cu->cu_outbuf + 4 * BYTES_PER_XDR_UNIT) =
- /* LINTED pointer alignment */
-- htonl(*(uint32_t *)info);
-+ htonl(*(uint32_t *)info);
- break;
-
- case CLGET_PROG:
-@@ -834,14 +835,14 @@
- */
- /* LINTED pointer alignment */
- *(uint32_t *)info = ntohl(*(uint32_t *)(cu->cu_outbuf +
-- 3 * BYTES_PER_XDR_UNIT));
-+ 3 * BYTES_PER_XDR_UNIT));
- break;
-
- case CLSET_PROG:
- /* LINTED pointer alignment */
- *(uint32_t *)(cu->cu_outbuf + 3 * BYTES_PER_XDR_UNIT) =
- /* LINTED pointer alignment */
-- htonl(*(uint32_t *)info);
-+ htonl(*(uint32_t *)info);
- break;
-
- default:
-@@ -904,7 +905,7 @@
- time_not_ok(struct timeval *t)
- {
- return (t->tv_sec < -1 || t->tv_sec > 100000000 ||
-- t->tv_usec < -1 || t->tv_usec > 1000000);
-+ t->tv_usec < -1 || t->tv_usec > 1000000);
- }
-
- /*
-@@ -921,8 +922,7 @@
-
- old = t_errno;
- /* LINTED pointer cast */
-- uderr = (struct t_uderr *)
-- t_alloc(cu->cu_fd, T_UDERROR, T_ADDR);
-+ uderr = (struct t_uderr *)t_alloc(cu->cu_fd, T_UDERROR, T_ADDR);
-
- if (t_rcvuderr(cu->cu_fd, uderr) == 0) {
- if (uderr == NULL)
-Index: libc/usr/src/lib/libnsl/rpc/clnt_vc.c
-===================================================================
---- libc.orig/usr/src/lib/libnsl/rpc/clnt_vc.c 2014-05-11 14:28:41.038324193 +0400
-+++ libc/usr/src/lib/libnsl/rpc/clnt_vc.c 2014-05-26 00:04:41.136254180 +0400
-@@ -23,6 +23,9 @@
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-+/*
-+ * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
-+ */
-
- /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
- /* All Rights Reserved */
-@@ -32,8 +35,6 @@
- * California.
- */
-
--#pragma ident "%Z%%M% %I% %E% SMI"
--
- /*
- * clnt_vc.c
- *
-@@ -216,7 +217,7 @@
- const rpcvers_t vers, const uint_t sendsz, const uint_t recvsz)
- {
- return (_clnt_vc_create_timed(fd, svcaddr, prog, vers, sendsz,
-- recvsz, NULL));
-+ recvsz, NULL));
- }
-
- /*
-@@ -242,16 +243,17 @@
- int flag;
-
- cl = malloc(sizeof (*cl));
-- ct = malloc(sizeof (*ct));
-+ if ((ct = malloc(sizeof (*ct))) != NULL)
-+ ct->ct_addr.buf = NULL;
-+
- if ((cl == NULL) || (ct == NULL)) {
- (void) syslog(LOG_ERR, clnt_vc_errstr,
-- clnt_vc_str, __no_mem_str);
-+ clnt_vc_str, __no_mem_str);
- rpc_createerr.cf_stat = RPC_SYSTEMERROR;
- rpc_createerr.cf_error.re_errno = errno;
- rpc_createerr.cf_error.re_terrno = 0;
- goto err;
- }
-- ct->ct_addr.buf = NULL;
-
- /*
- * The only use of vctbl_lock is for serializing the creation of
-@@ -353,7 +355,7 @@
- */
- ct->ct_xdrs.x_ops = NULL;
- xdrrec_create(&(ct->ct_xdrs), sendsz, recvsz, (caddr_t)ct,
-- read_vc, write_vc);
-+ read_vc, write_vc);
- if (ct->ct_xdrs.x_ops == NULL) {
- rpc_createerr.cf_stat = RPC_SYSTEMERROR;
- rpc_createerr.cf_error.re_terrno = 0;
-@@ -368,14 +370,12 @@
- return (cl);
-
- err:
-- if (cl) {
-- if (ct) {
-- if (ct->ct_addr.len)
-- free(ct->ct_addr.buf);
-- free(ct);
-- }
-- free(cl);
-+ if (ct) {
-+ free(ct->ct_addr.buf);
-+ free(ct);
- }
-+ free(cl);
-+
- return (NULL);
- }
-
-@@ -511,18 +511,22 @@
- * for other reason, default timeout will be used.
- */
- if (tp != NULL) {
-- int ms;
-+ int ms;
-
-- /* TCP_CONN_ABORT_THRESHOLD takes int value in millisecs */
-- ms = tp->tv_sec * SECS_TO_MS + tp->tv_usec * USECS_TO_MS;
-- if (((curr_time = _get_tcp_conntime(fd)) != -1) &&
-- (_set_tcp_conntime(fd, ms) == 0)) {
-- /* EMPTY */
-+ /*
-+ * TCP_CONN_ABORT_THRESHOLD takes int value in millisecs
-+ */
-+ ms = tp->tv_sec * SECS_TO_MS +
-+ tp->tv_usec * USECS_TO_MS;
-+ if (((curr_time = _get_tcp_conntime(fd)) != -1) &&
-+ (_set_tcp_conntime(fd, ms) == 0)) {
-+ /* EMPTY */
- #ifdef DEBUG
-- fprintf(stderr, "set_up_connection: set tcp ");
-- fprintf(stderr, "connection timeout to %d ms\n", ms);
-+ fprintf(stderr, "set_up_connection: set tcp ");
-+ fprintf(stderr, "connection timeout to %d ms\n",
-+ ms);
- #endif
-- }
-+ }
- }
-
- for (nconnect = 0; nconnect < 3; nconnect++) {
-@@ -573,7 +577,7 @@
- (void) t_free((char *)rcvcall, T_CALL);
- #ifdef DEBUG
- fprintf(stderr, "clnt_vc: t_connect error %d\n",
-- rpc_createerr.cf_error.re_terrno);
-+ rpc_createerr.cf_error.re_terrno);
- #endif
- return (FALSE);
- }
-@@ -598,14 +602,14 @@
- ct->ct_addr.buf = malloc(svcaddr->len);
- if (ct->ct_addr.buf == NULL) {
- (void) syslog(LOG_ERR, clnt_vc_errstr,
-- clnt_vc_str, __no_mem_str);
-+ clnt_vc_str, __no_mem_str);
- rpc_createerr.cf_stat = RPC_SYSTEMERROR;
- rpc_createerr.cf_error.re_errno = errno;
- rpc_createerr.cf_error.re_terrno = 0;
- return (FALSE);
- }
- (void) memcpy(ct->ct_addr.buf, svcaddr->buf,
-- (size_t)svcaddr->len);
-+ (size_t)svcaddr->len);
- ct->ct_addr.len = ct->ct_addr.maxlen = svcaddr->len;
- }
- break;
-@@ -741,16 +745,17 @@
-
- if (rpc_callerr.re_status == RPC_SUCCESS) {
- if (!AUTH_VALIDATE(cl->cl_auth,
-- &reply_msg.acpted_rply.ar_verf)) {
-+ &reply_msg.acpted_rply.ar_verf)) {
- rpc_callerr.re_status = RPC_AUTHERROR;
- rpc_callerr.re_why = AUTH_INVALIDRESP;
- } else if (cl->cl_auth->ah_cred.oa_flavor != RPCSEC_GSS) {
- if (!(*xdr_results)(xdrs, results_ptr)) {
- if (rpc_callerr.re_status == RPC_SUCCESS)
-- rpc_callerr.re_status = RPC_CANTDECODERES;
-+ rpc_callerr.re_status =
-+ RPC_CANTDECODERES;
- }
- } else if (!__rpc_gss_unwrap(cl->cl_auth, xdrs, xdr_results,
-- results_ptr)) {
-+ results_ptr)) {
- if (rpc_callerr.re_status == RPC_SUCCESS)
- rpc_callerr.re_status = RPC_CANTDECODERES;
- }
-@@ -774,7 +779,7 @@
- } /* end of unsuccessful completion */
- /* free verifier ... */
- if (reply_msg.rm_reply.rp_stat == MSG_ACCEPTED &&
-- reply_msg.acpted_rply.ar_verf.oa_base != NULL) {
-+ reply_msg.acpted_rply.ar_verf.oa_base != NULL) {
- xdrs->x_op = XDR_FREE;
- (void) xdr_opaque_auth(xdrs, &(reply_msg.acpted_rply.ar_verf));
- }
-@@ -884,7 +889,7 @@
-
- if (rpc_fd_lock(vctbl, ct->ct_fd)) {
- rpc_fd_unlock(vctbl, ct->ct_fd);
-- return (RPC_FAILED);
-+ return (FALSE);
- }
-
- switch (request) {
-@@ -905,6 +910,8 @@
- /* LINTED pointer cast */
- ct->ct_blocking_mode: *(int *)info);
- ret = (0 == res);
-+ } else {
-+ ret = FALSE;
- }
- rpc_fd_unlock(vctbl, ct->ct_fd);
- return (ret);
-@@ -930,8 +937,7 @@
- /* LINTED pointer alignment */
- ((struct timeval *)info)->tv_sec = ct->ct_wait / 1000;
- /* LINTED pointer alignment */
-- ((struct timeval *)info)->tv_usec =
-- (ct->ct_wait % 1000) * 1000;
-+ ((struct timeval *)info)->tv_usec = (ct->ct_wait % 1000) * 1000;
- break;
- case CLGET_SERVER_ADDR: /* For compatibility only */
- (void) memcpy(info, ct->ct_addr.buf, (size_t)ct->ct_addr.len);
-@@ -960,7 +966,7 @@
- return (FALSE);
- }
- ret = set_up_connection(ct->ct_fd, (struct netbuf *)info,
-- ct, NULL));
-+ ct, NULL);
- rpc_fd_unlock(vctbl, ct->ct_fd);
- return (ret);
- #else
-@@ -991,14 +997,14 @@
- */
- /* LINTED pointer alignment */
- *(uint32_t *)info = ntohl(*(uint32_t *)(ct->ct_mcall +
-- 4 * BYTES_PER_XDR_UNIT));
-+ 4 * BYTES_PER_XDR_UNIT));
- break;
-
- case CLSET_VERS:
- /* LINTED pointer alignment */
- *(uint32_t *)(ct->ct_mcall + 4 * BYTES_PER_XDR_UNIT) =
- /* LINTED pointer alignment */
-- htonl(*(uint32_t *)info);
-+ htonl(*(uint32_t *)info);
- break;
-
- case CLGET_PROG:
-@@ -1010,29 +1016,29 @@
- */
- /* LINTED pointer alignment */
- *(uint32_t *)info = ntohl(*(uint32_t *)(ct->ct_mcall +
-- 3 * BYTES_PER_XDR_UNIT));
-+ 3 * BYTES_PER_XDR_UNIT));
- break;
-
- case CLSET_PROG:
- /* LINTED pointer alignment */
- *(uint32_t *)(ct->ct_mcall + 3 * BYTES_PER_XDR_UNIT) =
- /* LINTED pointer alignment */
-- htonl(*(uint32_t *)info);
-+ htonl(*(uint32_t *)info);
- break;
-
- case CLSET_IO_MODE:
- /* LINTED pointer cast */
- if (!set_io_mode(ct, *(int *)info)) {
-- rpc_fd_unlock(vctbl, ct->ct_fd);
-- return (FALSE);
-+ rpc_fd_unlock(vctbl, ct->ct_fd);
-+ return (FALSE);
- }
- break;
- case CLSET_FLUSH_MODE:
- /* Set a specific FLUSH_MODE */
- /* LINTED pointer cast */
- if (!set_flush_mode(ct, *(int *)info)) {
-- rpc_fd_unlock(vctbl, ct->ct_fd);
-- return (FALSE);
-+ rpc_fd_unlock(vctbl, ct->ct_fd);
-+ return (FALSE);
- }
- break;
- case CLGET_FLUSH_MODE:
-@@ -1151,7 +1157,7 @@
- pfdp = thr_get_storage(&pfdp_key, sizeof (struct pollfd), free);
- if (pfdp == NULL) {
- (void) syslog(LOG_ERR, clnt_vc_errstr,
-- clnt_read_vc_str, __no_mem_str);
-+ clnt_read_vc_str, __no_mem_str);
- rpc_callerr.re_status = RPC_SYSTEMERROR;
- rpc_callerr.re_errno = errno;
- rpc_callerr.re_terrno = 0;
-@@ -1186,12 +1192,12 @@
- /* reallocate pfdp to svc_max_pollfd +1 */
- if (npfd != (svc_max_pollfd + 1)) {
- struct pollfd *tmp_pfdp = realloc(pfdp,
-- sizeof (struct pollfd) *
-- (svc_max_pollfd + 1));
-+ sizeof (struct pollfd) *
-+ (svc_max_pollfd + 1));
- if (tmp_pfdp == NULL) {
- sig_rw_unlock(&svc_fd_lock);
- (void) syslog(LOG_ERR, clnt_vc_errstr,
-- clnt_read_vc_str, __no_mem_str);
-+ clnt_read_vc_str, __no_mem_str);
- rpc_callerr.re_status = RPC_SYSTEMERROR;
- rpc_callerr.re_errno = errno;
- rpc_callerr.re_terrno = 0;
-@@ -1232,13 +1238,12 @@
- continue;
- };
- delta = (curtime.tv_sec -
-- starttime.tv_sec) * 1000 +
-- (curtime.tv_usec -
-- starttime.tv_usec) / 1000;
-+ starttime.tv_sec) * 1000 +
-+ (curtime.tv_usec -
-+ starttime.tv_usec) / 1000;
- poll_time -= delta;
- if (poll_time < 0) {
-- rpc_callerr.re_status =
-- RPC_TIMEDOUT;
-+ rpc_callerr.re_status = RPC_TIMEDOUT;
- errno = 0;
- return (-1);
- } else {
-@@ -1352,7 +1357,7 @@
- for (cnt = len, i = 0; cnt > 0; cnt -= i, buf += i) {
- flag = cnt > maxsz ? T_MORE : 0;
- if ((i = t_snd(ct->ct_fd, buf, (unsigned)MIN(cnt, maxsz),
-- flag)) == -1) {
-+ flag)) == -1) {
- rpc_callerr.re_terrno = t_errno;
- rpc_callerr.re_errno = 0;
- rpc_callerr.re_status = RPC_CANTSEND;
-@@ -1431,7 +1436,7 @@
- time_not_ok(struct timeval *t)
- {
- return (t->tv_sec <= -1 || t->tv_sec > 100000000 ||
-- t->tv_usec <= -1 || t->tv_usec > 1000000);
-+ t->tv_usec <= -1 || t->tv_usec > 1000000);
- }
-
-
-@@ -1746,7 +1751,7 @@
- /* And add the remaining part of the message. */
- if (len != nBytes) {
- if (addInBuffer(ct, (char *)buff + len,
-- nBytes-len) == -1) {
-+ nBytes-len) == -1) {
- return (-1);
- }
- }
-Index: libc/usr/src/lib/libnsl/rpc/getdname.c
-===================================================================
---- libc.orig/usr/src/lib/libnsl/rpc/getdname.c 2014-03-01 16:18:15.000000000 +0400
-+++ libc/usr/src/lib/libnsl/rpc/getdname.c 2014-05-26 00:04:41.148947410 +0400
-@@ -24,6 +24,9 @@
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-+/*
-+ * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
-+ */
-
- /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
- /* All Rights Reserved */
-@@ -33,120 +36,28 @@
- * California.
- */
-
--#pragma ident "%Z%%M% %I% %E% SMI"
--
- /*
- * Gets and sets the domain name of the system
- */
-
--#include "mt.h"
--#include "rpc_mt.h"
--#include <stdio.h>
--#include <stdlib.h>
--#include <sys/types.h>
--#include <sys/utsname.h>
- #include <sys/systeminfo.h>
--#include <sys/time.h>
--#include <syslog.h>
--
--#ifndef SI_SRPC_DOMAIN
--#define use_file
--#endif
--
--#ifdef use_file
--char DOMAIN[] = "/etc/domain";
--#endif
--
--int setdomainname();
--
--#ifdef use_file
--static char *domainname;
--#endif
--
--extern mutex_t dname_lock;
-
- int
--getdomainname(name, namelen)
-- char *name;
-- int namelen;
-+getdomainname(char *name, int namelen)
- {
--#ifdef use_file
-- FILE *domain_fd;
-- char *line;
--
-- (void) mutex_lock(&dname_lock);
-- if (domainname) {
-- (void) strncpy(name, domainname, namelen);
-- (void) mutex_unlock(&dname_lock);
-- return (0);
-- }
--
-- domainname = calloc(1, 256);
-- if (domainname == NULL) {
-- syslog(LOG_ERR, "getdomainname : out of memory.");
-- (void) mutex_unlock(&dname_lock);
-- return (-1);
-- }
--
-- if ((domain_fd = fopen(DOMAIN, "r")) == NULL) {
--
-- (void) mutex_unlock(&dname_lock);
-- return (-1);
-- }
-- if (fscanf(domain_fd, "%s", domainname) == NULL) {
-- (void) fclose(domain_fd);
-- (void) mutex_unlock(&dname_lock);
-- return (-1);
-- }
-- (void) fclose(domain_fd);
-- (void) strncpy(name, domainname, namelen);
-- (void) mutex_unlock(&dname_lock);
-- return (0);
--#else
- int sysinfostatus;
-
- sysinfostatus = sysinfo(SI_SRPC_DOMAIN, name, namelen);
-
- return ((sysinfostatus < 0) ? -1 : 0);
--#endif
- }
-
- int
--setdomainname(domain, len)
-- char *domain;
-- int len;
-+setdomainname(char *domain, int len)
- {
--#ifdef use_file
--
-- FILE *domain_fd;
--
-- (void) mutex_lock(&dname_lock);
-- if (domainname)
-- free(domainname);
--
-- if ((domain_fd = fopen(DOMAIN, "w")) == NULL) {
-- (void) mutex_unlock(&dname_lock);
-- return (-1);
-- }
-- if (fputs(domain, domain_fd) == NULL) {
-- (void) mutex_unlock(&dname_lock);
-- return (-1);
-- }
-- (void) fclose(domain_fd);
-- domainname = calloc(1, 256);
-- if (domainname == NULL) {
-- syslog(LOG_ERR, "setdomainname : out of memory.");
-- (void) mutex_unlock(&dname_lock);
-- return (-1);
-- }
-- (void) strncpy(domainname, domain, len);
-- (void) mutex_unlock(&dname_lock);
-- return (0);
--#else
- int sysinfostatus;
-
- sysinfostatus = sysinfo(SI_SET_SRPC_DOMAIN,
-- domain, len + 1); /* add null */
-+ domain, len + 1); /* add null */
- return ((sysinfostatus < 0) ? -1 : 0);
--#endif
- }
-Index: libc/usr/src/lib/libnsl/rpc/netnamer.c
-===================================================================
---- libc.orig/usr/src/lib/libnsl/rpc/netnamer.c 2014-03-01 16:18:15.000000000 +0400
-+++ libc/usr/src/lib/libnsl/rpc/netnamer.c 2014-05-26 00:04:41.160833702 +0400
-@@ -23,6 +23,9 @@
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-+/*
-+ * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
-+ */
- /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
- /* All Rights Reserved */
- /*
-@@ -429,6 +432,7 @@
- "netname2user: unknown nameservice for publickey"
- "info '%s'\n", look->service_name);
- err = __NSW_UNAVAIL;
-+ res = 0;
- }
- switch (look->actions[err]) {
- case __NSW_CONTINUE :
-Index: libc/usr/src/lib/libnsl/rpc/svc_door.c
-===================================================================
---- libc.orig/usr/src/lib/libnsl/rpc/svc_door.c 2014-05-11 14:28:41.057213086 +0400
-+++ libc/usr/src/lib/libnsl/rpc/svc_door.c 2014-05-26 00:04:41.173753550 +0400
-@@ -23,6 +23,9 @@
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-+/*
-+ * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
-+ */
-
- /*
- * svc_door.c, Server side for doors IPC based RPC.
-@@ -172,7 +175,7 @@
- return (FALSE);
- }
- return ((statbuf.st_mode & S_IFMT) == S_IFDIR &&
-- (statbuf.st_mode & 01777) == 01777);
-+ (statbuf.st_mode & 01777) == 01777);
- }
-
- static void
-@@ -199,7 +202,7 @@
- }
-
- if (su->call_info.prognum == r->rq_prog && su->call_info.versnum ==
-- r->rq_vers) {
-+ r->rq_vers) {
- (*su->call_info.dispatch)(r, xprt);
- return;
- }
-@@ -210,7 +213,7 @@
- */
- if (su->call_info.prognum == r->rq_prog)
- svcerr_progvers(xprt, su->call_info.versnum,
-- su->call_info.versnum);
-+ su->call_info.versnum);
- else
- svcerr_noprog(xprt);
- }
-@@ -246,7 +249,7 @@
- (void) mutex_lock(&svc_door_mutex);
- if ((xprt = get_xprt_copy(parent, result_buf)) == NULL) {
- (void) syslog(LOG_ERR,
-- "door_server: memory allocation failure");
-+ "door_server: memory allocation failure");
- (void) mutex_unlock(&svc_door_mutex);
- (void) door_return(NULL, 0, NULL, 0);
- /*NOTREACHED*/
-@@ -323,7 +326,7 @@
-
- if (!make_tmp_dir()) {
- (void) syslog(LOG_ERR, "svc_door_create: cannot open %s",
-- RPC_DOOR_DIR);
-+ RPC_DOOR_DIR);
- (void) mutex_unlock(&svc_door_mutex);
- return (NULL);
- }
-@@ -336,7 +339,7 @@
- svc_flags(xprt) |= SVC_DOOR;
-
- (void) sprintf(rendezvous, RPC_DOOR_RENDEZVOUS, (int)prognum,
-- (int)versnum);
-+ (int)versnum);
- mask = umask(0);
- fd = open(rendezvous, O_WRONLY|O_CREAT|O_EXCL|O_TRUNC, 0644);
- (void) umask(mask);
-@@ -344,24 +347,24 @@
- if (errno == EEXIST) {
- if (unlink(rendezvous) < 0) {
- (void) syslog(LOG_ERR,
-- "svc_door_create: %s %s:%m", rendezvous,
-- "exists and could not be removed");
-+ "svc_door_create: %s %s:%m", rendezvous,
-+ "exists and could not be removed");
- goto freedata;
- }
- mask = umask(0);
-- fd = open(rendezvous, O_WRONLY|O_CREAT|O_EXCL|
-- O_TRUNC, 0644);
-+ fd = open(rendezvous, O_WRONLY | O_CREAT | O_EXCL |
-+ O_TRUNC, 0644);
- (void) umask(mask);
- if (fd < 0) {
- (void) syslog(LOG_ERR,
-- "svc_door_create: %s %s:%m",
-- "could not create", rendezvous);
-+ "svc_door_create: %s %s:%m",
-+ "could not create", rendezvous);
- goto freedata;
- }
- } else {
- (void) syslog(LOG_ERR,
-- "svc_door_create: could not create %s:%m",
-- rendezvous);
-+ "svc_door_create: could not create %s:%m",
-+ rendezvous);
- goto freedata;
- }
- }
-@@ -369,15 +372,15 @@
- did = door_create(door_server, (void *)xprt, DOOR_REFUSE_DESC);
- if (did < 0) {
- (void) syslog(LOG_ERR,
-- "svc_door_create: door_create failed: %m");
-+ "svc_door_create: door_create failed: %m");
- goto freedata;
- }
-
- if (fattach(did, rendezvous) < 0) {
- if (errno != EBUSY || fdetach(rendezvous) < 0 ||
-- fattach(did, rendezvous) < 0) {
-+ fattach(did, rendezvous) < 0) {
- (void) syslog(LOG_ERR,
-- "svc_door_create: fattach failed: %m");
-+ "svc_door_create: fattach failed: %m");
- goto freedata;
- }
- }
-@@ -555,7 +558,7 @@
- svc_flags(parent) |= SVC_DEFUNCT;
- /* LINTED pointer cast */
- if (SVCEXT(parent)->refcnt == 0)
-- svc_door_destroy(xprt);
-+ svc_door_destroy_pvt(xprt);
- }
- (void) mutex_unlock(&svc_door_mutex);
- return (len);
-Index: libc/usr/src/lib/libnsl/rpc/svc_vc.c
-===================================================================
---- libc.orig/usr/src/lib/libnsl/rpc/svc_vc.c 2014-05-11 14:28:41.066829891 +0400
-+++ libc/usr/src/lib/libnsl/rpc/svc_vc.c 2014-05-26 00:04:41.193218822 +0400
-@@ -78,7 +78,6 @@
- extern int __td_setnodelay(int);
- extern bool_t __xdrrec_getbytes_nonblock(XDR *, enum xprt_stat *);
- extern bool_t __xdrrec_set_conn_nonblock(XDR *, uint32_t);
--extern int _t_do_ioctl(int, char *, int, int, int *);
- extern int __rpc_legal_connmaxrec(int);
- /* Structure used to initialize SVC_XP_AUTH(xprt).svc_ah_ops. */
- extern struct svc_auth_ops svc_auth_any_ops;
-@@ -91,7 +90,6 @@
- static int read_vc(SVCXPRT *, caddr_t, int);
- static int write_vc(SVCXPRT *, caddr_t, int);
- static SVCXPRT *makefd_xprt(int, uint_t, uint_t, t_scalar_t, char *);
--static bool_t fd_is_dead(int);
- static void update_nonblock_timestamps(SVCXPRT *);
-
- struct cf_rendezvous { /* kept in xprt->xp_p1 for rendezvouser */
-@@ -127,9 +125,6 @@
- extern int __xdrrec_resetfirst(XDR *);
- extern int __is_xdrrec_first(XDR *);
-
--void __svc_nisplus_enable_timestamps(void);
--void __svc_timeout_nonblock_xprt(void);
--
- /*
- * This is intended as a performance improvement on the old string handling
- * stuff by read only moving data into the text segment.
-@@ -156,14 +151,6 @@
- static const char no_nonblock_str[] = "could not set transport non-blocking";
-
- /*
-- * Records a timestamp when data comes in on a descriptor. This is
-- * only used if timestamps are enabled with __svc_nisplus_enable_timestamps().
-- */
--static long *timestamps;
--static int ntimestamps; /* keep track how many timestamps */
--static mutex_t timestamp_lock = DEFAULTMUTEX;
--
--/*
- * Used to determine whether the time-out logic should be executed.
- */
- static bool_t check_nonblock_timestamps = FALSE;
-@@ -1193,12 +1180,6 @@
- __xprt_unregister_private(xprt, lock_not_held);
- (void) t_close(xprt->xp_fd);
-
-- (void) mutex_lock(&timestamp_lock);
-- if (timestamps && xprt->xp_fd < ntimestamps) {
-- timestamps[xprt->xp_fd] = 0;
-- }
-- (void) mutex_unlock(&timestamp_lock);
--
- if (svc_mt_mode != RPC_SVC_MT_NONE) {
- svc_xprt_destroy(xprt);
- } else {
-@@ -1286,43 +1267,11 @@
- /*
- * All read operations timeout after 35 seconds.
- * A timeout is fatal for the connection.
-- * update_timestamps() is used by nisplus operations,
- * update_nonblock_timestamps() is used for nonblocked
- * connection fds.
- */
- #define WAIT_PER_TRY 35000 /* milliseconds */
-
--static void
--update_timestamps(int fd)
--{
-- (void) mutex_lock(&timestamp_lock);
-- if (timestamps) {
-- struct timeval tv;
--
-- (void) gettimeofday(&tv, NULL);
-- while (fd >= ntimestamps) {
-- long *tmp_timestamps = timestamps;
--
-- /* allocate more timestamps */
-- tmp_timestamps = realloc(timestamps, sizeof (long) *
-- (ntimestamps + FD_INCREMENT));
-- if (tmp_timestamps == NULL) {
-- (void) mutex_unlock(&timestamp_lock);
-- syslog(LOG_ERR,
-- "update_timestamps: out of memory");
-- return;
-- }
--
-- timestamps = tmp_timestamps;
-- (void) memset(&timestamps[ntimestamps], 0,
-- sizeof (long) * FD_INCREMENT);
-- ntimestamps += FD_INCREMENT;
-- }
-- timestamps[fd] = tv.tv_sec;
-- }
-- (void) mutex_unlock(&timestamp_lock);
--}
--
- static void
- update_nonblock_timestamps(SVCXPRT *xprt_conn)
- {
-@@ -1372,7 +1321,6 @@
- */
- if ((len = t_rcvnonblock(xprt, buf, len)) >= 0) {
- if (len > 0) {
-- update_timestamps(fd);
- update_nonblock_timestamps(xprt);
- }
- return (len);
-@@ -1402,7 +1350,6 @@
- }
- (void) __xdrrec_resetfirst(xdrs);
- if ((len = t_rcvall(fd, buf, len)) > 0) {
-- update_timestamps(fd);
- return (len);
- }
-
-@@ -1866,142 +1813,6 @@
- }
-
- /*
-- * PRIVATE RPC INTERFACE
-- *
-- * This is a hack to let NIS+ clean up connections that have already been
-- * closed. This problem arises because rpc.nisd forks a child to handle
-- * existing connections when it does checkpointing. The child may close
-- * some of these connections. But the descriptors still stay open in the
-- * parent, and because TLI descriptors don't support persistent EOF
-- * condition (like sockets do), the parent will never detect that these
-- * descriptors are dead.
-- *
-- * The following internal procedure __svc_nisplus_fdcleanup_hack() - should
-- * be removed as soon as rpc.nisd is rearchitected to do the right thing.
-- * This procedure should not find its way into any header files.
-- *
-- * This procedure should be called only when rpc.nisd knows that there
-- * are no children servicing clients.
-- */
--
--static bool_t
--fd_is_dead(int fd)
--{
-- struct T_info_ack inforeq;
-- int retval;
--
-- inforeq.PRIM_type = T_INFO_REQ;
-- if (!_t_do_ioctl(fd, (caddr_t)&inforeq, sizeof (struct T_info_req),
-- TI_GETINFO, &retval))
-- return (TRUE);
-- if (retval != (int)sizeof (struct T_info_ack))
-- return (TRUE);
--
-- switch (inforeq.CURRENT_state) {
-- case TS_UNBND:
-- case TS_IDLE:
-- return (TRUE);
-- default:
-- break;
-- }
-- return (FALSE);
--}
--
--void
--__svc_nisplus_fdcleanup_hack(void)
--{
-- SVCXPRT *xprt;
-- SVCXPRT *dead_xprt[CLEANUP_SIZE];
-- int i, fd_idx = 0, dead_idx = 0;
--
-- if (svc_xports == NULL)
-- return;
-- for (;;) {
-- (void) rw_wrlock(&svc_fd_lock);
-- for (dead_idx = 0; fd_idx < svc_max_pollfd; fd_idx++) {
-- if ((xprt = svc_xports[fd_idx]) == NULL)
-- continue;
--/* LINTED pointer alignment */
-- if (svc_type(xprt) != SVC_CONNECTION)
-- continue;
-- if (fd_is_dead(fd_idx)) {
-- dead_xprt[dead_idx++] = xprt;
-- if (dead_idx >= CLEANUP_SIZE)
-- break;
-- }
-- }
--
-- for (i = 0; i < dead_idx; i++) {
-- /* Still holding svc_fd_lock */
-- _svc_vc_destroy_private(dead_xprt[i], FALSE);
-- }
-- (void) rw_unlock(&svc_fd_lock);
-- if (fd_idx++ >= svc_max_pollfd)
-- return;
-- }
--}
--
--void
--__svc_nisplus_enable_timestamps(void)
--{
-- (void) mutex_lock(&timestamp_lock);
-- if (!timestamps) {
-- timestamps = calloc(FD_INCREMENT, sizeof (long));
-- if (timestamps != NULL)
-- ntimestamps = FD_INCREMENT;
-- else {
-- (void) mutex_unlock(&timestamp_lock);
-- syslog(LOG_ERR, "__svc_nisplus_enable_timestamps: "
-- "out of memory");
-- return;
-- }
-- }
-- (void) mutex_unlock(&timestamp_lock);
--}
--
--void
--__svc_nisplus_purge_since(long since)
--{
-- SVCXPRT *xprt;
-- SVCXPRT *dead_xprt[CLEANUP_SIZE];
-- int i, fd_idx = 0, dead_idx = 0;
--
-- if (svc_xports == NULL)
-- return;
-- for (;;) {
-- (void) rw_wrlock(&svc_fd_lock);
-- (void) mutex_lock(&timestamp_lock);
-- for (dead_idx = 0; fd_idx < svc_max_pollfd; fd_idx++) {
-- if ((xprt = svc_xports[fd_idx]) == NULL) {
-- continue;
-- }
-- /* LINTED pointer cast */
-- if (svc_type(xprt) != SVC_CONNECTION) {
-- continue;
-- }
-- if (fd_idx >= ntimestamps) {
-- break;
-- }
-- if (timestamps[fd_idx] &&
-- timestamps[fd_idx] < since) {
-- dead_xprt[dead_idx++] = xprt;
-- if (dead_idx >= CLEANUP_SIZE)
-- break;
-- }
-- }
-- (void) mutex_unlock(&timestamp_lock);
--
-- for (i = 0; i < dead_idx; i++) {
-- /* Still holding svc_fd_lock */
-- _svc_vc_destroy_private(dead_xprt[i], FALSE);
-- }
-- (void) rw_unlock(&svc_fd_lock);
-- if (fd_idx++ >= svc_max_pollfd)
-- return;
-- }
--}
--
--/*
- * dup cache wrapper functions for vc requests. The set of dup
- * functions were written with the view that they may be expanded
- * during creation of a generic svc_vc_enablecache routine
diff --git a/libc/debian/patches/librpcsvc-use-system-x.patch b/libc/debian/patches/librpcsvc-use-system-x.patch
deleted file mode 100644
index e4c2df5..0000000
--- a/libc/debian/patches/librpcsvc-use-system-x.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Index: libc/usr/src/lib/librpcsvc/Makefile
-===================================================================
---- libc.orig/usr/src/lib/librpcsvc/Makefile 2014-03-02 23:19:33.468701113 +0400
-+++ libc/usr/src/lib/librpcsvc/Makefile 2014-03-03 11:25:58.567135422 +0400
-@@ -27,7 +27,7 @@
-
- include ../../Makefile.master
-
--PROTOCOL_DIR= $(ROOT)/usr/include/rpcsvc
-+PROTOCOL_DIR= /usr/include/rpcsvc
-
- SUBDIRS= $(MACH)
- $(BUILD64)SUBDIRS += $(MACH64)
diff --git a/libc/debian/patches/localedef-only.patch b/libc/debian/patches/localedef-only.patch
deleted file mode 100644
index 3b3634e..0000000
--- a/libc/debian/patches/localedef-only.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Description: only build localedef, we treat data specially.
-Index: b/usr/src/cmd/localedef/Makefile
-===================================================================
---- a/usr/src/cmd/localedef/Makefile 2014-03-02 23:22:09.321875952 +0400
-+++ b/usr/src/cmd/localedef/Makefile 2014-03-02 23:22:11.558962948 +0400
-@@ -232,9 +232,9 @@
-
- $(ROOTDATA) := FILEMODE=0444
-
--all: $(PROG) $(DATA)
-+all: $(PROG)
-
--install: all $(ROOTPROG) $(ROOTDATA)
-+install: all $(ROOTPROG)
-
- $(PROG): $(OBJS)
- $(LINK.c) $(OBJS) -o $@ $(LDLIBS)
diff --git a/libc/debian/patches/localedef-bison.patch b/libc/debian/patches/localedef.patch
index 6be7475..ece575f 100644
--- a/libc/debian/patches/localedef-bison.patch
+++ b/libc/debian/patches/localedef.patch
@@ -1,19 +1,24 @@
Description:
1. yylex() - implicit declaration
2. yydebug() - undefined at link time (fixed with -t)
-Index: b/usr/src/cmd/localedef/Makefile
+Index: libc/usr/src/cmd/localedef/Makefile
===================================================================
---- a/usr/src/cmd/localedef/Makefile 2014-03-02 23:20:15.383971949 +0400
-+++ b/usr/src/cmd/localedef/Makefile 2014-03-02 23:22:09.321875952 +0400
-@@ -30,9 +30,10 @@
+--- libc.orig/usr/src/cmd/localedef/Makefile
++++ libc/usr/src/cmd/localedef/Makefile
+@@ -36,6 +36,7 @@ NATIVE_CPPFLAGS += -I $(SRC)/lib/libc/po
CERRWARN += -_gcc=-Wno-char-subscripts
CERRWARN += -_gcc=-Wno-uninitialized
CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
LDLIBS += -lgen
LDLIBS += -lavl
+ NATIVELDLIBS += -lgen
+@@ -48,7 +49,7 @@ NATIVELDLIBS += -lgen
+ # we regrettably have to link explicitly against the full library path. Sorry.
+ #
+ NATIVELDLIBS += /usr/lib/libavl.so.1
-YFLAGS = -d -b parser
+YFLAGS = -t -d -b parser
- CLEANFILES = $(OBJS) parser.tab.c parser.tab.h
+ CLEANFILES = $(NOBJS) $(OBJS) parser.tab.c parser.tab.h
CLEANFILES += \
diff --git a/libc/debian/patches/series b/libc/debian/patches/series
index 75ccc83..1a68de2 100644
--- a/libc/debian/patches/series
+++ b/libc/debian/patches/series
@@ -29,10 +29,7 @@ zic-gnu-make-workaround.patch
zic-only-zic.patch
getconf-no-xpg.patch
getent-avoid-libproject.patch
-illumos-3243-getent-shadow.patch
-illumos-3244-ret_val-uninitialized.patch
-localedef-bison.patch
-localedef-only.patch
+localedef.patch
nss-files-avoid-libtsnet.patch
sgs.h-no-libelf.h.patch
sgs-rtld-default-lib-path.patch
@@ -82,7 +79,6 @@ libc-sprintf-nul-char.patch
libc-add-get_current_dir_name.patch
libc-add-cfmakeraw.patch
libsocket-binutils-2.23-weak.patch
-librpcsvc-use-system-x.patch
rstat.x-stdc.patch
rusers.x-stdc.patch
rwall.x-stdc.patch
@@ -98,13 +94,10 @@ libc-add-qsort_r.patch
libc-add-mkostemp.patch
unistd-add-environ.patch
define-getdomainname.patch
-libc-vhangup-returns-int.patch
syslog-names.patch
syslog-LOG_PERROR.patch
-illumos-4688-getlogin_r.patch
libc-pipe.patch
libc-accept.patch
-libnsl-illumos-updates.patch
libc-malloc_usable_size.patch
libelf-no-clobber-warning.patch
use-posix-functions.patch
diff --git a/libc/debian/patches/struct-tm.patch b/libc/debian/patches/struct-tm.patch
index 7a90175..bc4b9e0 100644
--- a/libc/debian/patches/struct-tm.patch
+++ b/libc/debian/patches/struct-tm.patch
@@ -5,16 +5,16 @@ Index: libc/usr/src/head/iso/time_iso.h
===================================================================
--- libc.orig/usr/src/head/iso/time_iso.h
+++ libc/usr/src/head/iso/time_iso.h
-@@ -45,7 +45,7 @@
-
- #pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.18 */
+@@ -44,7 +44,7 @@
+ #ifndef _ISO_TIME_ISO_H
+ #define _ISO_TIME_ISO_H
-#include <sys/feature_tests.h>
+#include <features.h>
#ifdef __cplusplus
extern "C" {
-@@ -94,9 +94,15 @@ struct tm { /* see ctime(3) */
+@@ -93,6 +93,13 @@ struct tm { /* see ctime(3) */
int tm_wday;
int tm_yday;
int tm_isdst;
@@ -27,11 +27,8 @@ Index: libc/usr/src/head/iso/time_iso.h
+#endif
};
--
- #if defined(__STDC__)
- extern char *asctime(const struct tm *);
-@@ -105,11 +111,21 @@ extern char *ctime(const time_t *);
+@@ -102,11 +109,21 @@ extern char *ctime(const time_t *);
extern double difftime(time_t, time_t);
extern struct tm *gmtime(const time_t *);
extern struct tm *localtime(const time_t *);
@@ -42,8 +39,8 @@ Index: libc/usr/src/head/iso/time_iso.h
+#ifndef __IN_LIBC
+#ifdef __PRAGMA_REDEFINE_EXTNAME
-+extern time_t mktime(struct tm *);
+#pragma redefine_extname mktime __gnu_mktime
++extern time_t mktime(struct tm *);
+#else
+static time_t mktime(struct tm *___tm) {
+ return __gnu_mktime(___tm);
@@ -51,14 +48,14 @@ Index: libc/usr/src/head/iso/time_iso.h
+#endif
+#endif /* __IN_LIBC */
+
- #else /* __STDC__ */
-
- extern char *asctime();
+ #if __cplusplus >= 199711L
+ }
+ #endif /* end of namespace std */
Index: libc/usr/src/head/time.h
===================================================================
--- libc.orig/usr/src/head/time.h
+++ libc/usr/src/head/time.h
-@@ -33,7 +33,7 @@
+@@ -35,7 +35,7 @@
#ifndef _TIME_H
#define _TIME_H
@@ -258,7 +255,7 @@ Index: libc/usr/src/lib/libc/port/mapfile-vers
===================================================================
--- libc.orig/usr/src/lib/libc/port/mapfile-vers
+++ libc/usr/src/lib/libc/port/mapfile-vers
-@@ -120,6 +120,10 @@ SYMBOL_VERSION ILLUMOS_0.4 { # Illumos a
+@@ -262,6 +262,10 @@ SYMBOL_VERSION ILLUMOS_0.4 { # Illumos a
SYMBOL_VERSION DYSON_1 {
global:
diff --git a/libc/debian/patches/use-posix-functions.patch b/libc/debian/patches/use-posix-functions.patch
index 5cbe6ed..bc01a35 100644
--- a/libc/debian/patches/use-posix-functions.patch
+++ b/libc/debian/patches/use-posix-functions.patch
@@ -3,21 +3,19 @@ Index: libc/usr/src/head/pwd.h
===================================================================
--- libc.orig/usr/src/head/pwd.h
+++ libc/usr/src/head/pwd.h
-@@ -143,12 +143,7 @@ extern void setpwent();
+@@ -119,10 +119,7 @@ extern void setpwent(void);
* only. New applications/libraries should use the standard definitions.
*/
-#if !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE - 0 >= 199506L) || \
- defined(_POSIX_PTHREAD_SEMANTICS) || defined(__EXTENSIONS__)
-
--#if defined(__STDC__)
--
-#if (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
+#ifndef __USE_LEGACY_GETPW_R
#ifdef __PRAGMA_REDEFINE_EXTNAME
#pragma redefine_extname getpwuid_r __posix_getpwuid_r
-@@ -163,13 +158,6 @@ extern int __posix_getpwuid_r(uid_t, str
+@@ -138,13 +135,6 @@ extern int __posix_getpwuid_r(uid_t, str
extern int __posix_getpwnam_r(const char *, struct passwd *, char *,
size_t, struct passwd **);
@@ -29,9 +27,9 @@ Index: libc/usr/src/head/pwd.h
-#else /* !__lint */
-
static int
- getpwuid_r(uid_t __uid, struct passwd *__pwd, char *__buf, int __len,
+ getpwuid_r(uid_t __uid, struct passwd *__pwd, char *__buf, size_t __len,
struct passwd **__res)
-@@ -183,71 +171,16 @@ getpwnam_r(const char *__cb, struct pass
+@@ -158,17 +148,14 @@ getpwnam_r(const char *__cb, struct pass
return (__posix_getpwnam_r(__cb, __pwd, __buf, __len, __res));
}
@@ -46,60 +44,6 @@ Index: libc/usr/src/head/pwd.h
-#endif /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
-
--#else /* __STDC__ */
--
--#if (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
--
--#ifdef __PRAGMA_REDEFINE_EXTNAME
--#pragma redefine_extname getpwuid_r __posix_getpwuid_r
--#pragma redefine_extname getpwnam_r __posix_getpwnam_r
--extern int getpwuid_r();
--extern int getpwnam_r();
--#else /* __PRAGMA_REDEFINE_EXTNAME */
--
--extern int __posix_getpwuid_r();
--extern int __posix_getpwnam_r();
--
--#ifdef __lint
--
--#define getpwuid_r __posix_getpwuid_r
--#define getpwnam_r __posix_getpwnam_r
--
--#else /* !__lint */
--
--static int
--getpwuid_r(__uid, __pwd, __buf, __len, __res)
-- uid_t __uid;
-- struct passwd *__pwd;
-- char *__buf;
-- int __len;
-- struct passwd **__res;
--{
-- return (__posix_getpwuid_r(__uid, __pwd, __buf, __len, __res));
--}
--static int
--getpwnam_r(__cb, __pwd, __buf, __len, __res)
-- char *__cb;
-- struct passwd *__pwd;
-- char *__buf;
-- int __len;
-- struct passwd **__res;
--{
-- return (__posix_getpwnam_r(__cb, __pwd, __buf, __len, __res));
--}
--
--#endif /* !__lint */
--#endif /* __PRAGMA_REDEFINE_EXTNAME */
--
--#else /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
--
--extern struct passwd *getpwuid_r();
--extern struct passwd *getpwnam_r();
--
--#endif /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
-
--#endif /* __STDC__ */
-
-#endif /* !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE - 0 >= 199506L)... */
+#endif /* __USE_LEGACY_GETPW_R */
@@ -135,21 +79,19 @@ Index: libc/usr/src/head/grp.h
===================================================================
--- libc.orig/usr/src/head/grp.h
+++ libc/usr/src/head/grp.h
-@@ -134,12 +134,8 @@ extern struct group *getgrent(); /* MT-
+@@ -110,10 +110,7 @@ extern struct group *getgrent(void); /*
* only. New applications/libraries should use the standard definitions.
*/
-#if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
- (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
-
--#if defined(__STDC__)
-
-#if (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
+#ifndef __USE_LEGACY_GETGR_R
#ifdef __PRAGMA_REDEFINE_EXTNAME
#pragma redefine_extname getgrgid_r __posix_getgrgid_r
-@@ -154,13 +150,6 @@ extern int __posix_getgrgid_r(gid_t, str
+@@ -129,13 +126,6 @@ extern int __posix_getgrgid_r(gid_t, str
extern int __posix_getgrnam_r(const char *, struct group *, char *, size_t,
struct group **);
@@ -161,9 +103,9 @@ Index: libc/usr/src/head/grp.h
-#else /* !__lint */
-
static int
- getgrgid_r(gid_t __gid, struct group *__grp, char *__buf, int __len,
+ getgrgid_r(gid_t __gid, struct group *__grp, char *__buf, size_t __len,
struct group **__res)
-@@ -174,71 +163,14 @@ getgrnam_r(const char *__cb, struct grou
+@@ -149,17 +139,14 @@ getgrnam_r(const char *__cb, struct grou
return (__posix_getgrnam_r(__cb, __grp, __buf, __len, __res));
}
@@ -178,60 +120,6 @@ Index: libc/usr/src/head/grp.h
-#endif /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
-
--#else /* __STDC__ */
--
--#if (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
--
--#ifdef __PRAGMA_REDEFINE_EXTNAME
--#pragma redefine_extname getgrgid_r __posix_getgrgid_r
--#pragma redefine_extname getgrnam_r __posix_getgrnam_r
--extern int getgrgid_r();
--extern int getgrnam_r();
--#else /* __PRAGMA_REDEFINE_EXTNAME */
--
--extern int __posix_getgrgid_r();
--extern int __posix_getgrnam_r();
--
--#ifdef __lint
--
--#define getgrgid_r __posix_getgrgid_r
--#define getgrnam_r __posix_getgrnam_r
--
--#else /* !__lint */
--
--static int
--getgrgid_r(__gid, __grp, __buf, __len, __res)
-- gid_t __gid;
-- struct group *__grp;
-- char *__buf;
-- int __len;
-- struct group **__res;
--{
-- return (__posix_getgrgid_r(__gid, __grp, __buf, __len, __res));
--}
--static int
--getgrnam_r(__cb, __grp, __buf, __len, __res)
-- char *__cb;
-- struct group *__grp;
-- char *__buf;
-- int __len;
-- struct group **__res;
--{
-- return (__posix_getgrnam_r(__cb, __grp, __buf, __len, __res));
--}
--
--#endif /* !__lint */
--#endif /* __PRAGMA_REDEFINE_EXTNAME */
--
--#else /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
--
--extern struct group *getgrgid_r();
--extern struct group *getgrnam_r();
--
--#endif /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
--
--#endif /* __STDC__ */
--
-#endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX)... */
+#endif /* __USE_LEGACY_GETGR_R */
@@ -332,22 +220,20 @@ Index: libc/usr/src/head/signal.h
===================================================================
--- libc.orig/usr/src/head/signal.h
+++ libc/usr/src/head/signal.h
-@@ -213,13 +213,8 @@ extern int sigqueue();
+@@ -140,11 +140,7 @@ extern int sigqueue(pid_t, int, const un
* sigwait() prototype is defined here.
*/
-#if defined(__EXTENSIONS__) || (!defined(_STRICT_STDC) && \
- !defined(__XOPEN_OR_POSIX)) || (_POSIX_C_SOURCE - 0 >= 199506L) || \
- defined(_POSIX_PTHREAD_SEMANTICS)
-
--#if defined(__STDC__)
-
-#if (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
+#ifndef __USE_LEGACY_SIGWAIT
#ifdef __PRAGMA_REDEFINE_EXTNAME
#pragma redefine_extname sigwait __posix_sigwait
-@@ -229,62 +224,19 @@ extern int sigwait(const sigset_t *_REST
+@@ -154,26 +150,19 @@ extern int sigwait(const sigset_t *_REST
extern int __posix_sigwait(const sigset_t *_RESTRICT_KYWD,
int *_RESTRICT_KYWD);
@@ -371,42 +257,6 @@ Index: libc/usr/src/head/signal.h
-#endif /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
-
--
--#else /* __STDC__ */
--
--
--#if (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
--
--#ifdef __PRAGMA_REDEFINE_EXTNAME
--#pragma redefine_extname sigwait __posix_sigwait
--extern int sigwait();
--#else /* __PRAGMA_REDEFINE_EXTNAME */
--
--extern int __posix_sigwait();
--
--#ifdef __lint
--#define sigwait __posix_sigwait
--#else /* !__lint */
--
--static int
--sigwait(__setp, __signo)
-- sigset_t *__setp;
-- int *__signo;
--{
-- return (__posix_sigwait(__setp, __signo));
--}
--
--#endif /* !__lint */
--#endif /* __PRAGMA_REDEFINE_EXTNAME */
--
--#else /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
--
--extern int sigwait();
--
--#endif /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
--
--#endif /* __STDC__ */
--
-#endif /* defined(__EXTENSIONS__) || (!defined(_STRICT_STDC) ... */
+#endif /* __USE_LEGACY_SIGWAIT */
@@ -442,7 +292,7 @@ Index: libc/usr/src/lib/libc/port/threads/scalls.c
===================================================================
--- libc.orig/usr/src/lib/libc/port/threads/scalls.c
+++ libc/usr/src/lib/libc/port/threads/scalls.c
-@@ -26,6 +26,8 @@
+@@ -27,6 +27,8 @@
/* Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved. */