[Toybox] ps -T -o name

enh enh at google.com
Wed May 4 17:23:45 PDT 2016


On Wed, May 4, 2016 at 4:44 PM, Rob Landley <rob at landley.net> wrote:
>
>
> On 05/04/2016 03:55 PM, enh wrote:
>> seems like a bug that if you use -o but don't include 'tid', -T becomes a no-op?
>>
>> ps -A -T | wc -l
>> ps -A -T -o name | wc -l
>
> The way I implemented it,
>
> 1) If you display tid, it fetches tid.
> 2) -T changes the default fields displayed.
>
> I'm happy to implement different behavior, I'm just not familiar with
> what it should be.

i think this is new ground, but i think i can't think of a case where
you'd want -o to disable the -T you provided earlier, especially
because it's not completely unreasonable to want to list the threads
but not want the tid.

>> should this
>>
>>   dt = dirtree_read("/proc",
>>     (TT.bits&(_PS_TID|_PS_TCNT)) ? get_threads : get_ps);
>>
>> be
>>
>>   dt = dirtree_read("/proc",
>>     ((toys.optflags&FLAG_T) || (TT.bits&(_PS_TID|_PS_TCNT))) ?
>> get_threads : get_ps);
>>
>> ?
>
> If you think that's a good idea...
>
> Committed and pushed,

thanks.

> Rob
> _______________________________________________
> Toybox mailing list
> Toybox at lists.landley.net
> http://lists.landley.net/listinfo.cgi/toybox-landley.net



-- 
Elliott Hughes - http://who/enh - http://jessies.org/~enh/
Android native code/tools questions? Mail me/drop by/add me as a reviewer.



More information about the Toybox mailing list