Use gethostid in the Linux convention.
authorDarik Horn <dajhorn@vanadac.com>
Mon, 25 Apr 2011 15:18:07 +0000 (10:18 -0500)
committerDarik Horn <dajhorn@vanadac.com>
Mon, 25 Apr 2011 15:36:17 +0000 (10:36 -0500)
commit492b8e9e7b6f3df55eed04f7288db6b62c17c668
treed2d497ddd77b93bbd816e8c4a8ccd9ffd8bea9dc
parenta1cc0b3290dcf1b5cf759c89352d8bdb44ee41e6
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.
cmd/zpool/zpool_main.c
lib/libspl/include/unistd.h
lib/libzfs/libzfs_status.c