HomeFreeBSD

Use gethostid in the Linux convention.

Description

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.

Details

Provenance
Darik Horn <dajhorn@vanadac.com>Authored on Apr 25 2011, 3:18 PM
Parents
rGa1cc0b3290dc: Fix 32-bit MAXOFFSET_T definition
Branches
Unknown
Tags
Unknown

Event Timeline

Darik Horn <dajhorn@vanadac.com> committed rG492b8e9e7b6f: Use gethostid in the Linux convention. (authored by Darik Horn <dajhorn@vanadac.com>).Apr 25 2011, 3:36 PM