diff options
author | Darik Horn <[email protected]> | 2011-06-20 14:53:56 -0500 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2011-06-24 09:58:03 -0700 |
commit | 0d54dcb56685ac58e68e46b7848f0f2c2863dc6e (patch) | |
tree | 2bd206a88dfe78b862361c6afc456ff2f3d5c1fa /include/sys | |
parent | bf0c60c060ac58c9bb835cb62b49f0cb68bb68e4 (diff) |
Read the /etc/hostid file directly.
Deprecate the /usr/bin/hostid call by reading the /etc/hostid file
directly. Add the spl_hostid_path parameter to override the default
/etc/hostid path.
Rename the set_hostid() function to hostid_exec() to better reflect
actual behavior and complement the new hostid_read() function.
Use HW_INVALID_HOSTID as the spl_hostid sentinel value because
zero seems to be a valid gethostid() result on Linux.
Diffstat (limited to 'include/sys')
-rw-r--r-- | include/sys/systeminfo.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/sys/systeminfo.h b/include/sys/systeminfo.h index 592d71584..a32f7142e 100644 --- a/include/sys/systeminfo.h +++ b/include/sys/systeminfo.h @@ -30,4 +30,8 @@ /* to hold a decimal or hex */ /* hostid string */ +/* Supplemental definitions for Linux. */ +#define HW_HOSTID_PATH "/etc/hostid" /* binary configuration file */ +#define HW_HOSTID_MASK 0xFFFFFFFF /* significant hostid bits */ + #endif /* SPL_SYSTEMINFO_H */ |