summaryrefslogtreecommitdiffstats
path: root/include/sys
diff options
context:
space:
mode:
authorDarik Horn <[email protected]>2011-06-20 14:53:56 -0500
committerBrian Behlendorf <[email protected]>2011-06-24 09:58:03 -0700
commit0d54dcb56685ac58e68e46b7848f0f2c2863dc6e (patch)
tree2bd206a88dfe78b862361c6afc456ff2f3d5c1fa /include/sys
parentbf0c60c060ac58c9bb835cb62b49f0cb68bb68e4 (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.h4
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 */