A process can have multiple forked childs. It is an often used method (e.g. for web servers like Apache).
There is no specific limit for the number of child processes. There is only a limit for the number of processes for each user. You can get that limit on the command line by typing
ulimit -u
To get the value by code, use
getrlimit()[
^] with resource
RLIMIT_NPROC
:
Quote:
RLIMIT_NPROC
The maximum number of processes (or, more precisely on Linux,
threads) that can be created for the real user ID of the
calling process. Upon encountering this limit, fork(2) fails
with the error EAGAIN. This limit is not enforced for
processes that have either the CAP_SYS_ADMIN or the
CAP_SYS_RESOURCE capability.