Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: setting resource limits



In the last episode (Jun 14), Oliver Kiddle said:
> Have a look at these two messages on the Linux kernel mailing list.
> You'll want to scroll to the end of the first one.
>   http://www.ussg.iu.edu/hypermail/linux/kernel/0404.1/1509.html
>   http://www.ussg.iu.edu/hypermail/linux/kernel/0404.2/1037.html
> 
> Basically, the suggestion is that it should be possible to set resource
> limits numerically with e.g. `ulimit 4 1024'. I can see how this could
> be worth a lot to anyone implementing a new resource limit. Is that
> difficult to implement? Would it be vaguely portable?

I doubt it.  That's what <sys/resource.h> and RLIMIT_xxx is for.  The
first 5 limits (0-4) happen to be the same across all the following
systems, but RLIMIT_NOFILE is different:

AIX:     #define RLIMIT_NOFILE   7
FreeBSD: #define     RLIMIT_NOFILE   8 /* number of open files */
Linux:	 RLIMIT_NOFILE = 7,
Solaris: #define     RLIMIT_NOFILE   5 /* file descriptors */
Tru64:   #define RLIMIT_NOFILE       6         /* open files */

-- 
	Dan Nelson
	dnelson@xxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author