From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.134]) by sourceware.org (Postfix) with ESMTPS id 7B50039CD51C for ; Fri, 12 Feb 2021 09:12:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7B50039CD51C Received: from calimero.vinschen.de ([24.134.7.25]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MMp08-1lQuvO01si-00IiQM for ; Fri, 12 Feb 2021 10:12:34 +0100 Received: by calimero.vinschen.de (Postfix, from userid 500) id 7714EA80D37; Fri, 12 Feb 2021 10:12:33 +0100 (CET) Date: Fri, 12 Feb 2021 10:12:33 +0100 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: setrlimit always fails Message-ID: <20210212091233.GG4251@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <1c233bc7-401b-568f-36d5-48c4f1d4dcea@cornell.edu> <42b30732-9aee-454e-3359-92a82ef09f0d@SystematicSw.ab.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <42b30732-9aee-454e-3359-92a82ef09f0d@SystematicSw.ab.ca> X-Provags-ID: V03:K1:Vyp6seFSYyH3BEI4oJ7kYCv2E6ZAEbItpjWL14rumJkS32bg3fg t7HtiY/lkecBpoFzlvS5oawCCUo+Qsy1ogtklz+CdidQ++PzkwHVSdoyW03BwPtLNDXnF11 WWWNRl8D1QPzcnFWMr6HQb7kfJaUJ0sP37P2Lt0v9r6jc9y5eUUj8lRXSYvaqrv+fJzpTPJ yiSixxVP8V1q/DMXd0P3A== X-UI-Out-Filterresults: notjunk:1;V03:K0:cOaockQe4S4=:SVJt9GpBtsRGM0YFTO/mEf BGMllispI/qLaEvIRnoKkIkReTyy7vhsjMra3yzWPZKn1w5wXNilEA/L7bibEOIvKJgiofJc0 cE2HQoL4vvbFKmf0jyr6mPgCDc64QB1DPzm2vMUqrbr+ev0zSqFEMVfeR9glIqjZ4DhUCUcjP 8TVrd64vNbo1LN3XBOSUK1iGDdGTKaQX0u1wgrbRKRwFnNPQgipsOs9a1Svvvpl8MsnogQc5e OoFvmThAmmPECUKw+BqbpPCdRXI5paTUaXFNiHPij34s6UzlVu12Iur6zv2zY0xMgulDs9FK0 7c9PVTqyf1zkQ2FpWRoCCxISPpIov3An+uGNJynqnCmuWThgCIQnPipJWy6DEZYOVGGWwFyXu c/egKTuMJw6mOWFQ36zpTUfFisOmjcJcPwOQ++7dhmmkaj1btV55CwNznj7iBk/abnlU5FrKE 90hltgJMN4RYxLUzkguk4g/4mcOr8v/TwdZZzrQoW8UOcSfYXChsM8ZbI4iSbxQchNQWbeSDY g== X-Spam-Status: No, score=-99.8 required=5.0 tests=BAYES_00, BODY_8BITS, GOOD_FROM_CORINNA_CYGWIN, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NEUTRAL, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 09:12:40 -0000 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