From 6bce3be4a3fcb1c3b01d86ffaec2b605c692822d Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 26 Dec 2016 12:10:29 -0600 Subject: Move hostid to toys/example and have it "default n". A "globally unique 32 bit number" is a concept the Linux world has outgrown. --- toys/example/hostid.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 toys/example/hostid.c (limited to 'toys/example') diff --git a/toys/example/hostid.c b/toys/example/hostid.c new file mode 100644 index 00000000..feef61bf --- /dev/null +++ b/toys/example/hostid.c @@ -0,0 +1,23 @@ +/* hostid.c - Print the numeric identifier for the current host. + * + * Copyright 2015 Ranjan Kumar + * + * No Standard. + +USE_HOSTID(NEWTOY(hostid, ">0", TOYFLAG_USR|TOYFLAG_BIN)) + +config HOSTID + bool "hostid" + default n + help + usage: hostid + + Print the numeric identifier for the current host. +*/ +#define FOR_hostid +#include "toys.h" + +void hostid_main(void) +{ + xprintf("%08lx\n", gethostid()); +} -- cgit v1.2.3