From nobody@FreeBSD.org  Tue Jul 27 23:31:41 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 447B81065676
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 27 Jul 2010 23:31:41 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 198818FC1D
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 27 Jul 2010 23:31:41 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o6RNVegU024883
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 27 Jul 2010 23:31:40 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o6RNVeTm024882;
	Tue, 27 Jul 2010 23:31:40 GMT
	(envelope-from nobody)
Message-Id: <201007272331.o6RNVeTm024882@www.freebsd.org>
Date: Tue, 27 Jul 2010 23:31:40 GMT
From: Tuco <tuco.xyz@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: misc fixes for ZFS code to build on Glibc
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         149015
>Category:       kern
>Synopsis:       [zfs] [patch] misc fixes for ZFS code to build on Glibc
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-fs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 27 23:40:01 UTC 2010
>Closed-Date:    
>Last-Modified:  Wed Jul 28 02:16:12 UTC 2010
>Originator:     Tuco
>Release:        Debian GNU/kFreeBSD
>Organization:
>Environment:
>Description:

Hello

Here's a patch with a few more fixes for ZFS code to build on Glibc, which don't fall in the other categories.

>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -ur cddl/contrib/opensolaris/head/thread.h cddl/contrib/opensolaris/head/thread.h
--- cddl/contrib/opensolaris/head/thread.h	2009-07-09 16:22:05.000000000 -0400
+++ cddl/contrib/opensolaris/head/thread.h	2010-07-26 20:05:56.053037598 -0400
@@ -30,7 +30,10 @@
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
 
 #include <pthread.h>
+/* On GNU libc, non-POSIX facilities are in <pthread.h> */
+#ifndef __GLIBC__
 #include <pthread_np.h>
+#endif
 #include <assert.h>
 
 /*
diff -ur sys/cddl/compat/opensolaris/sys/sysmacros.h sys/cddl/compat/opensolaris/sys/sysmacros.h
--- sys/cddl/compat/opensolaris/sys/sysmacros.h	2009-02-28 11:21:25.000000000 -0500
+++ sys/cddl/compat/opensolaris/sys/sysmacros.h	2010-07-26 18:46:46.357213427 -0400
@@ -103,7 +103,7 @@
  * High order bit is 31 (or 63 in _LP64 kernel).
  */
 static __inline int
-highbit(ulong_t i)
+highbit(unsigned long i)
 {
 	register int h = 1;
 
diff -ur sys/cddl/compat/opensolaris/sys/time.h sys/cddl/compat/opensolaris/sys/time.h
--- sys/cddl/compat/opensolaris/sys/time.h	2008-11-17 15:49:29.000000000 -0500
+++ sys/cddl/compat/opensolaris/sys/time.h	2010-07-27 18:59:40.382806704 -0400
@@ -29,7 +29,12 @@
 #ifndef _OPENSOLARIS_SYS_TIME_H_
 #define	_OPENSOLARIS_SYS_TIME_H_
 
+/* GNU libc has <sys/time.h> but no <time.h> */
+#ifdef __GLIBC__
+#include_next <time.h>
+#else
 #include_next <sys/time.h>
+#endif
 
 #define SEC		1
 #define MILLISEC	1000
diff -ur sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c
--- sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c	2009-08-15 22:21:24.000000000 -0400
+++ sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c	2010-07-26 19:42:43.000000000 -0400
@@ -2199,11 +2199,11 @@
 	int err = 0;
 	nvstream_t nvs;
 	int nvl_endian;
-#if BYTE_ORDER == _LITTLE_ENDIAN
+#if BYTE_ORDER == LITTLE_ENDIAN
 	int host_endian = 1;
 #else
 	int host_endian = 0;
-#endif	/* _LITTLE_ENDIAN */
+#endif	/* LITTLE_ENDIAN */
 	nvs_header_t *nvh = (void *)buf;
 
 	if (buflen == NULL || nvl == NULL ||


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-fs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed Jul 28 02:15:57 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=149015 
>Unformatted:
