[Midnightbsd-cvs] src [10231] trunk/cddl/compat/opensolaris: sync

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sat Jun 2 12:08:05 EDT 2018


Revision: 10231
          http://svnweb.midnightbsd.org/src/?rev=10231
Author:   laffer1
Date:     2018-06-02 12:08:04 -0400 (Sat, 02 Jun 2018)
Log Message:
-----------
sync

Modified Paths:
--------------
    trunk/cddl/Makefile
    trunk/cddl/Makefile.inc
    trunk/cddl/compat/opensolaris/include/alloca.h
    trunk/cddl/compat/opensolaris/include/assert.h
    trunk/cddl/compat/opensolaris/include/devid.h
    trunk/cddl/compat/opensolaris/include/dtrace.h
    trunk/cddl/compat/opensolaris/include/fcntl.h
    trunk/cddl/compat/opensolaris/include/fsshare.h
    trunk/cddl/compat/opensolaris/include/libintl.h
    trunk/cddl/compat/opensolaris/include/libproc.h
    trunk/cddl/compat/opensolaris/include/libshare.h
    trunk/cddl/compat/opensolaris/include/mnttab.h
    trunk/cddl/compat/opensolaris/include/priv.h
    trunk/cddl/compat/opensolaris/include/sha2.h
    trunk/cddl/compat/opensolaris/include/solaris.h
    trunk/cddl/compat/opensolaris/include/stdio.h
    trunk/cddl/compat/opensolaris/include/stdlib.h
    trunk/cddl/compat/opensolaris/include/strings.h
    trunk/cddl/compat/opensolaris/include/thread_pool.h
    trunk/cddl/compat/opensolaris/include/unistd.h
    trunk/cddl/compat/opensolaris/include/zone.h
    trunk/cddl/compat/opensolaris/lib/libumem/umem.c
    trunk/cddl/compat/opensolaris/lib/libumem/umem.h
    trunk/cddl/compat/opensolaris/misc/deviceid.c
    trunk/cddl/compat/opensolaris/misc/fsshare.c
    trunk/cddl/compat/opensolaris/misc/mkdirp.c
    trunk/cddl/compat/opensolaris/misc/mnttab.c
    trunk/cddl/compat/opensolaris/misc/zmount.c
    trunk/cddl/compat/opensolaris/misc/zone.c

Added Paths:
-----------
    trunk/cddl/compat/opensolaris/misc/thread_pool.c
    trunk/cddl/compat/opensolaris/misc/thread_pool_impl.h

Property Changed:
----------------
    trunk/cddl/Makefile.inc

Modified: trunk/cddl/Makefile
===================================================================
--- trunk/cddl/Makefile	2018-06-02 16:07:40 UTC (rev 10230)
+++ trunk/cddl/Makefile	2018-06-02 16:08:04 UTC (rev 10231)
@@ -1,5 +1,15 @@
 # $MidnightBSD$
+# $FreeBSD: stable/10/cddl/Makefile 291792 2015-12-04 18:14:31Z bdrewery $
 
-SUBDIR=	lib sbin usr.bin usr.sbin
+.include <bsd.own.mk>
 
+SUBDIR=	lib .WAIT \
+	sbin usr.bin usr.sbin
+
+.if ${MK_TESTS} != "no"
+SUBDIR+=tests
+.endif
+
+SUBDIR_PARALLEL=
+
 .include <bsd.subdir.mk>

Modified: trunk/cddl/Makefile.inc
===================================================================
--- trunk/cddl/Makefile.inc	2018-06-02 16:07:40 UTC (rev 10230)
+++ trunk/cddl/Makefile.inc	2018-06-02 16:08:04 UTC (rev 10231)
@@ -1,4 +1,5 @@
-# $MidnightBSD: src/cddl/Makefile.inc,v 1.4 2012/04/06 02:23:54 laffer1 Exp $
+# $MidnightBSD$
+# $FreeBSD: stable/10/cddl/Makefile.inc 215455 2010-11-18 16:32:52Z markm $
 
 OPENSOLARIS_USR_DISTDIR= ${.CURDIR}/../../../cddl/contrib/opensolaris
 OPENSOLARIS_SYS_DISTDIR= ${.CURDIR}/../../../sys/cddl/contrib/opensolaris


Property changes on: trunk/cddl/Makefile.inc
___________________________________________________________________
Added: mnbsd:nokeywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/cddl/compat/opensolaris/include/alloca.h
===================================================================
--- trunk/cddl/compat/opensolaris/include/alloca.h	2018-06-02 16:07:40 UTC (rev 10230)
+++ trunk/cddl/compat/opensolaris/include/alloca.h	2018-06-02 16:08:04 UTC (rev 10231)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * Copyright (C) 2007 John Birrell <jb at freebsd.org>
  * All rights reserved.
@@ -23,7 +24,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/cddl/compat/opensolaris/include/alloca.h 177698 2008-03-28 22:16:18Z jb $
  *
  */
 

Modified: trunk/cddl/compat/opensolaris/include/assert.h
===================================================================
--- trunk/cddl/compat/opensolaris/include/assert.h	2018-06-02 16:07:40 UTC (rev 10230)
+++ trunk/cddl/compat/opensolaris/include/assert.h	2018-06-02 16:08:04 UTC (rev 10231)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2009 Pawel Jakub Dawidek <pjd at FreeBSD.org>
  * All rights reserved.
@@ -23,7 +24,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/cddl/compat/opensolaris/include/assert.h 222950 2011-06-10 20:10:30Z gibbs $
  */
 
 #undef assert

