MCPcopy Create free account
hub / github.com/coreutils/coreutils / specify_nthreads

Function specify_nthreads

src/sort.c:1547–1561  ·  view source on GitHub ↗

Specify the number of threads to spawn during internal sort. */

Source from the content-addressed store, hash-verified

1545
1546/* Specify the number of threads to spawn during internal sort. */
1547static size_t
1548specify_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. */
1564static size_t

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected