* Copyright (c) 1982, 1986 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
* @(#)kern_resource.c 7.5 (Berkeley) %G%
* Resource controls and accounting.
} *uap
= (struct a
*)u
.u_ap
;
register int low
= PRIO_MAX
+ 1;
register struct pgrp
*pg
;
else if ((pg
= pgfind(uap
->who
)) == NULL
)
for (p
= pg
->pg_mem
; p
!= NULL
; p
= p
->p_pgrpnxt
) {
for (p
= allproc
; p
!= NULL
; p
= p
->p_nxt
) {
if (p
->p_uid
== uap
->who
&&
if (low
== PRIO_MAX
+ 1) {
} *uap
= (struct a
*)u
.u_ap
;
register struct pgrp
*pg
;
else if ((pg
= pgfind(uap
->who
)) == NULL
)
for (p
= pg
->pg_mem
; p
!= NULL
; p
= p
->p_pgrpnxt
) {
for (p
= allproc
; p
!= NULL
; p
= p
->p_nxt
)
if (p
->p_uid
== uap
->who
) {
if (u
.u_uid
&& u
.u_ruid
&&
u
.u_uid
!= p
->p_uid
&& u
.u_ruid
!= p
->p_uid
) {
if (n
< p
->p_nice
&& suser(u
.u_cred
, &u
.u_acflag
)) {
} *uap
= (struct a
*)u
.u_ap
;
register struct rlimit
*alimp
;
if (uap
->which
>= RLIM_NLIMITS
) {
alimp
= &u
.u_rlimit
[uap
->which
];
u
.u_error
= copyin((caddr_t
)uap
->lim
, (caddr_t
)&alim
,
if (alim
.rlim_cur
> alimp
->rlim_max
|| alim
.rlim_max
> alimp
->rlim_max
)
if (u
.u_error
= suser(u
.u_cred
, &u
.u_acflag
))
if (alim
.rlim_cur
> maxdmap
)
if (alim
.rlim_max
> maxdmap
)
if (alim
.rlim_cur
> maxdmap
)
if (alim
.rlim_max
> maxdmap
)
if (uap
->which
== RLIMIT_RSS
)
u
.u_procp
->p_maxrss
= alim
.rlim_cur
/NBPG
;
} *uap
= (struct a
*)u
.u_ap
;
if (uap
->which
>= RLIM_NLIMITS
) {
u
.u_error
= copyout((caddr_t
)&u
.u_rlimit
[uap
->which
], (caddr_t
)uap
->rlp
,
} *uap
= (struct a
*)u
.u_ap
;
register struct rusage
*rup
;
u
.u_error
= copyout((caddr_t
)rup
, (caddr_t
)uap
->rusage
,
register struct rusage
*ru
, *ru2
;
timevaladd(&ru
->ru_utime
, &ru2
->ru_utime
);
timevaladd(&ru
->ru_stime
, &ru2
->ru_stime
);
if (ru
->ru_maxrss
< ru2
->ru_maxrss
)
ru
->ru_maxrss
= ru2
->ru_maxrss
;
ip
= &ru
->ru_first
; ip2
= &ru2
->ru_first
;
for (i
= &ru
->ru_last
- &ru
->ru_first
; i
> 0; i
--)