Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | exec: Find ARG_MAX with binary search after E2BIG | Tavian Barnes | 2021-11-17 | 1 | -0/+2 |
| | | | | | | | | | | | | | | | | | | | | | Previously we would shrink the command by one argument at a time until a successful execution. This is okay if the ARG_MAX estimate is just a little bit off, but is terribly slow when it's off by a lot. One situation where it's very far off is when a 32-bit build of bfs launches a 64-bit binary. In this case, bfs thinks the argv pointers are 4 bytes, while they actually take up 8 bytes. The performance is quite bad: $ time ./bfs-64 ~/code/linux -exec echo {} + >/dev/null ./bfs-64 ~/code/linux -exec echo {} + > /dev/null 0.03s user 0.07s system 99% cpu 0.095 total $ time ./bfs-32 ~/code/linux -exec echo {} + >/dev/null ./bfs-32 ~/code/linux -exec echo {} + > /dev/null 0.08s user 10.33s system 100% cpu 10.390 total After this change, performance is much better: $ time ./bfs-32 ~/code/linux -exec echo {} + >/dev/null ./bfs-32 ~/code/linux -exec echo {} + > /dev/null 0.03s user 0.08s system 99% cpu 0.110 total | ||||
* | exec: Adjust some calling conventions | Tavian Barnes | 2020-10-06 | 1 | -5/+5 |
| | |||||
* | Rename struct cmdline to bfs_ctx | Tavian Barnes | 2020-09-27 | 1 | -8/+9 |
| | | | | | The API remains similar, with some added accessor functions for lazy initialization of the pwcache and mtab. | ||||
* | exec: Warn if a command dies abnormally | Tavian Barnes | 2020-03-15 | 1 | -2/+2 |
| | |||||
* | Add some documentation comments | Tavian Barnes | 2019-02-09 | 1 | -0/+4 |
| | |||||
* | exec: Don't allow anything between {} and + | Tavian Barnes | 2017-07-29 | 1 | -3/+0 |
| | | | | | | | | | POSIX explicitly forbids this extension: > Only a <plus-sign> that immediately follows an argument containing > only the two characters "{}" shall punctuate the end of the primary > expression. Other uses of the <plus-sign> shall not be treated as > special. | ||||
* | Re-license under the BSD Zero Clause License | Tavian Barnes | 2017-07-27 | 1 | -10/+15 |
| | |||||
* | Implement -D exec | Tavian Barnes | 2017-05-09 | 1 | -3/+7 |
| | |||||
* | exec: Interpret ARG_MAX corretly. | Tavian Barnes | 2017-04-15 | 1 | -1/+6 |
| | | | | Thanks to https://www.in-ulm.de/~mascheck/various/argmax/ | ||||
* | Implement -exec/-execdir ... + | Tavian Barnes | 2017-04-15 | 1 | -0/+103 |