SuSE Enterprise Linux uses RLIMIT_NPROC and _SC_CHILD_MAX interchangably.
This causes problems when setting RLIMIT_NPROC to RLIM_INFINITY due
to a bug in bash where bash tries to honor the value of _SC_CHILD_MAX
but treats a value of -1 as an error, and uses a default value of
32 instead.
Previously, we just checked RLIMIT_NPROC and, if it was unlimited,
restored the previous value of RLIMIT_NPROC. However, that makes
it impossible to set nproc to unlimited. We now only restore the
nproc resource limit if sysconf(_SC_CHILD_MAX) is negative. In
most cases, pam_limits will set RLIMIT_NPROC for us.