Modified: trunk/cddl/compat/opensolaris/include/devid.h
===================================================================
--- trunk/cddl/compat/opensolaris/include/devid.h	2018-06-02 16:07:40 UTC (rev 10230)
+++ trunk/cddl/compat/opensolaris/include/devid.h	2018-06-02 16:08:04 UTC (rev 10231)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * CDDL HEADER START
  *
@@ -19,7 +20,7 @@
  *
  * CDDL HEADER END
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/cddl/compat/opensolaris/include/devid.h 178414 2008-04-22 07:43:00Z jb $
  */
 /*
  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.

Modified: trunk/cddl/compat/opensolaris/include/dtrace.h
===================================================================
--- trunk/cddl/compat/opensolaris/include/dtrace.h	2018-06-02 16:07:40 UTC (rev 10230)
+++ trunk/cddl/compat/opensolaris/include/dtrace.h	2018-06-02 16:08:04 UTC (rev 10231)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * Copyright (C) 2008 John Birrell <jb at freebsd.org>
  * All rights reserved.
@@ -23,7 +24,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/cddl/compat/opensolaris/include/dtrace.h 179163 2008-05-21 00:26:38Z jb $
  *
  */
 

Modified: trunk/cddl/compat/opensolaris/include/fcntl.h
===================================================================
--- trunk/cddl/compat/opensolaris/include/fcntl.h	2018-06-02 16:07:40 UTC (rev 10230)
+++ trunk/cddl/compat/opensolaris/include/fcntl.h	2018-06-02 16:08:04 UTC (rev 10231)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * Copyright (C) 2007 John Birrell <jb at freebsd.org>
  * All rights reserved.
@@ -23,7 +24,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/cddl/compat/opensolaris/include/fcntl.h 219089 2011-02-27 19:41:40Z pjd $
  *
  */
 

Modified: trunk/cddl/compat/opensolaris/include/fsshare.h
===================================================================
--- trunk/cddl/compat/opensolaris/include/fsshare.h	2018-06-02 16:07:40 UTC (rev 10230)
+++ trunk/cddl/compat/opensolaris/include/fsshare.h	2018-06-02 16:08:04 UTC (rev 10231)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2007 Pawel Jakub Dawidek <pjd at FreeBSD.org>
  * All rights reserved.
@@ -23,7 +24,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/cddl/compat/opensolaris/include/fsshare.h 177698 2008-03-28 22:16:18Z jb $
  */
 
 #ifndef _OPENSOLARIS_FSSHARE_H_

Modified: trunk/cddl/compat/opensolaris/include/libintl.h
===================================================================
--- trunk/cddl/compat/opensolaris/include/libintl.h	2018-06-02 16:07:40 UTC (rev 10230)
+++ trunk/cddl/compat/opensolaris/include/libintl.h	2018-06-02 16:08:04 UTC (rev 10231)
@@ -1,4 +1,5 @@
 /* $MidnightBSD$ */
+/* $FreeBSD: stable/10/cddl/compat/opensolaris/include/libintl.h 178414 2008-04-22 07:43:00Z jb $ */
 
 #ifndef	_LIBINTL_H_
 #define	_LIBINTL_H_

Modified: trunk/cddl/compat/opensolaris/include/libproc.h
===================================================================
--- trunk/cddl/compat/opensolaris/include/libproc.h	2018-06-02 16:07:40 UTC (rev 10230)
+++ trunk/cddl/compat/opensolaris/include/libproc.h	2018-06-02 16:08:04 UTC (rev 10231)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * Copyright (C) 2008 John Birrell <jb at freebsd.org>
  * All rights reserved.
@@ -23,7 +24,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/cddl/compat/opensolaris/include/libproc.h 179163 2008-05-21 00:26:38Z jb $
  *
  */
 

Modified: trunk/cddl/compat/opensolaris/include/libshare.h
===================================================================
--- trunk/cddl/compat/opensolaris/include/libshare.h	2018-06-02 16:07:40 UTC (rev 10230)
+++ trunk/cddl/compat/opensolaris/include/libshare.h	2018-06-02 16:08:04 UTC (rev 10231)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2007 Pawel Jakub Dawidek <pjd at FreeBSD.org>
  * All rights reserved.
@@ -23,7 +24,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/cddl/compat/opensolaris/include/libshare.h 185029 2008-11-17 20:49:29Z pjd $
  */
 
 #ifndef _OPENSOLARIS_LIBSHARE_H_

Modified: trunk/cddl/compat/opensolaris/include/mnttab.h
===================================================================
--- trunk/cddl/compat/opensolaris/include/mnttab.h	2018-06-02 16:07:40 UTC (rev 10230)
+++ trunk/cddl/compat/opensolaris/include/mnttab.h	2018-06-02 16:08:04 UTC (rev 10231)
@@ -1,4 +1,5 @@
 /* $MidnightBSD$ */
+/* $FreeBSD: stable/10/cddl/compat/opensolaris/include/mnttab.h 219089 2011-02-27 19:41:40Z pjd $ */
 
 #ifndef	_OPENSOLARIS_MNTTAB_H_
 #define	_OPENSOLARIS_MNTTAB_H_

Modified: trunk/cddl/compat/opensolaris/include/priv.h
===================================================================
--- trunk/cddl/compat/opensolaris/include/priv.h	2018-06-02 16:07:40 UTC (rev 10230)
+++ trunk/cddl/compat/opensolaris/include/priv.h	2018-06-02 16:08:04 UTC (rev 10231)
@@ -1,4 +1,5 @@
 /* $MidnightBSD$ */
+/* $FreeBSD: stable/10/cddl/compat/opensolaris/include/priv.h 219089 2011-02-27 19:41:40Z pjd $ */
 
 #ifndef	_OPENSOLARIS_PRIV_H_
 #define	_OPENSOLARIS_PRIV_H_

Modified: trunk/cddl/compat/opensolaris/include/sha2.h
===================================================================
--- trunk/cddl/compat/opensolaris/include/sha2.h	2018-06-02 16:07:40 UTC (rev 10230)
+++ trunk/cddl/compat/opensolaris/include/sha2.h	2018-06-02 16:08:04 UTC (rev 10231)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2010 Pawel Jakub Dawidek <pjd at FreeBSD.org>
  * All rights reserved.
@@ -23,7 +24,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/cddl/compat/opensolaris/include/sha2.h 219089 2011-02-27 19:41:40Z pjd $
  */
 
 #ifndef _OPENSOLARIS_SHA2_H_

Modified: trunk/cddl/compat/opensolaris/include/solaris.h
===================================================================
--- trunk/cddl/compat/opensolaris/include/solaris.h	2018-06-02 16:07:40 UTC (rev 10230)
+++ trunk/cddl/compat/opensolaris/include/solaris.h	2018-06-02 16:08:04 UTC (rev 10231)
@@ -1,4 +1,5 @@
 /* $MidnightBSD$ */
+/* $FreeBSD: stable/10/cddl/compat/opensolaris/include/solaris.h 219089 2011-02-27 19:41:40Z pjd $ */
 
 #ifndef	_SOLARIS_H_
 #define	_SOLARIS_H_

Modified: trunk/cddl/compat/opensolaris/include/stdio.h
===================================================================
--- trunk/cddl/compat/opensolaris/include/stdio.h	2018-06-02 16:07:40 UTC (rev 10230)
+++ trunk/cddl/compat/opensolaris/include/stdio.h	2018-06-02 16:08:04 UTC (rev 10231)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * Copyright (C) 2007 John Birrell <jb at freebsd.org>
  * All rights reserved.
@@ -23,7 +24,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/cddl/compat/opensolaris/include/stdio.h 177698 2008-03-28 22:16:18Z jb $
  *
  */
 

Modified: trunk/cddl/compat/opensolaris/include/stdlib.h
===================================================================
--- trunk/cddl/compat/opensolaris/include/stdlib.h	2018-06-02 16:07:40 UTC (rev 10230)
+++ trunk/cddl/compat/opensolaris/include/stdlib.h	2018-06-02 16:08:04 UTC (rev 10231)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * Copyright (C) 2007 John Birrell <jb at freebsd.org>
  * All rights reserved.
@@ -23,15 +24,15 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/cddl/compat/opensolaris/include/stdlib.h 234856 2012-04-30 23:12:16Z rmh $
  *
  */
 
+#include_next <stdlib.h>
+
 #ifndef _COMPAT_OPENSOLARIS_STDLIB_H_
 #define _COMPAT_OPENSOLARIS_STDLIB_H_
 
-#include_next <stdlib.h>
-
 #define getexecname	getprogname
 
 #endif

Modified: trunk/cddl/compat/opensolaris/include/strings.h
===================================================================
--- trunk/cddl/compat/opensolaris/include/strings.h	2018-06-02 16:07:40 UTC (rev 10230)
+++ trunk/cddl/compat/opensolaris/include/strings.h	2018-06-02 16:08:04 UTC (rev 10231)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * Copyright (C) 2007 John Birrell <jb at freebsd.org>
  * All rights reserved.
@@ -23,7 +24,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/cddl/compat/opensolaris/include/strings.h 177698 2008-03-28 22:16:18Z jb $
  *
  */
 

Modified: trunk/cddl/compat/opensolaris/include/thread_pool.h
===================================================================
--- trunk/cddl/compat/opensolaris/include/thread_pool.h	2018-06-02 16:07:40 UTC (rev 10230)
+++ trunk/cddl/compat/opensolaris/include/thread_pool.h	2018-06-02 16:08:04 UTC (rev 10231)
@@ -1,39 +1,79 @@
-/*-
- * Copyright (c) 2010 Pawel Jakub Dawidek <pjd at FreeBSD.org>
- * All rights reserved.
+/* $MidnightBSD$ */
+/*
+ * CDDL HEADER START
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
+ * 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.
  *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
+ * 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.
  *
- * $MidnightBSD$
+ * 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
  */
 
-#ifndef _OPENSOLARIS_THREAD_POOL_H_
-#define _OPENSOLARIS_THREAD_POOL_H_
+/*
+ * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Use is subject to license terms.
+ */
 
-typedef int tpool_t;
+/*
+ * $FreeBSD: stable/10/cddl/compat/opensolaris/include/thread_pool.h 266612 2014-05-24 10:44:40Z mav $
+ */
 
-#define	tpool_create(a, b, c, d)	(0)
-#define	tpool_dispatch(pool, func, arg)	func(arg)
-#define	tpool_wait(pool)		do { } while (0)
-#define	tpool_destroy(pool)		do { } while (0)
+#ifndef	_THREAD_POOL_H_
+#define	_THREAD_POOL_H_
 
