* sysdeps/mach/hurd/brk.c (static_data_start): New variable.
(_hurd_set_brk, init_brk): Use that instead of &__data_start. Initialize it from &__data_start if defined, or else &_end. 1999-07-11 Roland McGrath <roland@baalperazim.frob.com>
This commit is contained in:
parent
78d37b3500
commit
c6496762e4
|
@ -1,3 +1,9 @@
|
||||||
|
1999-07-11 Roland McGrath <roland@baalperazim.frob.com>
|
||||||
|
|
||||||
|
* sysdeps/mach/hurd/brk.c (static_data_start): New variable.
|
||||||
|
(_hurd_set_brk, init_brk): Use that instead of &__data_start.
|
||||||
|
Initialize it from &__data_start if defined, or else &_end.
|
||||||
|
|
||||||
1999-07-11 Roland McGrath <roland@baalperazim.frob.com>
|
1999-07-11 Roland McGrath <roland@baalperazim.frob.com>
|
||||||
|
|
||||||
* sysdeps/mach/hurd/mmap.c (__mmap): Short-circuit to vm_allocate
|
* sysdeps/mach/hurd/mmap.c (__mmap): Short-circuit to vm_allocate
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
|
/* Copyright (C) 1991,92,93,94,95,96,97,99 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
|
@ -41,6 +41,8 @@ weak_alias (_hurd_brk, ___brk_addr)
|
||||||
struct mutex _hurd_brk_lock;
|
struct mutex _hurd_brk_lock;
|
||||||
|
|
||||||
extern int __data_start, _end;
|
extern int __data_start, _end;
|
||||||
|
weak_extern (__data_start)
|
||||||
|
static vm_address_t static_data_start;
|
||||||
|
|
||||||
|
|
||||||
/* Set the end of the process's data space to INADDR.
|
/* Set the end of the process's data space to INADDR.
|
||||||
|
@ -81,7 +83,7 @@ _hurd_set_brk (vm_address_t addr)
|
||||||
rlimit = _hurd_rlimits[RLIMIT_DATA].rlim_cur;
|
rlimit = _hurd_rlimits[RLIMIT_DATA].rlim_cur;
|
||||||
__mutex_unlock (&_hurd_rlimit_lock);
|
__mutex_unlock (&_hurd_rlimit_lock);
|
||||||
|
|
||||||
if (addr - (vm_address_t) &__data_start > rlimit)
|
if (addr - static_data_start > rlimit)
|
||||||
{
|
{
|
||||||
/* Need to increase the resource limit. */
|
/* Need to increase the resource limit. */
|
||||||
errno = ENOMEM;
|
errno = ENOMEM;
|
||||||
|
@ -114,6 +116,8 @@ init_brk (void)
|
||||||
|
|
||||||
__mutex_init (&_hurd_brk_lock);
|
__mutex_init (&_hurd_brk_lock);
|
||||||
|
|
||||||
|
static_data_start = (vm_address_t) (&__data_start ?: &_end);
|
||||||
|
|
||||||
/* If _hurd_brk is already set, don't change it. The assumption is that
|
/* If _hurd_brk is already set, don't change it. The assumption is that
|
||||||
it was set in a previous run before something like Emacs's unexec was
|
it was set in a previous run before something like Emacs's unexec was
|
||||||
called and dumped all the data up to the break at that point. */
|
called and dumped all the data up to the break at that point. */
|
||||||
|
@ -122,7 +126,7 @@ init_brk (void)
|
||||||
|
|
||||||
pagend = round_page (_hurd_brk);
|
pagend = round_page (_hurd_brk);
|
||||||
|
|
||||||
_hurd_data_end = round_page ((vm_address_t) &__data_start + DATA_SIZE);
|
_hurd_data_end = round_page (static_data_start + DATA_SIZE);
|
||||||
|
|
||||||
if (pagend < _hurd_data_end)
|
if (pagend < _hurd_data_end)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue