aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2018-12-05 13:07:39 -0800
committerElliott Hughes <enh@google.com>2018-12-05 13:07:39 -0800
commitb5744abfe5993c728b338b5f357f8af274769d9d (patch)
treeabe69188c3871ac849f9a23b08f8f464e9ba8c8d
parentced4a43b5f077f60036994a6c40e4daaec007f5e (diff)
downloadtoybox-b5744abfe5993c728b338b5f357f8af274769d9d.tar.gz
Add getconf(1), iconv(1), nproc(1), and watch(1).
Test: builds Change-Id: Ibb928136d1c4111303ca04437caac06f7ac558d2
-rw-r--r--.config8
-rw-r--r--Android.bp7
-rw-r--r--generated/config.h16
-rw-r--r--generated/flags.h32
4 files changed, 35 insertions, 28 deletions
diff --git a/.config b/.config
index 600a252f..c3bf7712 100644
--- a/.config
+++ b/.config
@@ -123,7 +123,7 @@ CONFIG_FSFREEZE=y
# CONFIG_FSYNC is not set
# CONFIG_FTPGET is not set
# CONFIG_FTPPUT is not set
-# CONFIG_GETCONF is not set
+CONFIG_GETCONF=y
CONFIG_GETENFORCE=y
CONFIG_GETFATTR=y
# CONFIG_GETPROP is not set
@@ -147,7 +147,7 @@ CONFIG_I2CDETECT=y
CONFIG_I2CDUMP=y
CONFIG_I2CGET=y
CONFIG_I2CSET=y
-# CONFIG_ICONV is not set
+CONFIG_ICONV=y
CONFIG_ID=y
CONFIG_ID_Z=y
CONFIG_IFCONFIG=y
@@ -219,7 +219,7 @@ CONFIG_NETSTAT=y
CONFIG_NICE=y
CONFIG_NL=y
CONFIG_NOHUP=y
-# CONFIG_NPROC is not set
+CONFIG_NPROC=y
CONFIG_NSENTER=y
CONFIG_OD=y
# CONFIG_ONEIT is not set
@@ -330,7 +330,7 @@ CONFIG_UUIDGEN=y
CONFIG_VCONFIG=y
# CONFIG_VI is not set
CONFIG_VMSTAT=y
-# CONFIG_WATCH is not set
+CONFIG_WATCH=y
CONFIG_WC=y
# CONFIG_WGET is not set
CONFIG_WHICH=y
diff --git a/Android.bp b/Android.bp
index d8555450..a552a06b 100644
--- a/Android.bp
+++ b/Android.bp
@@ -148,6 +148,7 @@ cc_defaults {
"toys/other/uuidgen.c",
"toys/other/vconfig.c",
"toys/other/vmstat.c",
+ "toys/other/watch.c",
"toys/other/which.c",
"toys/other/xxd.c",
"toys/other/yes.c",
@@ -185,8 +186,10 @@ cc_defaults {
"toys/posix/false.c",
"toys/posix/file.c",
"toys/posix/find.c",
+ "toys/posix/getconf.c",
"toys/posix/grep.c",
"toys/posix/head.c",
+ "toys/posix/iconv.c",
"toys/posix/id.c",
"toys/posix/kill.c",
"toys/posix/ln.c",
@@ -293,6 +296,7 @@ cc_defaults {
"flock",
"fmt",
"free",
+ "getconf",
"getenforce",
"groups",
"gunzip",
@@ -304,6 +308,7 @@ cc_defaults {
"i2cdump",
"i2cget",
"i2cset",
+ "iconv",
"id",
"ifconfig",
"inotifyd",
@@ -342,6 +347,7 @@ cc_defaults {
"nice",
"nl",
"nohup",
+ "nproc",
"nsenter",
"od",
"paste",
@@ -411,6 +417,7 @@ cc_defaults {
"uuencode",
"uuidgen",
"vmstat",
+ "watch",
"wc",
"which",
"whoami",
diff --git a/generated/config.h b/generated/config.h
index 97949ef3..b5cc9653 100644
--- a/generated/config.h
+++ b/generated/config.h
@@ -220,8 +220,8 @@
#define USE_FTPGET(...)
#define CFG_FTPPUT 0
#define USE_FTPPUT(...)
-#define CFG_GETCONF 0
-#define USE_GETCONF(...)
+#define CFG_GETCONF 1
+#define USE_GETCONF(...) __VA_ARGS__
#define CFG_GETENFORCE 1
#define USE_GETENFORCE(...) __VA_ARGS__
#define CFG_GETFATTR 1
@@ -268,8 +268,8 @@
#define USE_I2CGET(...) __VA_ARGS__
#define CFG_I2CSET 1
#define USE_I2CSET(...) __VA_ARGS__
-#define CFG_ICONV 0
-#define USE_ICONV(...)
+#define CFG_ICONV 1
+#define USE_ICONV(...) __VA_ARGS__
#define CFG_ID 1
#define USE_ID(...) __VA_ARGS__
#define CFG_ID_Z 1
@@ -412,8 +412,8 @@
#define USE_NL(...) __VA_ARGS__
#define CFG_NOHUP 1
#define USE_NOHUP(...) __VA_ARGS__
-#define CFG_NPROC 0
-#define USE_NPROC(...)
+#define CFG_NPROC 1
+#define USE_NPROC(...) __VA_ARGS__
#define CFG_NSENTER 1
#define USE_NSENTER(...) __VA_ARGS__
#define CFG_OD 1
@@ -634,8 +634,8 @@
#define USE_VI(...)
#define CFG_VMSTAT 1
#define USE_VMSTAT(...) __VA_ARGS__
-#define CFG_WATCH 0
-#define USE_WATCH(...)
+#define CFG_WATCH 1
+#define USE_WATCH(...) __VA_ARGS__
#define CFG_WC 1
#define USE_WC(...) __VA_ARGS__
#define CFG_WGET 0
diff --git a/generated/flags.h b/generated/flags.h
index 5470c1a7..e3515fc2 100644
--- a/generated/flags.h
+++ b/generated/flags.h
@@ -981,7 +981,7 @@
#undef FLAG_P
#endif
-// getconf >2al
+// getconf >2al >2al
#undef OPTSTR_getconf
#define OPTSTR_getconf ">2al"
#ifdef CLEANUP_getconf
@@ -1282,7 +1282,7 @@
#undef FLAG_f
#endif
-// iconv cst:f:
+// iconv cst:f: cst:f:
#undef OPTSTR_iconv
#define OPTSTR_iconv "cst:f:"
#ifdef CLEANUP_iconv
@@ -1969,7 +1969,7 @@
#undef FOR_nohup
#endif
-// nproc (all)
+// nproc (all) (all)
#undef OPTSTR_nproc
#define OPTSTR_nproc "(all)"
#ifdef CLEANUP_nproc
@@ -3246,7 +3246,7 @@
#undef FOR_w
#endif
-// watch ^<1n%<100=2000tebx
+// watch ^<1n%<100=2000tebx ^<1n%<100=2000tebx
#undef OPTSTR_watch
#define OPTSTR_watch "^<1n%<100=2000tebx"
#ifdef CLEANUP_watch
@@ -4198,8 +4198,8 @@
#ifndef TT
#define TT this.getconf
#endif
-#define FLAG_l (FORCED_FLAG<<0)
-#define FLAG_a (FORCED_FLAG<<1)
+#define FLAG_l (1<<0)
+#define FLAG_a (1<<1)
#endif
#ifdef FOR_getenforce
@@ -4453,10 +4453,10 @@
#ifndef TT
#define TT this.iconv
#endif
-#define FLAG_f (FORCED_FLAG<<0)
-#define FLAG_t (FORCED_FLAG<<1)
-#define FLAG_s (FORCED_FLAG<<2)
-#define FLAG_c (FORCED_FLAG<<3)
+#define FLAG_f (1<<0)
+#define FLAG_t (1<<1)
+#define FLAG_s (1<<2)
+#define FLAG_c (1<<3)
#endif
#ifdef FOR_id
@@ -5028,7 +5028,7 @@
#ifndef TT
#define TT this.nproc
#endif
-#define FLAG_all (FORCED_FLAG<<0)
+#define FLAG_all (1<<0)
#endif
#ifdef FOR_nsenter
@@ -6101,11 +6101,11 @@
#ifndef TT
#define TT this.watch
#endif
-#define FLAG_x (FORCED_FLAG<<0)
-#define FLAG_b (FORCED_FLAG<<1)
-#define FLAG_e (FORCED_FLAG<<2)
-#define FLAG_t (FORCED_FLAG<<3)
-#define FLAG_n (FORCED_FLAG<<4)
+#define FLAG_x (1<<0)
+#define FLAG_b (1<<1)
+#define FLAG_e (1<<2)
+#define FLAG_t (1<<3)
+#define FLAG_n (1<<4)
#endif
#ifdef FOR_wc