aboutsummaryrefslogtreecommitdiff
path: root/toys/pending/hostid.c
diff options
context:
space:
mode:
authorSameer Pradhan <sameer.p.pradhan@gmail.com>2015-07-24 19:51:40 -0500
committerRob Landley <rob@landley.net>2015-07-24 19:51:40 -0500
commit441d1cedfb8dbe2c720bee791b5240829a5e54f9 (patch)
treec65a4ab84842c50ba7f474f70ee8d37b1cab03f2 /toys/pending/hostid.c
parente1937bd599077e744bd4381731ea5683c01eef09 (diff)
downloadtoybox-441d1cedfb8dbe2c720bee791b5240829a5e54f9.tar.gz
Attached are new toys.
tftp - Client for tftp daemon. hostid -Print the numeric identifier for the current host. fsync -Synchronize a file's in-core state with storage device.
Diffstat (limited to 'toys/pending/hostid.c')
-rw-r--r--toys/pending/hostid.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/toys/pending/hostid.c b/toys/pending/hostid.c
new file mode 100644
index 00000000..feef61bf
--- /dev/null
+++ b/toys/pending/hostid.c
@@ -0,0 +1,23 @@
+/* hostid.c - Print the numeric identifier for the current host.
+ *
+ * Copyright 2015 Ranjan Kumar <ranjankumar.bth@gmail.com>
+ *
+ * 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());
+}