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

Re: setting resource limits



Oliver Kiddle wrote:
> It should probably produce an error for a negative number instead of
> defaulting to the file size limit. The old code initialises res to -1
> twice then checks for it at the end. I'd have thought it could just be
> initialised to RLIMIT_FSIZE with the <0 test producing an error.

I don't understand what it's doing well enough to change.  It's trying
to handle multiple limits somehow.

> Is it worth doing the same for the limit and unlimit builtins too?

Probably.

I realise, however, this is rather partial.  With some simple changes I
can make sure it prints and sets limits up to RLIM_NLIMITS as compiled
in, but the limits are stored in and set and read from an internal
array of that size, so limits beyond the end are more difficult and
need direct getrlimit/setrlimit handling.  So it will need improving.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************



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