summaryrefslogtreecommitdiffstats
path: root/lib/libspl/include/unistd.h
diff options
context:
space:
mode:
authorDarik Horn <[email protected]>2011-04-25 10:18:07 -0500
committerDarik Horn <[email protected]>2011-04-25 10:36:17 -0500
commit492b8e9e7b6f3df55eed04f7288db6b62c17c668 (patch)
treed2d497ddd77b93bbd816e8c4a8ccd9ffd8bea9dc /lib/libspl/include/unistd.h
parenta1cc0b3290dcf1b5cf759c89352d8bdb44ee41e6 (diff)
Use gethostid in the Linux convention.
Disable the gethostid() override for Solaris behavior because Linux systems implement the POSIX standard in a way that allows a negative result. Mask the gethostid() result to the lower four bytes, like coreutils does in /usr/bin/hostid, to prevent junk bits or sign-extension on systems that have an eight byte long type. This can cause a spurious hostid mismatch that prevents zpool import on 64-bit systems.
Diffstat (limited to 'lib/libspl/include/unistd.h')
-rw-r--r--lib/libspl/include/unistd.h10
1 files changed, 0 insertions, 10 deletions
diff --git a/lib/libspl/include/unistd.h b/lib/libspl/include/unistd.h
index 44173d2a4..dc95e28b5 100644
--- a/lib/libspl/include/unistd.h
+++ b/lib/libspl/include/unistd.h
@@ -44,14 +44,4 @@
# define issetugid() (geteuid() == 0 || getegid() == 0)
#endif
-#if !defined(__sun__) && !defined(__sun)
-/* It seems Solaris only returns positive host ids */
-static inline long fake_gethostid(void)
-{
- long id = gethostid();
- return id >= 0 ? id : -id;
-}
-#define gethostid() fake_gethostid()
-#endif
-
#endif /* _LIBSPL_UNISTD_H */