From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.74]) by sourceware.org (Postfix) with ESMTPS id 77FF63836C52 for ; Mon, 15 Feb 2021 09:14:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 77FF63836C52 Received: from calimero.vinschen.de ([24.134.7.25]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MORMu-1lVyMM2b7e-00PvzK; Mon, 15 Feb 2021 10:14:20 +0100 Received: by calimero.vinschen.de (Postfix, from userid 500) id 4DD2BA80D37; Mon, 15 Feb 2021 10:14:19 +0100 (CET) Date: Mon, 15 Feb 2021 10:14:19 +0100 From: Corinna Vinschen To: Patrick Chkoreff Cc: cygwin@cygwin.com Subject: Re: setrlimit always fails Message-ID: <20210215091419.GJ4251@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: Patrick Chkoreff , cygwin@cygwin.com References: <1c233bc7-401b-568f-36d5-48c4f1d4dcea@cornell.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Provags-ID: V03:K1:YpdAOit3QsYgi0x0MqugZDxuk7TXZzN2BcXccRRFVFlKFm7haB6 o+0AtR/77LwDhM0qd0bNHGnVphwwjDhiojow6LGrAZL4OHVVmbGR71zahBtCCQQj5iMeHcQ gugXPYzWOjsu7i1t56wzs+F4cRQ774bA/gsL81Aqu5JbecZE8z6sn7b3uQfDatYWD+eBg4n rah5zxnckaGT5p8etpZcQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:GU0O1MzJKPw=:8JzsaZVQhQPHu2Lcn/2cYW rABaoA3ZPtIL7uwh6B3kHz055l1vzTrZvi2S/X/MYugSrI/YGMmN+R0iG4dp4sWXNwz/uqALf aJbDNmMxfCiD+um65XN1hqd2kL4kpyClpD3+LORd6kyL+jtaFKWQQn0sfPKevO2RP1qyAuYzm hUXXbJ9tNJiAp9QYABHl35CbsNjkq+f8hT0stlECMpBQA+fHRpBNsARbqJjdPTcpPtVItxuop YC82wJ9ZF8RS0URMjGSojzeiidEZz5rK+24AIhTfXzMj170+jcMTb+haFIFsM5GLg5rk4xUqK HddT5TLMwKAynSZa+Rh5mXPWLb1+cPrQMhpF4O9/tFaJW6NcYvO7pY5uqZkSou2xcqdR36TDg rceZlG8FZAhthqR3dctwDCENIIgz4hsG3mBaqB6ECQR+gTKI/WxmwYjCtNayiBsmZ1OyadvNW 1xufw6HXug== X-Spam-Status: No, score=-101.3 required=5.0 tests=BAYES_00, 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: Mon, 15 Feb 2021 09:14:26 -0000 On Feb 12 10:11, Patrick Chkoreff wrote: > Ken Brown via Cygwin wrote on 2/11/21 9:06 PM: > > > 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 > [...] > I will say that my first attempt at compiling the Linux code under > Cygwin went very well. The only compiler error was in some code that > calls strptime. To fix that, I had to use some macros in a sequence > like this: > > #ifdef __CYGWIN__ > /* Ensure that strptime is accessible. */ > #define _XOPEN_SOURCE > #endif > > #include > ... > #ifndef __CYGWIN__ > /* Ensure that strptime is accessible. */ > #define __USE_XOPEN > #endif > > #include > > > That seems to be the simplest I can make that. That looks wrong. The __USE_ flags are internal flags from GLibc and not supposed to be used by application code. Check the Linux man page for strptime, the usage of _XOPEN_SOURCE or another flag including _XOPEN_SOURCE (e. g. _GNU_SOURCE) is required. So this: #define _XOPEN_SOURCE #include should be sufficient. Corinna