From b9fb3067822c0a347905db81af0496743733fad5 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Fri, 24 Jul 2015 19:55:15 -0500 Subject: Promote hostid. --- toys/other/hostid.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 toys/other/hostid.c (limited to 'toys/other') diff --git a/toys/other/hostid.c b/toys/other/hostid.c new file mode 100644 index 00000000..883ac3ca --- /dev/null +++ b/toys/other/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 y + 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