[EMAIL PROTECTED] wrote:
> > Is it safe to call setrlimit(RLIMIT_NOFILE, ..) from a library?
> > The code does
> >        if (getrlimit(RLIMIT_NOFILE, &rl) == 0) {
> >                rl.rlim_cur = rl.rlim_max;
> >                (void) setrlimit(RLIMIT_NOFILE, &rl);
> >        }
> 
> No.  Libraries should not have side effects like this.

Erm... depends on the type of library. libshell (which is ksh93 provided
as a shell) can generate such side-effects if someone uses the "ulimit"
builtin command.

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) [EMAIL PROTECTED]
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 7950090
 (;O/ \/ \O;)
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to