Subject: getrlimit
From: [email-masked] (Fabio Somenzi)

2 Dec 1996 19:24:40 -0800
Sender: [email-masked]
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Original-To: [email-masked]
Original-Sender: [email-masked]

If I'm not mistaken, there is not getrlimit and no ulimit in beta 16.
Is this going to change in beta 17?  Maybe a trivial implementation that
always returns RLIM_INFINITY like the one below would be better than
not having getrlimit at all.

Fabio

#include <errno.h>
#include <sys/time.h>
#include <sys/resource.h>

int getrlimit(int resource, struct rlimit *rlim)
{
    switch (resource) {
      case RLIMIT_CPU:
      case RLIMIT_FSIZE:
      case RLIMIT_DATA:
      case RLIMIT_STACK:
      case RLIMIT_CORE:
      case RLIMIT_RSS:
      case RLIMIT_MEMLOCK:
      case RLIMIT_NPROC:
      case RLIMIT_OFILE:
	/* return RLIM_INFINITY here */
	rlim->rlim_cur = RLIM_INFINITY;
	rlim->rlim_max = RLIM_INFINITY;
	return(0);
      default:
	errno = EINVAL;
	return(-1);
    }
}
--
Fabio Somenzi          | Phone: 303-492-3466
University of Colorado | Fax:   303-492-2758
ECE Dept.              | Email: [email-masked]
Boulder CO 80309-0425  | WWW:   http://vlsi.colorado.edu/~fabio

-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".