* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
//config:config STAT
-//config: bool "stat"
+//config: bool "stat (10 kb)"
//config: default y
//config: help
-//config: display file or filesystem status.
+//config: display file or filesystem status.
//config:
//config:config FEATURE_STAT_FORMAT
//config: bool "Enable custom formats (-c)"
//config: default y
//config: depends on STAT
//config: help
-//config: Without this, stat will not support the '-c format' option where
-//config: users can pass a custom format string for output. This adds about
-//config: 7k to a nonstatic build on amd64.
+//config: Without this, stat will not support the '-c format' option where
+//config: users can pass a custom format string for output. This adds about
+//config: 7k to a nonstatic build on amd64.
//config:
//config:config FEATURE_STAT_FILESYSTEM
//config: bool "Enable display of filesystem status (-f)"
//config: depends on STAT
//config: select PLATFORM_LINUX # statfs()
//config: help
-//config: Without this, stat will not support the '-f' option to display
-//config: information about filesystem status.
+//config: Without this, stat will not support the '-f' option to display
+//config: information about filesystem status.
+//applet:IF_STAT(APPLET_NOEXEC(stat, stat, BB_DIR_BIN, BB_SUID_DROP, stat))
+
+//kbuild:lib-$(CONFIG_STAT) += stat.o
//usage:#define stat_trivial_usage
//usage: "[OPTIONS] FILE..."
/* coreutils 6.3 compat: */
/*static char buf[sizeof("YYYY-MM-DD HH:MM:SS.000000000")] ALIGN1;*/
-#define buf bb_common_bufsiz1
-#define sizeof_buf COMMON_BUFSIZE
-
- strcpy(strftime_YYYYMMDDHHMMSS(buf, sizeof_buf, &t), ".000000000");
+#define buf bb_common_bufsiz1
+ setup_common_bufsiz();
+ strcpy(strftime_YYYYMMDDHHMMSS(buf, COMMON_BUFSIZE, &t), ".000000000");
return buf;
#undef buf
}
{ 0x52654973, "reiserfs" },
{ 0x28cd3d45, "cramfs" },
{ 0x7275, "romfs" },
- { 0x858458f6, "romfs" },
+ { 0x858458f6, "ramfs" },
{ 0x73717368, "squashfs" },
{ 0x62656572, "sysfs" },
{ 0, "UNKNOWN" }
IF_FEATURE_STAT_FORMAT(char *format = NULL;)
int i;
int ok;
- unsigned opts;
statfunc_ptr statfunc = do_stat;
+#if ENABLE_FEATURE_STAT_FILESYSTEM || ENABLE_SELINUX
+ unsigned opts;
- opt_complementary = "-1"; /* min one arg */
- opts = getopt32(argv, "tL"
+ opts =
+#endif
+ getopt32(argv, "^"
+ "tL"
IF_FEATURE_STAT_FILESYSTEM("f")
IF_SELINUX("Z")
- IF_FEATURE_STAT_FORMAT("c:", &format)
+ IF_FEATURE_STAT_FORMAT("c:")
+ "\0" "-1" /* min one arg */
+ IF_FEATURE_STAT_FORMAT(,&format)
);
#if ENABLE_FEATURE_STAT_FILESYSTEM
if (opts & OPT_FILESYS) /* -f */