-#endif	/* !_OPENSOLARIS_THREAD_POOL_H_ */
+#pragma ident	"%Z%%M%	%I%	%E% SMI"
+
+#include <sys/types.h>
+#include <thread.h>
+#include <pthread.h>
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+typedef	struct tpool tpool_t;	/* opaque thread pool descriptor */
+
+#if defined(__STDC__)
+
+extern	tpool_t	*tpool_create(uint_t min_threads, uint_t max_threads,
+			uint_t linger, pthread_attr_t *attr);
+extern	int	tpool_dispatch(tpool_t *tpool,
+			void (*func)(void *), void *arg);
+extern	void	tpool_destroy(tpool_t *tpool);
+extern	void	tpool_abandon(tpool_t *tpool);
+extern	void	tpool_wait(tpool_t *tpool);
+extern	void	tpool_suspend(tpool_t *tpool);
+extern	int	tpool_suspended(tpool_t *tpool);
+extern	void	tpool_resume(tpool_t *tpool);
+extern	int	tpool_member(tpool_t *tpool);
+
+#else	/* Non ANSI */
+
+extern	tpool_t	*tpool_create();
+extern	int	tpool_dispatch();
+extern	void	tpool_destroy();
+extern	void	tpool_abandon();
+extern	void	tpool_wait();
+extern	void	tpool_suspend();
+extern	int	tpool_suspended();
+extern	void	tpool_resume();
+extern	int	tpool_member();
+
+#endif	/* __STDC__ */
+
+#ifdef	__cplusplus
+}
+#endif
+
+#endif	/* _THREAD_POOL_H_ */

Modified: trunk/cddl/compat/opensolaris/include/unistd.h
===================================================================
--- trunk/cddl/compat/opensolaris/include/unistd.h	2018-06-02 16:07:40 UTC (rev 10230)
+++ trunk/cddl/compat/opensolaris/include/unistd.h	2018-06-02 16:08:04 UTC (rev 10231)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * Copyright (C) 2007 John Birrell <jb at freebsd.org>
  * All rights reserved.
@@ -23,7 +24,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/cddl/compat/opensolaris/include/unistd.h 177698 2008-03-28 22:16:18Z jb $
  *
  */
 

Modified: trunk/cddl/compat/opensolaris/include/zone.h
===================================================================
--- trunk/cddl/compat/opensolaris/include/zone.h	2018-06-02 16:07:40 UTC (rev 10230)
+++ trunk/cddl/compat/opensolaris/include/zone.h	2018-06-02 16:08:04 UTC (rev 10231)
@@ -1,4 +1,5 @@
 /* $MidnightBSD$ */
+/* $FreeBSD: stable/10/cddl/compat/opensolaris/include/zone.h 178414 2008-04-22 07:43:00Z jb $ */
 
 #ifndef	_ZONE_H_
 #define	_ZONE_H_

Modified: trunk/cddl/compat/opensolaris/lib/libumem/umem.c
===================================================================
--- trunk/cddl/compat/opensolaris/lib/libumem/umem.c	2018-06-02 16:07:40 UTC (rev 10230)
+++ trunk/cddl/compat/opensolaris/lib/libumem/umem.c	2018-06-02 16:08:04 UTC (rev 10231)
@@ -18,6 +18,8 @@
  * information: Portions Copyright [yyyy] [name of copyright owner]
  *
  * CDDL HEADER END
+ *
+ * $FreeBSD: stable/10/cddl/compat/opensolaris/lib/libumem/umem.c 178414 2008-04-22 07:43:00Z jb $
  */
 /*
  * Copyright 2006 Ricardo Correia.  All rights reserved.

Modified: trunk/cddl/compat/opensolaris/lib/libumem/umem.h
===================================================================
--- trunk/cddl/compat/opensolaris/lib/libumem/umem.h	2018-06-02 16:07:40 UTC (rev 10230)
+++ trunk/cddl/compat/opensolaris/lib/libumem/umem.h	2018-06-02 16:08:04 UTC (rev 10231)
@@ -19,6 +19,8 @@
  * information: Portions Copyright [yyyy] [name of copyright owner]
  *
  * CDDL HEADER END
+ *
+ * $FreeBSD: stable/10/cddl/compat/opensolaris/lib/libumem/umem.h 178414 2008-04-22 07:43:00Z jb $
  */
 /*
  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.

Modified: trunk/cddl/compat/opensolaris/misc/deviceid.c
===================================================================
--- trunk/cddl/compat/opensolaris/misc/deviceid.c	2018-06-02 16:07:40 UTC (rev 10230)
+++ trunk/cddl/compat/opensolaris/misc/deviceid.c	2018-06-02 16:08:04 UTC (rev 10231)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2007 Pawel Jakub Dawidek <pjd at FreeBSD.org>
  * All rights reserved.
@@ -25,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/cddl/compat/opensolaris/misc/deviceid.c 238112 2012-07-04 17:36:26Z pjd $");
 
 #include <sys/param.h>
 #include <sys/ioctl.h>
@@ -45,7 +46,7 @@
 		return (EINVAL);
 	}
 	*retminor_name = strdup("");
-	if (*retminor_name == NULL);
+	if (*retminor_name == NULL)
 		return (ENOMEM);
 	return (0);
 }

Modified: trunk/cddl/compat/opensolaris/misc/fsshare.c
===================================================================
--- trunk/cddl/compat/opensolaris/misc/fsshare.c	2018-06-02 16:07:40 UTC (rev 10230)
+++ trunk/cddl/compat/opensolaris/misc/fsshare.c	2018-06-02 16:08:04 UTC (rev 10231)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2007 Pawel Jakub Dawidek <pjd at FreeBSD.org>
  * All rights reserved.
@@ -25,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/cddl/compat/opensolaris/misc/fsshare.c 222313 2011-05-26 16:27:00Z will $");
 
 #include <sys/param.h>
 

Modified: trunk/cddl/compat/opensolaris/misc/mkdirp.c
===================================================================
--- trunk/cddl/compat/opensolaris/misc/mkdirp.c	2018-06-02 16:07:40 UTC (rev 10230)
+++ trunk/cddl/compat/opensolaris/misc/mkdirp.c	2018-06-02 16:08:04 UTC (rev 10231)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * CDDL HEADER START
  *
@@ -19,7 +20,7 @@
  *
  * CDDL HEADER END
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/cddl/compat/opensolaris/misc/mkdirp.c 178414 2008-04-22 07:43:00Z jb $
  */
 
 /*	Copyright (c) 1988 AT&T	*/

