From fd49d56c459dea8dc1a436a55d8092f9668b9848 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Tue, 8 Oct 2019 14:35:50 -0500 Subject: Add arch command. --- toys/posix/uname.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'toys/posix') diff --git a/toys/posix/uname.c b/toys/posix/uname.c index a1338415..d93fc7a3 100644 --- a/toys/posix/uname.c +++ b/toys/posix/uname.c @@ -5,6 +5,15 @@ * See http://opengroup.org/onlinepubs/9699919799/utilities/uname.html USE_UNAME(NEWTOY(uname, "oamvrns[+os]", TOYFLAG_BIN)) +USE_ARCH(NEWTOY(arch, 0, TOYFLAG_USR|TOYFLAG_BIN)) + +config ARCH + bool "arch" + default y + help + usage: arch + + Print machine (hardware) name, same as uname -m. config UNAME bool "uname" @@ -23,6 +32,7 @@ config UNAME */ #define FOR_uname +#define FORCE_FLAGS #include "toys.h" // If a 32 bit x86 build environment working in a chroot under an x86-64 @@ -72,3 +82,9 @@ void uname_main(void) } putchar('\n'); } + +void arch_main(void) +{ + toys.optflags = FLAG_m; + uname_main(); +} -- cgit v1.2.3