[Bug 5216] 1.20 ps lacks -w and -l options for DESKTOP case

bugzilla at busybox.net bugzilla at busybox.net
Fri May 18 01:04:45 UTC 2012


https://bugs.busybox.net/show_bug.cgi?id=5216

--- Comment #1 from Denys Vlasenko <vda.linux at googlemail.com> 2012-05-18 01:04:45 UTC ---
(In reply to comment #0)
> In commit 8d9ac30572818bbe78ef08d6580308e013972df3, CONFIG_FEATURE_PS_WIDE
> (together with newly introduced CONFIG_FEATURE_PS_LONG) has been made dependent
> on !CONFIG_DESKTOP.  I think the condition meant to be reverse, ie, to depend
> on CONFIG_DESKTOP.

No, in fact we have two different ps implementations, one for DESKTOP, another
for !DESKTOP :(

> Because as the result, -w and -l options are NOT available
> on "desktop" configuration where they should be enabled

DESKTOP one does accept a whole slew of options, but most are ignored:

        // POSIX:
        // -a  Write information for all processes associated with terminals
        //     Implementations may omit session leaders from this list
        // -A  Write information for all processes
        // -d  Write information for all processes, except session leaders
        // -e  Write information for all processes (equivalent to -A)
        // -f  Generate a full listing
        // -l  Generate a long listing
        // -o col1,col2,col3=header
        //     Select which columns to display
        /* We allow (and ignore) most of the above. FIXME.
         * -T is picked for threads (POSIX hasn't it standardized).
         * procps v3.2.7 supports -T and shows tids as SPID column,
         * it also supports -L where it shows tids as LWP column.
         */
        opt_complementary = "o::";
        opt = getopt32(argv, "Zo:aAdefl"IF_FEATURE_SHOW_THREADS("T"), &opt_o);
        if (opt_o) {
                do {
                        parse_o(llist_pop(&opt_o));
                } while (opt_o);
        } else {
#if ENABLE_SELINUX
                if (!(opt & OPT_Z) || !is_selinux_enabled()) {
                        /* no -Z or no SELinux: do not show LABEL */
                        strcpy(default_o, DEFAULT_O_STR +
sizeof(SELINUX_O_PREFIX)-1);
                } else
#endif
                {
                        strcpy(default_o, DEFAULT_O_STR);
                }
                parse_o(default_o);
        }

This else {...} block is a good place to add code which would massage default_o
for -l and/or -f prior to parse_o(), making output somewhat compatible with
procps. Want to prepare a patch?

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the busybox-cvs mailing list