wok-current annotate busybox/stuff/busybox-1.27-arch.u @ rev 23513
busybox: musl & diet may fail
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Apr 06 11:53:42 2020 +0200 (2020-04-06) |
parents | |
children |
rev | line source |
---|---|
pascal@20235 | 1 --- busybox-1.27.2/coreutils/uname.c.org |
pascal@20235 | 2 +++ busybox-1.27.2/coreutils/uname.c |
pascal@20235 | 3 @@ -55,10 +55,18 @@ |
pascal@20235 | 4 //config: help |
pascal@20235 | 5 //config: Sets the operating system name reported by uname -o. The |
pascal@20235 | 6 //config: default is "GNU/Linux". |
pascal@20235 | 7 +//config: |
pascal@20235 | 8 +//config:config ARCH_ALIAS |
pascal@20235 | 9 +//config: bool "arch alias" |
pascal@20235 | 10 +//config: default y |
pascal@20235 | 11 +//config: help |
pascal@20235 | 12 +//config: arch is an alias to uname -m. |
pascal@20235 | 13 |
pascal@20235 | 14 -//applet:IF_UNAME(APPLET(uname, BB_DIR_BIN, BB_SUID_DROP)) |
pascal@20235 | 15 +//applet:IF_UNAME(APPLET_NOEXEC(uname, uname, BB_DIR_BIN, BB_SUID_DROP, uname)) |
pascal@20235 | 16 +//applet:IF_ARCH_ALIAS(APPLET_NOEXEC(arch, uname, BB_DIR_BIN, BB_SUID_DROP, arch)) |
pascal@20235 | 17 |
pascal@20235 | 18 //kbuild:lib-$(CONFIG_UNAME) += uname.o |
pascal@20235 | 19 +//kbuild:lib-$(CONFIG_ARCH_ALIAS) += uname.o |
pascal@20235 | 20 |
pascal@20235 | 21 /* BB_AUDIT SUSv3 compliant */ |
pascal@20235 | 22 /* http://www.opengroup.org/onlinepubs/007904975/utilities/uname.html */ |
pascal@20235 | 23 @@ -80,6 +88,11 @@ |
pascal@20235 | 24 //usage:#define uname_example_usage |
pascal@20235 | 25 //usage: "$ uname -a\n" |
pascal@20235 | 26 //usage: "Linux debian 2.4.23 #2 Tue Dec 23 17:09:10 MST 2003 i686 GNU/Linux\n" |
pascal@20235 | 27 +//usage: |
pascal@20235 | 28 +//usage:#define arch_trivial_usage |
pascal@20235 | 29 +//usage: |
pascal@20235 | 30 +//usage:#define arch_full_usage "\n\n" |
pascal@20235 | 31 +//usage: "arch is an alias for uname -m" |
pascal@20235 | 32 |
pascal@20235 | 33 #include "libbb.h" |
pascal@20235 | 34 /* After libbb.h, since it needs sys/types.h on some systems */ |
pascal@20235 | 35 @@ -147,6 +160,12 @@ |
pascal@20235 | 36 toprint = 1; |
pascal@20235 | 37 } |
pascal@20235 | 38 |
pascal@20235 | 39 + if (ENABLE_ARCH_ALIAS |
pascal@20235 | 40 + && (!ENABLE_UNAME || !applet_name[4]) |
pascal@20235 | 41 + ) { /* we are "arch" */ |
pascal@20235 | 42 + toprint = (1 << 4); |
pascal@20235 | 43 + } |
pascal@20235 | 44 + |
pascal@20235 | 45 uname(&uname_info.name); /* never fails */ |
pascal@20235 | 46 |
pascal@20235 | 47 #if defined(__sparc__) && defined(__linux__) |