Modified: trunk/cddl/compat/opensolaris/misc/mnttab.c
===================================================================
--- trunk/cddl/compat/opensolaris/misc/mnttab.c	2018-06-02 16:07:40 UTC (rev 10230)
+++ trunk/cddl/compat/opensolaris/misc/mnttab.c	2018-06-02 16:08:04 UTC (rev 10231)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2006 Pawel Jakub Dawidek <pjd at FreeBSD.org>
  * All rights reserved.
@@ -30,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/cddl/compat/opensolaris/misc/mnttab.c 209962 2010-07-12 23:49:04Z mm $");
 
 #include <sys/param.h>
 #include <sys/mount.h>

Added: trunk/cddl/compat/opensolaris/misc/thread_pool.c
===================================================================
--- trunk/cddl/compat/opensolaris/misc/thread_pool.c	                        (rev 0)
+++ trunk/cddl/compat/opensolaris/misc/thread_pool.c	2018-06-02 16:08:04 UTC (rev 10231)
@@ -0,0 +1,429 @@
+/* $MidnightBSD$ */
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: stable/10/cddl/compat/opensolaris/misc/thread_pool.c 277554 2015-01-23 00:54:56Z delphij $");
+
+#pragma ident	"%Z%%M%	%I%	%E% SMI"
+
+#include <stdlib.h>
+#include <signal.h>
+#include <errno.h>
+#include "thread_pool_impl.h"
+
+typedef void (*_Voidfp)(void*); /* pointer to extern "C" function */
+
+static void
+delete_pool(tpool_t *tpool)
+{
+	tpool_job_t *job;
+
+	/*
+	 * There should be no pending jobs, but just in case...
+	 */
+	for (job = tpool->tp_head; job != NULL; job = tpool->tp_head) {
+		tpool->tp_head = job->tpj_next;
+		free(job);
+	}
+	(void) pthread_attr_destroy(&tpool->tp_attr);
+	free(tpool);
+}
+
+/*
+ * Worker thread is terminating.
+ */
+static void
+worker_cleanup(void *arg)
+{
+	tpool_t *tpool = arg;
+
+	if (--tpool->tp_current == 0 &&
+	    (tpool->tp_flags & (TP_DESTROY | TP_ABANDON))) {
+		if (tpool->tp_flags & TP_ABANDON) {
+			pthread_mutex_unlock(&tpool->tp_mutex);
+			delete_pool(tpool);
+			return;
+		}
+		if (tpool->tp_flags & TP_DESTROY)
+			(void) pthread_cond_broadcast(&tpool->tp_busycv);
+	}
+	pthread_mutex_unlock(&tpool->tp_mutex);
+}
+
+static void
+notify_waiters(tpool_t *tpool)
+{
+	if (tpool->tp_head == NULL && tpool->tp_active == NULL) {
+		tpool->tp_flags &= ~TP_WAIT;
+		(void) pthread_cond_broadcast(&tpool->tp_waitcv);
+	}
+}
+
+/*
+ * Called by a worker thread on return from a tpool_dispatch()d job.
+ */
+static void
+job_cleanup(void *arg)
+{
+	tpool_t *tpool = arg;
+	pthread_t my_tid = pthread_self();
+	tpool_active_t *activep;
+	tpool_active_t **activepp;
+
+	pthread_mutex_lock(&tpool->tp_mutex);
+	/* CSTYLED */
+	for (activepp = &tpool->tp_active;; activepp = &activep->tpa_next) {
+		activep = *activepp;
+		if (activep->tpa_tid == my_tid) {
+			*activepp = activep->tpa_next;
+			break;
+		}
+	}
+	if (tpool->tp_flags & TP_WAIT)
+		notify_waiters(tpool);
+}
+
+static void *
+tpool_worker(void *arg)
+{
+	tpool_t *tpool = (tpool_t *)arg;
+	int elapsed;
+	tpool_job_t *job;
+	void (*func)(void *);
+	tpool_active_t active;
+	sigset_t maskset;
+
+	pthread_mutex_lock(&tpool->tp_mutex);
+	pthread_cleanup_push(worker_cleanup, tpool);
+
+	/*
+	 * This is the worker's main loop.
+	 * It will only be left if a timeout or an error has occured.
+	 */
+	active.tpa_tid = pthread_self();
+	for (;;) {
+		elapsed = 0;
+		tpool->tp_idle++;
+		if (tpool->tp_flags & TP_WAIT)
+			notify_waiters(tpool);
+		while ((tpool->tp_head == NULL ||
+		    (tpool->tp_flags & TP_SUSPEND)) &&
+		    !(tpool->tp_flags & (TP_DESTROY | TP_ABANDON))) {
+			if (tpool->tp_current <= tpool->tp_minimum ||
+			    tpool->tp_linger == 0) {
+				(void) pthread_cond_wait(&tpool->tp_workcv,
+				    &tpool->tp_mutex);
+			} else {
+				struct timespec timeout;
+
+				clock_gettime(CLOCK_MONOTONIC, &timeout);
+				timeout.tv_sec += tpool->tp_linger;
+				if (pthread_cond_timedwait(&tpool->tp_workcv,
+				    &tpool->tp_mutex, &timeout) != 0) {
+					elapsed = 1;
+					break;
+				}
+			}
+		}
+		tpool->tp_idle--;
+		if (tpool->tp_flags & TP_DESTROY)
+			break;
+		if (tpool->tp_flags & TP_ABANDON) {
+			/* can't abandon a suspended pool */
+			if (tpool->tp_flags & TP_SUSPEND) {
+				tpool->tp_flags &= ~TP_SUSPEND;
+				(void) pthread_cond_broadcast(&tpool->tp_workcv);
+			}
+			if (tpool->tp_head == NULL)
+				break;
+		}
+		if ((job = tpool->tp_head) != NULL &&
+		    !(tpool->tp_flags & TP_SUSPEND)) {
+			elapsed = 0;
+			func = job->tpj_func;
+			arg = job->tpj_arg;
+			tpool->tp_head = job->tpj_next;
+			if (job == tpool->tp_tail)
+				tpool->tp_tail = NULL;
+			tpool->tp_njobs--;
+			active.tpa_next = tpool->tp_active;
+			tpool->tp_active = &active;
+			pthread_mutex_unlock(&tpool->tp_mutex);
+			pthread_cleanup_push(job_cleanup, tpool);
+			free(job);
+			/*
+			 * Call the specified function.
+			 */
+			func(arg);
+			/*
+			 * We don't know what this thread has been doing,
+			 * so we reset its signal mask and cancellation
+			 * state back to the initial values.
+			 */
+			sigfillset(&maskset);
+			(void) pthread_sigmask(SIG_SETMASK, &maskset, NULL);
+			(void) pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED,
+			    NULL);
+			(void) pthread_setcancelstate(PTHREAD_CANCEL_ENABLE,
+			    NULL);
+			pthread_cleanup_pop(1);
+		}
+		if (elapsed && tpool->tp_current > tpool->tp_minimum) {
+			/*
+			 * We timed out and there is no work to be done
+			 * and the number of workers exceeds the minimum.
+			 * Exit now to reduce the size of the pool.
+			 */
+			break;
+		}
+	}
+	pthread_cleanup_pop(1);
+	return (arg);
+}
+
+/*
+ * Create a worker thread, with all signals blocked.
+ */
+static int
+create_worker(tpool_t *tpool)
+{
+	sigset_t maskset, oset;
+	pthread_t thread;
+	int error;
+
+	sigfillset(&maskset);
+	(void) pthread_sigmask(SIG_SETMASK, &maskset, &oset);
+	error = pthread_create(&thread, &tpool->tp_attr, tpool_worker, tpool);
+	(void) pthread_sigmask(SIG_SETMASK, &oset, NULL);
+	return (error);
+}
+
+tpool_t	*
+tpool_create(uint_t min_threads, uint_t max_threads, uint_t linger,
+	pthread_attr_t *attr)
+{
+	tpool_t	*tpool;
+	int error;
+
+	if (min_threads > max_threads || max_threads < 1) {
+		errno = EINVAL;
+		return (NULL);
+	}
+
+	tpool = calloc(1, sizeof (*tpool));
+	if (tpool == NULL) {
+		errno = ENOMEM;
+		return (NULL);
+	}
+	(void) pthread_mutex_init(&tpool->tp_mutex, NULL);
+	(void) pthread_cond_init(&tpool->tp_busycv, NULL);
+	(void) pthread_cond_init(&tpool->tp_workcv, NULL);
+	(void) pthread_cond_init(&tpool->tp_waitcv, NULL);
+	tpool->tp_minimum = min_threads;
+	tpool->tp_maximum = max_threads;
+	tpool->tp_linger = linger;
+
+	/* make all pool threads be detached daemon threads */
+	(void) pthread_attr_init(&tpool->tp_attr);
+	(void) pthread_attr_setdetachstate(&tpool->tp_attr,
+	    PTHREAD_CREATE_DETACHED);
+
+	return (tpool);
+}
+
+/*
+ * Dispatch a work request to the thread pool.
+ * If there are idle workers, awaken one.
+ * Else, if the maximum number of workers has
+ * not been reached, spawn a new worker thread.
+ * Else just return with the job added to the queue.
+ */
+int
+tpool_dispatch(tpool_t *tpool, void (*func)(void *), void *arg)
+{
+	tpool_job_t *job;
+
+	if ((job = calloc(1, sizeof (*job))) == NULL)
+		return (-1);
+	job->tpj_next = NULL;
+	job->tpj_func = func;
+	job->tpj_arg = arg;
+
+	pthread_mutex_lock(&tpool->tp_mutex);
+
+	if (tpool->tp_head == NULL)
+		tpool->tp_head = job;
+	else
+		tpool->tp_tail->tpj_next = job;
+	tpool->tp_tail = job;
+	tpool->tp_njobs++;
+
+	if (!(tpool->tp_flags & TP_SUSPEND)) {
+		if (tpool->tp_idle > 0)
+			(void) pthread_cond_signal(&tpool->tp_workcv);
+		else if (tpool->tp_current < tpool->tp_maximum &&
+		    create_worker(tpool) == 0)
+			tpool->tp_current++;
+	}
+
+	pthread_mutex_unlock(&tpool->tp_mutex);
+	return (0);
+}
+
+/*
+ * Assumes: by the time tpool_destroy() is called no one will use this
+ * thread pool in any way and no one will try to dispatch entries to it.
+ * Calling tpool_destroy() from a job in the pool will cause deadlock.
+ */
+void
+tpool_destroy(tpool_t *tpool)
+{
+	tpool_active_t *activep;
+
+	pthread_mutex_lock(&tpool->tp_mutex);
+	pthread_cleanup_push((_Voidfp)pthread_mutex_unlock, &tpool->tp_mutex);
+
+	/* mark the pool as being destroyed; wakeup idle workers */
+	tpool->tp_flags |= TP_DESTROY;
+	tpool->tp_flags &= ~TP_SUSPEND;
+	(void) pthread_cond_broadcast(&tpool->tp_workcv);
+
+	/* cancel all active workers */
+	for (activep = tpool->tp_active; activep; activep = activep->tpa_next)
+		(void) pthread_cancel(activep->tpa_tid);
+
+	/* wait for all active workers to finish */
+	while (tpool->tp_active != NULL) {
+		tpool->tp_flags |= TP_WAIT;
+		(void) pthread_cond_wait(&tpool->tp_waitcv, &tpool->tp_mutex);
+	}
+
+	/* the last worker to terminate will wake us up */
+	while (tpool->tp_current != 0)
+		(void) pthread_cond_wait(&tpool->tp_busycv, &tpool->tp_mutex);
+
+	pthread_cleanup_pop(1);	/* pthread_mutex_unlock(&tpool->tp_mutex); */
+	delete_pool(tpool);
+}
+
+/*
+ * Like tpool_destroy(), but don't cancel workers or wait for them to finish.
+ * The last worker to terminate will delete the pool.
+ */
+void
+tpool_abandon(tpool_t *tpool)
+{
+
+	pthread_mutex_lock(&tpool->tp_mutex);
+	if (tpool->tp_current == 0) {
+		/* no workers, just delete the pool */
+		pthread_mutex_unlock(&tpool->tp_mutex);
+		delete_pool(tpool);
+	} else {
+		/* wake up all workers, last one will delete the pool */
+		tpool->tp_flags |= TP_ABANDON;
+		tpool->tp_flags &= ~TP_SUSPEND;
+		(void) pthread_cond_broadcast(&tpool->tp_workcv);
+		pthread_mutex_unlock(&tpool->tp_mutex);
+	}
+}
+
+/*
+ * Wait for all jobs to complete.
+ * Calling tpool_wait() from a job in the pool will cause deadlock.
+ */
+void
+tpool_wait(tpool_t *tpool)
+{
+
+	pthread_mutex_lock(&tpool->tp_mutex);
+	pthread_cleanup_push((_Voidfp)pthread_mutex_unlock, &tpool->tp_mutex);
+	while (tpool->tp_head != NULL || tpool->tp_active != NULL) {
+		tpool->tp_flags |= TP_WAIT;
+		(void) pthread_cond_wait(&tpool->tp_waitcv, &tpool->tp_mutex);
+	}
+	pthread_cleanup_pop(1);	/* pthread_mutex_unlock(&tpool->tp_mutex); */
+}
+
+void
+tpool_suspend(tpool_t *tpool)
+{
+
+	pthread_mutex_lock(&tpool->tp_mutex);
+	tpool->tp_flags |= TP_SUSPEND;
+	pthread_mutex_unlock(&tpool->tp_mutex);
+}
+
+int
+tpool_suspended(tpool_t *tpool)
+{
+	int suspended;
+
+	pthread_mutex_lock(&tpool->tp_mutex);
+	suspended = (tpool->tp_flags & TP_SUSPEND) != 0;
+	pthread_mutex_unlock(&tpool->tp_mutex);
+
+	return (suspended);
+}
+
+void
+tpool_resume(tpool_t *tpool)
+{
+	int excess;
+
+	pthread_mutex_lock(&tpool->tp_mutex);
+	if (!(tpool->tp_flags & TP_SUSPEND)) {
+		pthread_mutex_unlock(&tpool->tp_mutex);
+		return;
+	}
+	tpool->tp_flags &= ~TP_SUSPEND;
+	(void) pthread_cond_broadcast(&tpool->tp_workcv);
+	excess = tpool->tp_njobs - tpool->tp_idle;
+	while (excess-- > 0 && tpool->tp_current < tpool->tp_maximum) {
+		if (create_worker(tpool) != 0)
+			break;		/* pthread_create() failed */
+		tpool->tp_current++;
+	}
+	pthread_mutex_unlock(&tpool->tp_mutex);
+}
+
+int
+tpool_member(tpool_t *tpool)
+{
+	pthread_t my_tid = pthread_self();
+	tpool_active_t *activep;
+
+	pthread_mutex_lock(&tpool->tp_mutex);
+	for (activep = tpool->tp_active; activep; activep = activep->tpa_next) {
+		if (activep->tpa_tid == my_tid) {
+			pthread_mutex_unlock(&tpool->tp_mutex);
+			return (1);
+		}
+	}
+	pthread_mutex_unlock(&tpool->tp_mutex);
+	return (0);
+}


