guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getrlimit and setrlimit interface


From: Andy Wingo
Subject: Re: getrlimit and setrlimit interface
Date: Mon, 20 Jun 2016 09:56:01 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

On Sat 21 Jun 2014 23:49, address@hidden (Ludovic Courtès) writes:

> The ‘getrlimit’ and ‘setrlimit’ procedures are not documented in the
> manual.  They’re supposed to be passed a symbol or a number:
>
>   (getrlimit 'nofile) == (getrlimit 7) ≍ getrlimit (RLIMIT_NOFILE, &lim)
>
> For most other POSIX functions with a similar interface, we instead
> define Scheme variables with the same name as in C (like
> ‘RLIMIT_NOFILE’) and these are then passed directly to the procedure.
>
> Here’s a proposal: define RLIMIT_* Scheme variables, document
> ‘getrlimit’ and ‘setrlimit’ to accept those, and emit a deprecation
> warning when the symbol is used.
>
> WDYT?

Do you think the usual Guile strategy is a good one?  I find that all
the constants in the default namespace are a bit distracting.  They do
allow discovery of (some of the) available enumerated values, but they
don't limit the enumerated values in any way.  You still have to check
in the implementation that the value given is a valid value.  Dunno.

Andy, who apparently only processes mail during solstice weeks :P



reply via email to

[Prev in Thread] Current Thread [Next in Thread]