Specify the number of threads to spawn during internal sort. */
| 1545 | |
| 1546 | /* Specify the number of threads to spawn during internal sort. */ |
| 1547 | static size_t |
| 1548 | specify_nthreads (int oi, char c, char const *s) |
| 1549 | { |
| 1550 | uintmax_t nthreads; |
| 1551 | enum strtol_error e = xstrtoumax (s, NULL, 10, &nthreads, ""); |
| 1552 | if (e == LONGINT_OVERFLOW) |
| 1553 | return SIZE_MAX; |
| 1554 | if (e != LONGINT_OK) |
| 1555 | xstrtol_fatal (e, oi, c, long_options, s); |
| 1556 | if (SIZE_MAX < nthreads) |
| 1557 | nthreads = SIZE_MAX; |
| 1558 | if (nthreads == 0) |
| 1559 | error (SORT_FAILURE, 0, _("number in parallel must be nonzero")); |
| 1560 | return nthreads; |
| 1561 | } |
| 1562 | |
| 1563 | /* Return the default sort size. */ |
| 1564 | static size_t |