Property changes on: trunk/cddl/compat/opensolaris/misc/thread_pool.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/cddl/compat/opensolaris/misc/thread_pool_impl.h
===================================================================
--- trunk/cddl/compat/opensolaris/misc/thread_pool_impl.h	                        (rev 0)
+++ trunk/cddl/compat/opensolaris/misc/thread_pool_impl.h	2018-06-02 16:08:04 UTC (rev 10231)
@@ -0,0 +1,100 @@
+/* $MidnightBSD$ */
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * $FreeBSD: stable/10/cddl/compat/opensolaris/misc/thread_pool_impl.h 266612 2014-05-24 10:44:40Z mav $
+ */
+
+#ifndef _THREAD_POOL_IMPL_H
+#define	_THREAD_POOL_IMPL_H
+
+#pragma ident	"%Z%%M%	%I%	%E% SMI"
+
+#include <thread_pool.h>
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+/*
+ * Thread pool implementation definitions.
+ * See <thread_pool.h> for interface declarations.
+ */
+
+/*
+ * FIFO queued job
+ */
+typedef struct tpool_job tpool_job_t;
+struct tpool_job {
+	tpool_job_t	*tpj_next;		/* list of jobs */
+	void		(*tpj_func)(void *);	/* function to call */
+	void		*tpj_arg;		/* its argument */
+};
+
+/*
+ * List of active threads, linked through their stacks.
+ */
+typedef struct tpool_active tpool_active_t;
+struct tpool_active {
+	tpool_active_t	*tpa_next;	/* list of active threads */
+	pthread_t	tpa_tid;	/* active thread id */
+};
+
+/*
+ * The thread pool.
+ */
+struct tpool {
+	tpool_t		*tp_forw;	/* circular list of all thread pools */
+	tpool_t		*tp_back;
+	mutex_t		tp_mutex;	/* protects the pool data */
+	cond_t		tp_busycv;	/* synchronization in tpool_dispatch */
+	cond_t		tp_workcv;	/* synchronization with workers */
+	cond_t		tp_waitcv;	/* synchronization in tpool_wait() */
+	tpool_active_t	*tp_active;	/* threads performing work */
+	tpool_job_t	*tp_head;	/* FIFO job queue */
+	tpool_job_t	*tp_tail;
+	pthread_attr_t	tp_attr;	/* attributes of the workers */
+	int		tp_flags;	/* see below */
+	uint_t		tp_linger;	/* seconds before idle workers exit */
+	int		tp_njobs;	/* number of jobs in job queue */
+	int		tp_minimum;	/* minimum number of worker threads */
+	int		tp_maximum;	/* maximum number of worker threads */
+	int		tp_current;	/* current number of worker threads */
+	int		tp_idle;	/* number of idle workers */
+};
+
+/* tp_flags */
+#define	TP_WAIT		0x01		/* waiting in tpool_wait() */
+#define	TP_SUSPEND	0x02		/* pool is being suspended */
+#define	TP_DESTROY	0x04		/* pool is being destroyed */
+#define	TP_ABANDON	0x08		/* pool is abandoned (auto-destroy) */
+
+#ifdef	__cplusplus
+}
+#endif
+
+#endif /* _THREAD_POOL_IMPL_H */


