Commit 1b8d9e03 authored by Alexandre Julliard's avatar Alexandre Julliard

loader: Set the address space limit before starting the preloader.

parent 5874b854
......@@ -27,6 +27,9 @@
#ifdef HAVE_SYS_MMAN_H
# include <sys/mman.h>
#endif
#ifdef HAVE_SYS_RESOURCE_H
# include <sys/resource.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
......@@ -97,6 +100,18 @@ static void check_vmsplit( void *stack )
}
}
static void set_max_limit( int limit )
{
struct rlimit rlimit;
if (!getrlimit( limit, &rlimit ))
{
rlimit.rlim_cur = rlimit.rlim_max;
setrlimit( limit, &rlimit );
}
}
/**********************************************************************
* main
*/
......@@ -108,6 +123,9 @@ int main( int argc, char *argv[] )
wine_init_argv0_path( new_argv0 );
/* set the address space limit before starting the preloader */
set_max_limit( RLIMIT_AS );
if (loader)
{
/* update WINELOADER with the new name */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment