We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2e3e66a commit 6c3142aCopy full SHA for 6c3142a
src/hostid.py
@@ -0,0 +1,26 @@
1
+#!/usr/bin/python3
2
+
3
+from optparse import OptionParser
4
5
6
+def hostid():
7
+ # We're not the only ones being lazy here... musl libc's gethostid(3)
8
+ # returns zero as well. hostid can arguably be considered as obsolete.
9
+ print("00000000")
10
11
12
+if __name__ == "__main__":
13
+ parser = OptionParser(
14
+ usage="Usage: %prog",
15
+ description="Print a 32-bit numeric host machine identifier.",
16
+ epilog="This implementation gives an all-zero identifier.",
17
+ add_help_option=False,
18
+ )
19
+ parser.add_option("--help", action="help", help="show usage information and exit")
20
21
+ _, args = parser.parse_args()
22
23
+ if args:
24
+ parser.error(f"extra operand '{args[0]}'")
25
26
+ hostid()
0 commit comments