GNU bug report logs - #18238
Fix for DOS build when using more accurate config[.h].in

Previous Next

Package: emacs;

Reported by: Reuben Thomas <rrt <at> sc3d.org>

Date: Sun, 10 Aug 2014 16:48:01 UTC

Severity: wishlist

Tags: wontfix

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #29 received at 18238 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: 18238 <at> debbugs.gnu.org
Subject: Re: bug#18238: Fix for DOS build when using more accurate
 config[.h].in
Date: Fri, 22 Oct 2021 15:02:17 -0400
Reuben Thomas <rrt <at> sc3d.org> writes:

> DJGPP does actually have getrlimit. The special config[.h].in for MSDOS lies and says it hasn't. However, this is a white lie, because
> getrlimit on DJGPP doesn't support RLIMIT_AS/RLIMIT_DATA, which is what we want, so we still want the workaround code. The following
> patch simply reverses the order of a couple of tests in vm-limit.c so that being on MSDOS overrides HAVE_GETRLIMIT.
>
> Is it OK to install?

(That was in 2014.)

It seems like this patch was never installed.  Is it still relevant?

> === modified file 'src/vm-limit.c'
> --- src/vm-limit.c    2014-07-11 10:09:51 +0000
> +++ src/vm-limit.c    2014-08-10 16:44:24 +0000
> @@ -71,7 +71,27 @@
>  /* Number of bytes of writable memory we can expect to be able to get.  */
>  static size_t lim_data;
>
>
> -#ifdef HAVE_GETRLIMIT
> +#ifdef MSDOS
> +
> +void
> +get_lim_data (void)
> +{
> +  unsigned long totalram, freeram, totalswap, freeswap;
> +
> +  dos_memory_info (&totalram, &freeram, &totalswap, &freeswap);
> +  lim_data = freeram;
> +  /* Don't believe they will give us more that 0.5 GB.   */
> +  if (lim_data > 512U * 1024U * 1024U)
> +    lim_data = 512U * 1024U * 1024U;
> +}
> +
> +unsigned long
> +ret_lim_data (void)
> +{
> +  get_lim_data ();
> +  return lim_data;
> +}
> +#elif defined HAVE_GETRLIMIT
>
>  # ifndef RLIMIT_AS
>  #  define RLIMIT_AS RLIMIT_DATA
> @@ -101,26 +121,6 @@
>    lim_data = reserved_heap_size;
>  }
>
> -#elif defined MSDOS
> -
> -void
> -get_lim_data (void)
> -{
> -  unsigned long totalram, freeram, totalswap, freeswap;
> -
> -  dos_memory_info (&totalram, &freeram, &totalswap, &freeswap);
> -  lim_data = freeram;
> -  /* Don't believe they will give us more that 0.5 GB.   */
> -  if (lim_data > 512U * 1024U * 1024U)
> -    lim_data = 512U * 1024U * 1024U;
> -}
> -
> -unsigned long
> -ret_lim_data (void)
> -{
> -  get_lim_data ();
> -  return lim_data;
> -}
>  #else
>  # error "get_lim_data not implemented on this machine"
>  #endif




This bug report was last modified 3 years and 216 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.