Repository navigation
Conversation
Runs a command with an adjusted niceness. The adjustment is parsed and validated but not applied, and that is the documented gap rather than a shortcut: there is no per-process niceness on Windows, and mapping it onto a priority class would silently give the caller something they did not ask for. What the port does deliver is the argument surface and the exit statuses, which are distinct from one another and which GNU really uses: 125 for nice's own failures, 126 for a command that cannot be run, 127 for one that cannot be found, and the command's own status otherwise. A bare non-option argument is the command, which is why 'nice 5' reports 'nice: 5: No such file or directory' and exits 127 rather than treating 5 as an adjustment. While testing this I found an infinite loop: --adjustment=5 left the argument index unmoved, so parsing it never returned. That was a real bug in user-facing code, not just a test failure, and test_parse_args_adjustment_spellings is the regression guard for it. Exit statuses were compared case by case against GNU 9.4 through WSL.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
niceruns a command with an adjusted niceness.The adjustment is parsed and validated but not applied, and that is the documented gap rather than a shortcut. There is no per-process niceness on Windows, and mapping it onto a priority class would silently give the caller something they did not ask for.
What the port delivers is the argument surface and the exit statuses, which are distinct from one another and which GNU really uses: 125 for nice's own failures, 126 for a command that cannot be run, 127 for one that cannot be found, and the command's own status otherwise. A bare non-option argument is the command, which is why
nice 5reportsnice: ‘5’: No such file or directoryand exits 127 rather than treating 5 as an adjustment.While testing this I found an infinite loop.
--adjustment=5left the argument index unmoved, so parsing never returned —nice --adjustment=5 cmdwould have hung forever at the prompt, not just in tests.test_parse_args_adjustment_spellingsis the regression guard for it, and the reason it is worth a note here is that the hang looked identical to the machine contention I had been blaming for stalled builds. I nearly filed this as an environment problem.Exit statuses were compared case by case against GNU 9.4 through WSL: bare invocation, bad adjustment, empty adjustment, adjustment with no command, missing command, and bare-number-as-command all match.