Property changes on: trunk/cddl/compat/opensolaris/misc/thread_pool_impl.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/cddl/compat/opensolaris/misc/zmount.c
===================================================================
--- trunk/cddl/compat/opensolaris/misc/zmount.c	2018-06-02 16:07:40 UTC (rev 10230)
+++ trunk/cddl/compat/opensolaris/misc/zmount.c	2018-06-02 16:08:04 UTC (rev 10231)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2006 Pawel Jakub Dawidek <pjd at FreeBSD.org>
  * All rights reserved.
@@ -29,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/cddl/compat/opensolaris/misc/zmount.c 326327 2017-11-28 17:30:25Z asomers $");
 
 #include <sys/param.h>
 #include <sys/mount.h>
@@ -74,7 +75,7 @@
     char *dataptr, int datalen, char *optptr, int optlen)
 {
 	struct iovec *iov;
-	char *optstr, *os, *p;
+	char *optstr, *os, *p, *tofree;
 	int iovlen, rv;
 
 	assert(spec != NULL);
@@ -87,7 +88,7 @@
 	assert(optptr != NULL);
 	assert(optlen > 0);
 
-	optstr = strdup(optptr);
+	tofree = optstr = strdup(optptr);
 	assert(optstr != NULL);
 
 	iov = NULL;
@@ -98,11 +99,9 @@
 	build_iovec(&iov, &iovlen, "fspath", __DECONST(char *, dir),
 	    (size_t)-1);
 	build_iovec(&iov, &iovlen, "from", __DECONST(char *, spec), (size_t)-1);
-	for (p = optstr; p != NULL; strsep(&p, ",/ ")) {
-		if (*p != '\0')
-			build_iovec(&iov, &iovlen, p, NULL, (size_t)-1);
-	}
+	while ((p = strsep(&optstr, ",/")) != NULL)
+		build_iovec(&iov, &iovlen, p, NULL, (size_t)-1);
 	rv = nmount(iov, iovlen, 0);
-	free(optstr);
+	free(tofree);
 	return (rv);
 }

Modified: trunk/cddl/compat/opensolaris/misc/zone.c
===================================================================
--- trunk/cddl/compat/opensolaris/misc/zone.c	2018-06-02 16:07:40 UTC (rev 10230)
+++ trunk/cddl/compat/opensolaris/misc/zone.c	2018-06-02 16:08:04 UTC (rev 10231)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2007 Pawel Jakub Dawidek <pjd at FreeBSD.org>
  * All rights reserved.
@@ -23,7 +24,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/cddl/compat/opensolaris/misc/zone.c 185029 2008-11-17 20:49:29Z pjd $
  */
 
 #include <stdlib.h>



More information about the Midnightbsd-cvs mailing list