Deleted Added
sdiff udiff text old ( 96886 ) new ( 99012 )
full compact
1/*-
2 * Copyright (c) 1982, 1986, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

--- 22 unchanged lines hidden (view full) ---

31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)kern_resource.c 8.5 (Berkeley) 1/21/94
39 * $FreeBSD: head/sys/kern/kern_resource.c 96886 2002-05-19 00:14:50Z jhb $
40 */
41
42#include "opt_compat.h"
43
44#include <sys/param.h>
45#include <sys/systm.h>
46#include <sys/sysproto.h>
47#include <sys/file.h>

--- 373 unchanged lines hidden (view full) ---

421osetrlimit(td, uap)
422 struct thread *td;
423 register struct osetrlimit_args *uap;
424{
425 struct orlimit olim;
426 struct rlimit lim;
427 int error;
428
429 if ((error =
430 copyin((caddr_t)uap->rlp, (caddr_t)&olim, sizeof(struct orlimit))))
431 return (error);
432 lim.rlim_cur = olim.rlim_cur;
433 lim.rlim_max = olim.rlim_max;
434 mtx_lock(&Giant);
435 error = dosetrlimit(td, uap->which, &lim);
436 mtx_unlock(&Giant);
437 return (error);
438}

--- 21 unchanged lines hidden (view full) ---

460 return (EINVAL);
461 mtx_lock(&Giant);
462 olim.rlim_cur = p->p_rlimit[uap->which].rlim_cur;
463 if (olim.rlim_cur == -1)
464 olim.rlim_cur = 0x7fffffff;
465 olim.rlim_max = p->p_rlimit[uap->which].rlim_max;
466 if (olim.rlim_max == -1)
467 olim.rlim_max = 0x7fffffff;
468 error = copyout((caddr_t)&olim, (caddr_t)uap->rlp, sizeof(olim));
469 mtx_unlock(&Giant);
470 return (error);
471}
472#endif /* COMPAT_43 || COMPAT_SUNOS */
473
474#ifndef _SYS_SYSPROTO_H_
475struct __setrlimit_args {
476 u_int which;

--- 7 unchanged lines hidden (view full) ---

484int
485setrlimit(td, uap)
486 struct thread *td;
487 register struct __setrlimit_args *uap;
488{
489 struct rlimit alim;
490 int error;
491
492 if ((error =
493 copyin((caddr_t)uap->rlp, (caddr_t)&alim, sizeof (struct rlimit))))
494 return (error);
495 mtx_lock(&Giant);
496 error = dosetrlimit(td, uap->which, &alim);
497 mtx_unlock(&Giant);
498 return (error);
499}
500
501int

--- 118 unchanged lines hidden (view full) ---

620 register struct __getrlimit_args *uap;
621{
622 int error;
623 struct proc *p = td->td_proc;
624
625 if (uap->which >= RLIM_NLIMITS)
626 return (EINVAL);
627 mtx_lock(&Giant);
628 error = copyout((caddr_t)&p->p_rlimit[uap->which], (caddr_t)uap->rlp,
629 sizeof (struct rlimit));
630 mtx_unlock(&Giant);
631 return(error);
632}
633
634/*
635 * Transform the running time and tick information in proc p into user,
636 * system, and interrupt time usage.

--- 137 unchanged lines hidden (view full) ---

774
775 default:
776 rup = NULL;
777 error = EINVAL;
778 break;
779 }
780 mtx_unlock(&Giant);
781 if (error == 0) {
782 error = copyout((caddr_t)rup, (caddr_t)uap->rusage,
783 sizeof (struct rusage));
784 }
785 return(error);
786}
787
788void
789ruadd(ru, ru2)
790 register struct rusage *ru, *ru2;
791{

--- 229 unchanged lines hidden ---