Skip to content

nice: fix Windows priority class and exit status - #14937

Open
Smicry wants to merge 2 commits into
uutils:mainfrom
Smicry:fix/nice-windows-priority-class
Open

Smicry wants to merge 2 commits into
uutils:mainfrom
Smicry:fix/nice-windows-priority-class

Conversation

@Smicry

@Smicry Smicry commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Windows reports scheduling priority as one of six classes rather than a
nice value, so nice could not report the current niceness, and the
table it used to pick a class was not Cygwin's. Read the class the
current process runs at and map it with Cygwin's table in both
directions, and wait for the spawned command so that nice exits with
its status the way it does on Unix.

Closes #14484

@Smicry
Smicry marked this pull request as ready for review September 29, 2026 08:28
Comment thread tests/by-util/test_nice.rs Outdated
Comment thread tests/by-util/test_nice.rs Outdated
@xtqqczze

Copy link
Copy Markdown
Collaborator

@Smicry please squash to clean the branch commit history

@codspeed

codspeed Bot commented Sep 29, 2026

Copy link
Copy Markdown

Merging this PR will regress 1 benchmark

⚡ 2 improved benchmarks
❌ 1 regressed benchmark
✅ 390 untouched benchmarks
⏩ 54 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Simulation five_38_bit_primes 1.7 s 1.9 s -6.9%
⚡ Simulation three_39_bit_primes 1,098 ms 838.2 ms +31%
⚡ Simulation thirteen_39_bit_primes 9.6 s 8.8 s +8.41%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing Smicry:fix/nice-windows-priority-class (ee97c1a) with main (acd3d5b)2

Open in CodSpeed

Footnotes

  1. 54 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

  2. No successful run was found on main (7e94315) during the generation of this report, so acd3d5b was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@Smicry
Smicry force-pushed the fix/nice-windows-priority-class branch from ee97c1a to f570015 Compare September 29, 2026 13:24
@Smicry

Smicry commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor Author

@Smicry please squash to clean the branch commit history

done

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

GNU testsuite comparison:

Congrats! The gnu test tests/id/setgid is no longer failing!

Comment thread src/uu/nice/src/nice.rs Outdated
Windows reports scheduling priority as one of six classes rather than a
nice value, so `nice` could not report the current niceness, and the
table it used to pick a class was not Cygwin's. Read the class the
current process runs at and map it with Cygwin's table in both
directions, and wait for the spawned command so that `nice` exits with
its status the way it does on Unix.

Closes uutils#14484

Co-authored-by: xtqqczze <45661989+xtqqczze@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nice, Windows: support mapping current Priority Class

2 participants