[procps] Re: important newlib patches

  • From: Jim Warner <james.warner@xxxxxxxxxxx>
  • To: Procps-ng Mail list <procps@xxxxxxxxxxxxx>
  • Date: Mon, 7 Mar 2022 02:07:23 -0600

On 3/5/22 10:10 PM, Craig Small wrote:

I must admit I was a bit dubious about patch 6. Why does %cpu versus pcpu matter? Seriously from 3.3.0 in 2011? Surely Jim has got something strange going on here?

Hi Craig,

I just checked and this bug goes all the way back to at least the 3.2.8 version of ps (before 2002). So I killed a 2 decade old bug, yipee!

Option parsing, is so, so very easy to get wrong. Even the standard getopt and friends have issues.

The ps program covers so many variants its parsing is beyond complex. But top's implementation of getopt doesn't suffer from any of those issues, assuming it was built without that #define GETOPTFIX_NO.

Try to trip top up. He even has an option with an optional argument (-w). And arguments can use or omit the equals sign. Plus that '=' can be accompanied by leading, trailing or no spaces whatsoever.

Anyway, while I thought I was going to be uninspired for awhile I came up with the enclosed five additional patches.

Thanks in advance for the push.



ps. The newlib build system may need attention. Unlike master, I can't do a 'make dist' on a newly configured branch. I must do a vanilla 'make' first and then the 'make dist' lest I get a po4a error.

pps. I moved the %CUU field so if you saved an rcfile you may need to reconfigure top.

Other related posts: