aboutsummaryrefslogtreecommitdiff
path: root/coreutils/uname.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2009-03-14 18:41:19 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2009-03-14 18:41:19 +0000
commit447ab18cf6e2a05842bab443255b0fdf0f4e598e (patch)
treedbd5aada4d7dcc4c5750e963e8308860418a99fd /coreutils/uname.c
parent3b5c9b88852b3121563dec96068bb59e32a2f4dd (diff)
downloadbusybox-w32-447ab18cf6e2a05842bab443255b0fdf0f4e598e.tar.gz
busybox-w32-447ab18cf6e2a05842bab443255b0fdf0f4e598e.tar.bz2
busybox-w32-447ab18cf6e2a05842bab443255b0fdf0f4e598e.zip
uname: support long options
Diffstat (limited to 'coreutils/uname.c')
-rw-r--r--coreutils/uname.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/coreutils/uname.c b/coreutils/uname.c
index cd0218aaf..4c3bf2f3b 100644
--- a/coreutils/uname.c
+++ b/coreutils/uname.c
@@ -73,6 +73,21 @@ static const unsigned short utsname_offset[] = {
73int uname_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 73int uname_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
74int uname_main(int argc UNUSED_PARAM, char **argv) 74int uname_main(int argc UNUSED_PARAM, char **argv)
75{ 75{
76#if ENABLE_FEATURE_UNEXPAND_LONG_OPTIONS
77 static const char longopts[] ALIGN1 =
78 /* name, has_arg, val */
79 "all\0" No_argument "a"
80 "kernel-name\0" No_argument "s"
81 "nodename\0" No_argument "n"
82 "kernel-release\0" No_argument "r"
83 "release\0" No_argument "r"
84 "kernel-version\0" No_argument "v"
85 "machine\0" No_argument "m"
86 "processor\0" No_argument "p"
87 "hardware-platform\0" No_argument "i"
88 "operating-system\0" No_argument "o"
89 ;
90#endif
76 uname_info_t uname_info; 91 uname_info_t uname_info;
77#if defined(__sparc__) && defined(__linux__) 92#if defined(__sparc__) && defined(__linux__)
78 char *fake_sparc = getenv("FAKE_SPARC"); 93 char *fake_sparc = getenv("FAKE_SPARC");
@@ -82,6 +97,7 @@ int uname_main(int argc UNUSED_PARAM, char **argv)
82 const unsigned short *delta; 97 const unsigned short *delta;
83 unsigned toprint; 98 unsigned toprint;
84 99
100 USE_FEATURE_UNEXPAND_LONG_OPTIONS(applet_long_options = longopts);
85 toprint = getopt32(argv, options); 101 toprint = getopt32(argv, options);
86 102
87 if (argv[optind]) { /* coreutils-6.9 compat */ 103 if (argv[optind]) { /* coreutils-6.9 compat */