]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: nproc: ensure OMP_NUM_THREADS overflow is clamped
authoroech3 <79379754+oech3@users.noreply.github.com>
Sun, 14 Jun 2026 03:40:50 +0000 (12:40 +0900)
committerPádraig Brady <P@draigBrady.com>
Thu, 18 Jun 2026 15:15:26 +0000 (16:15 +0100)
* tests/nproc/nproc-override.sh: Test overflowed OMP_NUM_THREADS.
https://github.com/coreutils/coreutils/pull/292

tests/nproc/nproc-override.sh

index c740bfee85f9d9345203d753a725e14cd74d7c12..3d18f59a7bfe598b13a9667e4412f216da36c2ae 100755 (executable)
@@ -18,6 +18,7 @@
 
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
 print_ver_ nproc
+getlimits_
 
 unset OMP_NUM_THREADS
 unset OMP_THREADS_LIMIT
@@ -38,6 +39,7 @@ echo "\
  1                      2,2,1               1
  0                      2,2,1               2
  1bad                   2,2,1               2
+ -                      ${ULONG_OFLOW}      ${ULONG_MAX}
  1bad                   $(($avail+1)),2,1   $(($avail+1))
  1                      $(($avail+1))       1
  $(($avail+2))          $(($avail+1))       $(($avail+1))