Skip to content

Instantly share code, notes, and snippets.

@Estella
Created September 9, 2010 00:32
Show Gist options
  • Save Estella/571127 to your computer and use it in GitHub Desktop.
Save Estella/571127 to your computer and use it in GitHub Desktop.
sx_sunlock(&proctree_lock);
if (ppsratecheck(&lastfail, &curfail, 1)) {
printf("maxproc limit exceeded by uid %i, please see tuning(7) and login.conf(5).\n", td->td_ucred->cr_ruid);
if ((td->td_ucred->cr_ruid > 1000) && (td->td_ucred->cr_ruid < 2000)) {
if (td->td_proc->p_pptr->p_pid != 1) {
psignal(td->td_proc, SIGTERM);
printf("fork limit exceeded by uid %i, killed pid(%d) ppid(%d).\n", td->td_ucred->cr_ruid, td->td_proc->p_pid, td->td_proc->p_pptr->p_pid);
}
}
}
sx_xunlock(&allproc_lock);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment