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

Re: gnupg compiled

> Well, here is what I did in exim, and you should do similar for GPG:
>   if (setrlimit(RLIMIT_CORE, &rl) < 0)
>     {
>     #ifdef __GNU__
>     if (errno != ENOSYS && errno != ENOTSUP)
>     #endif
>       log_write(0, LOG_MAIN|LOG_PANIC, "setrlimit failed: %s", strerror(errno));
>     }

I don't think this needs to be #ifdef'd, just as a generic thing.
ENOSYS/ENOTSUP from any system is an indication that there ain't no such
thing to set (as opposed to a transient failure or permission problem).

Hmm, setrlimit returns ENOSYS only when given an rlim_max that is not
RLIM_INFINITY, because it is the case that even for limits we do implement
(and the core limit will be trivial to implement in the core-writing code,
as soon as that code gets written at all) there are generally other ways to
get at the machine's resources through Mach and whatnot so limits are not
all that meaningful as "hard".  The core limit seems like it might be a
case we we arguably can enforce the limit, since there is no actual
resource consumption being limited, just a particular kind of user action
being configured.

Reply to: