From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Angelo Graziosi Newsgroups: gmane.emacs.devel Subject: Re: Warning starting Emacs (Cygwin) Date: Sat, 02 Aug 2008 17:02:31 +0200 Message-ID: <48947707.7030303@alice.it> References: <4891D01B.6070802@alice.it> <4891E7E8.1000503@alice.it> <200807311700.m6VH0eCa004994@sallyv1.ics.uci.edu> <4892E7BE.1080706@alice.it> <489306EE.7090800@alice.it> <200808011308.m71D8PA3023871@sallyv1.ics.uci.edu> <489319F7.5040101@alice.it> <200808011436.m71EaAeZ019293@sallyv1.ics.uci.edu> <4893765E.5020803@alice.it> <200808020406.m7246D1T003058@sallyv1.ics.uci.edu> <48946F36.3020505@alice.it> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1217689409 24273 80.91.229.12 (2 Aug 2008 15:03:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 2 Aug 2008 15:03:29 +0000 (UTC) Cc: Chong Yidong , emacs-devel@gnu.org To: Dan Nicolaescu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 02 17:04:17 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KPIeO-0001Su-TD for ged-emacs-devel@m.gmane.org; Sat, 02 Aug 2008 17:04:09 +0200 Original-Received: from localhost ([127.0.0.1]:58307 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KPIdU-0001pc-6U for ged-emacs-devel@m.gmane.org; Sat, 02 Aug 2008 11:03:12 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KPIdQ-0001pN-0D for emacs-devel@gnu.org; Sat, 02 Aug 2008 11:03:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KPIdN-0001ou-6d for emacs-devel@gnu.org; Sat, 02 Aug 2008 11:03:07 -0400 Original-Received: from [199.232.76.173] (port=36403 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KPIdN-0001or-4U for emacs-devel@gnu.org; Sat, 02 Aug 2008 11:03:05 -0400 Original-Received: from smtp-out113.alice.it ([85.37.17.113]:1213) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KPIdM-0004Oj-NJ for emacs-devel@gnu.org; Sat, 02 Aug 2008 11:03:04 -0400 Original-Received: from FBCMMO03.fbc.local ([192.168.68.197]) by smtp-out113.alice.it with Microsoft SMTPSVC(6.0.3790.1830); Sat, 2 Aug 2008 17:03:03 +0200 Original-Received: from FBCMCL01B04.fbc.local ([192.168.69.85]) by FBCMMO03.fbc.local with Microsoft SMTPSVC(6.0.3790.1830); Sat, 2 Aug 2008 17:03:02 +0200 Original-Received: from [87.3.234.70] ([87.3.234.70]) by FBCMCL01B04.fbc.local with Microsoft SMTPSVC(6.0.3790.1830); Sat, 2 Aug 2008 17:03:02 +0200 User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) In-Reply-To: <48946F36.3020505@alice.it> X-OriginalArrivalTime: 02 Aug 2008 15:03:02.0587 (UTC) FILETIME=[DC33E8B0:01C8F4B0] X-detected-kernel: by monty-python.gnu.org: Windows 2000 SP4, XP SP1+ X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:101957 Archived-At: Angelo Graziosi ha scritto: > > At the end I have tried this simple test case, which is 'out context' > (so it could be not meaningful), but it seems to return wrong values: > > ----------------------------------------------- > $ cat test_printf.c > #include > #include > > int main() > { > struct rlimit rlimit; > > unsigned long five_percent; > unsigned long data_size; > > getrlimit (RLIMIT_AS, &rlimit); > > if (RLIM_INFINITY == rlimit.rlim_max) > return 1; > > /* This is a nonsensical case, but it happens -- rms. */ > if (rlimit.rlim_cur > rlimit.rlim_max) > return 2; > > five_percent = rlimit.rlim_max / 20; > data_size = rlimit.rlim_cur; > > printf("have getrlimit %lu, %lu %lu %lu\n", > data_size,five_percent,rlimit.rlim_cur,rlimit.rlim_max); > > if (data_size > five_percent * 19) > printf("past 95 percent of memory limit\n"); > > return 0; > } > > $ gcc -o test_printf test_printf.c > > $ ./test_printf > have getrlimit 2147483648, 107374182 2147483648 2147483648 > past 95 percent of memory limit > > ----------------------------------------------- > On GNU/Linux (on which there is NOT warning) the test case retruns 1, i.e. it executes if (RLIM_INFINITY == rlimit.rlim_max) return 1; with RLIM_INFINITY == rlimit.rlim_max == 4294967295 Instead on Cygwin RLIM_INFINITY == 4294967295 rlimit.rlim_max == 2147483648 > > Cheers, > Angelo. > > --- > ... e la terra ritornata alla forma di nebulosa errerą nei cieli priva > di parassiti e di malattie. > . > Italo SVEVO, "La coscienza di Zeno" >