unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Angelo Graziosi <angelo.graziosi@alice.it>
To: Dan Nicolaescu <dann@ics.uci.edu>
Cc: Chong Yidong <cyd@stupidchicken.com>, emacs-devel@gnu.org
Subject: Re: Warning starting Emacs  (Cygwin)
Date: Sat, 02 Aug 2008 17:02:31 +0200	[thread overview]
Message-ID: <48947707.7030303@alice.it> (raw)
In-Reply-To: <48946F36.3020505@alice.it>

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





  reply	other threads:[~2008-08-02 15:02 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-31 14:45 Failure bootstrapping Emacs (Cygwin) Angelo Graziosi
2008-07-31 16:27 ` Angelo Graziosi
2008-07-31 16:57   ` Angelo Graziosi
2008-07-31 17:00   ` Dan Nicolaescu
2008-08-01 10:38     ` Warning starting Emacs (was Re: Failure bootstrapping Emacs (Cygwin)) Angelo Graziosi
2008-08-01 12:51       ` Warning starting Emacs (Cygwin) Angelo Graziosi
2008-08-01 13:08         ` Dan Nicolaescu
2008-08-01 14:13           ` Angelo Graziosi
2008-08-01 14:36             ` Dan Nicolaescu
2008-08-01 20:47               ` Angelo Graziosi
2008-08-02  4:06                 ` Dan Nicolaescu
2008-08-02 14:29                   ` Angelo Graziosi
2008-08-02 15:02                     ` Angelo Graziosi [this message]
2008-08-02 18:59                     ` Dan Nicolaescu
2008-08-02 19:14                       ` Chong Yidong
2008-08-02 19:30                         ` Dan Nicolaescu
2008-08-02 19:54                           ` Eli Zaretskii
2008-08-02 20:19                           ` Chong Yidong
2008-08-02 20:24                             ` Chong Yidong
2008-08-03  3:26                               ` Eli Zaretskii
2008-08-03  6:20                         ` Andreas Vögele
2008-08-03 14:10                           ` Chong Yidong
2008-08-03 22:35                             ` Angelo Graziosi
2008-08-04  6:25                               ` Andreas Vögele

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48947707.7030303@alice.it \
    --to=angelo.graziosi@alice.it \
    --cc=cyd@stupidchicken.com \
    --cc=dann@ics.uci.edu \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).