EFAULT A pointer argument points to a location outside the
accessible address space.
EINVAL The value specified in resource is not valid; or, for
setrlimit() or prlimit(): rlim->rlim_cur was greater than
rlim->rlim_max.
EPERM An unprivileged process tried to raise the hard limit; the
CAP_SYS_RESOURCE capability is required to do this.
EPERM The caller tried to increase the hard RLIMIT_NOFILE limit
above the maximum defined by /proc/sys/fs/nr_open (see
proc(5))
EPERM (prlimit()) The calling process did not have permission to
set limits for the process specified by pid.
ESRCH Could not find a process with the ID specified in pid.