[Top][All Lists]

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

Re: Warning starting Emacs (Cygwin)

From: Angelo Graziosi
Subject: Re: Warning starting Emacs (Cygwin)
Date: Sat, 02 Aug 2008 17:02:31 +0200
User-agent: Thunderbird (Windows/20080708)

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 <stdio.h>
#include <sys/resource.h>

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",

   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


... e la terra ritornata alla forma di nebulosa errerĂ  nei cieli priva
di parassiti e di malattie.
                         Italo SVEVO, "La coscienza di Zeno"

reply via email to

[Prev in Thread] Current Thread [Next in Thread]