Re: [Toybox] [PATCH] count.c: Human readable -h option and MAYFORK

2023-10-26 Thread enh via Toybox
On Tue, Oct 24, 2023 at 12:31 AM Rob Landley wrote: > > On 10/20/23 01:05, Rob Landley wrote: > >> (though i will accept the argument that "that's a toybox xargs test > >> bug", but (a) we'll still need to fix that test > > > > Any idea off the top of your head which of the 31 tests it was? (I

Re: [Toybox] [PATCH] count.c: Human readable -h option and MAYFORK

2023-10-26 Thread enh via Toybox
On Thu, Oct 19, 2023 at 11:01 PM Rob Landley wrote: > > On 10/19/23 13:20, enh wrote: > >> > if you had > >> > ``` > >> > if (which->flags & TOYFLAG_LINEBUF) setvbuf(stdout, 0, _IOLBF, 0); > >> > ``` > >> > we'd argue a lot less about buffering :-) > >> > >> The existing LINEBUF users are ascii,

Re: [Toybox] [PATCH] count.c: Human readable -h option and MAYFORK

2023-10-24 Thread Rob Landley
On 10/20/23 01:05, Rob Landley wrote: >> (though i will accept the argument that "that's a toybox xargs test >> bug", but (a) we'll still need to fix that test > > Any idea off the top of your head which of the 31 tests it was? (I can use the > git commit time to go dig back through the web

Re: [Toybox] [PATCH] count.c: Human readable -h option and MAYFORK

2023-10-21 Thread Rob Landley
On 10/20/23 01:05, Rob Landley wrote: > P.S. Count's X/s time output is actually X/period and the period is 250ms, but > it's also zeroing new periods and advancing into the zeroed period immediately > in the calculation as a full period when we've only been there for less than a > full 250ms, and

Re: [Toybox] [PATCH] count.c: Human readable -h option and MAYFORK

2023-10-20 Thread Rob Landley
On 10/19/23 13:20, enh wrote: >> > if you had >> > ``` >> > if (which->flags & TOYFLAG_LINEBUF) setvbuf(stdout, 0, _IOLBF, 0); >> > ``` >> > we'd argue a lot less about buffering :-) >> >> The existing LINEBUF users are ascii, base64, base32, yes, echo, grep, >> egrep, fgrep. > > yeah, i think

Re: [Toybox] [PATCH] count.c: Human readable -h option and MAYFORK

2023-10-19 Thread enh via Toybox
On Thu, Oct 19, 2023 at 11:10 AM Rob Landley wrote: > > On 10/18/23 12:45, enh wrote: > >> > I've reproduced your test here, albeit 1.2Mb at 260Kb/s, but it's off by > >> > the > >> > same ratio. > >> > >> Interesting: > >> > >> $ timeout 1 yes | ./count -l >/dev/null > >> Terminated bytes,

Re: [Toybox] [PATCH] count.c: Human readable -h option and MAYFORK

2023-10-19 Thread Rob Landley
On 10/18/23 12:45, enh wrote: >> > I've reproduced your test here, albeit 1.2Mb at 260Kb/s, but it's off by >> > the >> > same ratio. >> >> Interesting: >> >> $ timeout 1 yes | ./count -l >/dev/null >> Terminated bytes, 2.9Gb, 560Mb/s, 0m01s >> $ toybox timeout 1 yes | ./count -l >/dev/null >>

Re: [Toybox] [PATCH] count.c: Human readable -h option and MAYFORK

2023-10-18 Thread enh via Toybox
On Tue, Oct 17, 2023 at 10:55 PM Rob Landley wrote: > > > > On 10/18/23 00:46, Rob Landley wrote: > > On 10/17/23 16:27, Oliver Webb wrote: > >>> Let me know if I screwed stuff up this time, I've been under the weather > >>> the > >>> past few days... > >> > >> I get a -Wformat-overflow warning

Re: [Toybox] [PATCH] count.c: Human readable -h option and MAYFORK

2023-10-18 Thread enh via Toybox
On Tue, Oct 17, 2023 at 10:42 PM Rob Landley wrote: > > On 10/17/23 16:27, Oliver Webb wrote: > >> Let me know if I screwed stuff up this time, I've been under the weather > >> the > >> past few days... > > > > I get a -Wformat-overflow warning while compiling this command. > > Swapping out

Re: [Toybox] [PATCH] count.c: Human readable -h option and MAYFORK

2023-10-17 Thread Rob Landley
On 10/18/23 00:46, Rob Landley wrote: > On 10/17/23 16:27, Oliver Webb wrote: >>> Let me know if I screwed stuff up this time, I've been under the weather the >>> past few days... >> >> I get a -Wformat-overflow warning while compiling this command. >> Swapping out sprintf with snprintf gives

Re: [Toybox] [PATCH] count.c: Human readable -h option and MAYFORK

2023-10-17 Thread Rob Landley
On 10/17/23 16:27, Oliver Webb wrote: >> Let me know if I screwed stuff up this time, I've been under the weather the >> past few days... > > I get a -Wformat-overflow warning while compiling this command. > Swapping out sprintf with snprintf gives a -Wformat-truncation warning. What is the

Re: [Toybox] [PATCH] count.c: Human readable -h option and MAYFORK

2023-10-17 Thread Rob Landley
On 10/16/23 19:28, Oliver Webb wrote: >> That said, a -l long output version that has the raw number, and the human >> readable, and time, and recent/total rate, might be useful? (I'd prefer -l >> instead of -v, but same general concept.) > > I added a -l[ong] option in the below patch, It only

Re: [Toybox] [PATCH] count.c: Human readable -h option and MAYFORK

2023-10-16 Thread Oliver Webb via Toybox
--- Original Message --- On Monday, October 16th, 2023 at 05:14, Rob Landley wrote: > On 10/15/23 23:23, Oliver Webb via Toybox wrote: > > > Hey, I was looking through the command list and discovered a "count" > > command. > > > I wrote my first one of those in 1998 and couldn't

Re: [Toybox] [PATCH] count.c: Human readable -h option and MAYFORK

2023-10-16 Thread Rob Landley
On 10/15/23 23:23, Oliver Webb via Toybox wrote: > Hey, I was looking through the command list and discovered a "count" command. I wrote my first one of those in 1998 and couldn't figure out why it wasn't part of the standard unix command set. I posted it all over the place (linux-kernel, etc)

[Toybox] [PATCH] count.c: Human readable -h option and MAYFORK

2023-10-15 Thread Oliver Webb via Toybox
Hey, I was looking through the command list and discovered a "count" command. After learning what it did it reminded me of a tool called pv (Pipe viewer) which does the exact same thing with more info that I was planning to make a rudimentary implementation of in toybox. I want to add a