> +/* Lower NMERGE if necessary, to fit within operating system limits. */
> +static void
> +lower_nmerge_if_necessary (void)
> +{
> + /* How many file descriptors are needed per input and output file. */
> + int fds_per_file = (compress_program ? 3 : 1);
> +
> + /* How many file descriptors we think we'll need, total. It
> + obviously can't exceed INT_MAX. */
> + int fds_needed = (nmerge <= INT_MAX / fds_per_file - 1
> + ? (nmerge + 1) * fds_per_file
> + : INT_MAX);
would RLIMIT_NOFILE be a better limit than INT_MAX if available?
cheers,
Pádraig.
_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils