misc/149015: misc fixes for ZFS code to build on Glibc
Tuco
tuco.xyz at gmail.com
Tue Jul 27 23:40:02 UTC 2010
>Number: 149015
>Category: misc
>Synopsis: misc fixes for ZFS code to build on Glibc
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>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:
>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:
>Unformatted:
More information about the freebsd-bugs
mailing list