* Return a copy of the entire rlimit structure for the system limit * specified by 'which' in the rlimit structure pointed to by 'rlp'. */
| 788 | * specified by 'which' in the rlimit structure pointed to by 'rlp'. |
| 789 | */ |
| 790 | void |
| 791 | lim_rlimit(struct thread *td, int which, struct rlimit *rlp) |
| 792 | { |
| 793 | struct proc *p = td->td_proc; |
| 794 | |
| 795 | MPASS(td == curthread); |
| 796 | KASSERT(which >= 0 && which < RLIM_NLIMITS, |
| 797 | ("request for invalid resource limit")); |
| 798 | *rlp = p->p_limit->pl_rlimit[which]; |
| 799 | if (p->p_sysent->sv_fixlimit != NULL) |
| 800 | p->p_sysent->sv_fixlimit(rlp, which); |
| 801 | } |
| 802 | |
| 803 | void |
| 804 | lim_rlimit_proc(struct proc *p, int which, struct rlimit *rlp) |