diff options
author | Jennifer Averett <jennifer.averett@oarcorp.com> | 2012-04-18 14:10:44 -0500 |
---|---|---|
committer | Jennifer Averett <jennifer.averett@oarcorp.com> | 2012-04-18 14:10:44 -0500 |
commit | a2ec3326e32db9a4a5a9661e15637b485f1855f1 (patch) | |
tree | 63f3bafc97c83818f9b654cbc439c5d224de09b6 /freebsd | |
parent | Commented out calls to pin and unpin. (diff) | |
download | rtems-libbsd-a2ec3326e32db9a4a5a9661e15637b485f1855f1.tar.bz2 |
Merged the rtems version of resource back to kern_resource and added method to resolve linker errors.
Diffstat (limited to 'freebsd')
-rw-r--r-- | freebsd/kern/kern_resource.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/freebsd/kern/kern_resource.c b/freebsd/kern/kern_resource.c index 790403a0..939a1d24 100644 --- a/freebsd/kern/kern_resource.c +++ b/freebsd/kern/kern_resource.c @@ -69,12 +69,14 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_PLIMIT, "plimit", "plimit structures"); +#endif /* __rtems__ */ static MALLOC_DEFINE(M_UIDINFO, "uidinfo", "uidinfo structures"); #define UIHASH(uid) (&uihashtbl[(uid) & uihash]) static struct rwlock uihashtbl_lock; static LIST_HEAD(uihashhead, uidinfo) *uihashtbl; static u_long uihash; /* size of hash table - 1 */ +#ifndef __rtems__ static void calcru1(struct proc *p, struct rusage_ext *ruxp, struct timeval *up, struct timeval *sp); static int donice(struct thread *td, struct proc *chgp, int n); @@ -1140,6 +1142,7 @@ 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. @@ -1148,12 +1151,21 @@ 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'. @@ -1169,6 +1181,7 @@ lim_rlimit(struct proc *p, int which, struct rlimit *rlp) if (p->p_sysent->sv_fixlimit != NULL) p->p_sysent->sv_fixlimit(rlp, which); } +#endif /* __rtems__ */ /* * Find the uidinfo structure for a uid. This structure is used to @@ -1304,6 +1317,7 @@ uifree(uip) rw_wunlock(&uihashtbl_lock); } +#ifndef __rtems__ /* * Change the count associated with number of processes * a given user is using. When 'max' is 0, don't enforce a limit |