Avoid references to lim_cur()

This commit is contained in:
Sebastian Huber 2013-10-10 14:31:21 +02:00
parent c9db0f5ecb
commit 5003e8f88e
2 changed files with 4 additions and 10 deletions

View File

@ -1142,7 +1142,6 @@ lim_max(struct proc *p, int which)
lim_rlimit(p, which, &rl);
return (rl.rlim_max);
}
#endif /* __rtems__ */
/*
* Return the current (soft) limit for a particular system resource.
@ -1151,21 +1150,12 @@ lim_max(struct proc *p, int which)
rlim_t
lim_cur(struct proc *p, int which)
{
#ifndef __rtems__
struct rlimit rl;
lim_rlimit(p, which, &rl);
return (rl.rlim_cur);
#else
/*
* Resource limits not currently supported in RTEMS version.
* This is left for future work.
*/
return RLIM_INFINITY;
#endif /* __rtems__ */
}
#ifndef __rtems__
/*
* Return a copy of the entire rlimit structure for the system limit
* specified by 'which' in the rlimit structure pointed to by 'rlp'.

View File

@ -305,9 +305,13 @@ sbreserve_locked(struct sockbuf *sb, u_long cc, struct socket *so,
if (cc > sb_max_adj)
return (0);
if (td != NULL) {
#ifndef __rtems__
PROC_LOCK(td->td_proc);
sbsize_limit = lim_cur(td->td_proc, RLIMIT_SBSIZE);
PROC_UNLOCK(td->td_proc);
#else /* __rtems__ */
sbsize_limit = RLIM_INFINITY;
#endif /* __rtems__ */
} else
sbsize_limit = RLIM_INFINITY;
if (!chgsbsize(so->so_cred->cr_uidinfo, &sb->sb_hiwat, cc,