setrlimit always fails
Corinna Vinschen
corinna-cygwin@cygwin.com
Fri Feb 12 09:12:33 GMT 2021
On Feb 12 00:26, Brian Inglis wrote:
> On 2021-02-11 19:06, Ken Brown via Cygwin wrote:
> > On 2/11/2021 10:23 AM, Patrick Chkoreff wrote:
> > > I'm trying to use setrlimit to impose limits on various resources such
> > > as CPU time and memory. The call to setrlimit always fails. I've
> > > distilled this into the following example test.c:
> > [...]
> > > if (setrlimit(RLIMIT_CPU,&rlim) < 0)
> > [...]
> > > setrlimit: Invalid argument
> >
> > Cygwin's setrlimit only supports a few resources, as you can see in the source:
> >
> > https://cygwin.com/git/?p=newlib-cygwin.git;a=blob;f=winsup/cygwin/resource.cc;h=97777e9d223466b7635b990d6c9e0bfb9e2e9a46;hb=HEAD#l201
>
> In that case could I suggest:
>
> /usr/share/doc/cygwin-doc/html/cygwin-api/compatibility.html#std-susv4
> https://cygwin.com/cygwin-api/compatibility.html#std-susv4
>
> in https://cygwin.com/git/?p=newlib-cygwin.git;a=blob;f=winsup/doc/posix.xml
>
> get/setrlimit entries should be annotated with:
https://cygwin.com/acronyms/#PGA
Corinna
--
Corinna Vinschen
Cygwin Maintainer
More information about the Cygwin
mailing list