libwine: Add a configure check for setrlimit.

This commit is contained in:
Paul Millar 2006-07-16 15:06:28 +01:00 committed by Alexandre Julliard
parent 5557c71f7f
commit df10b7d580
4 changed files with 12 additions and 0 deletions

2
configure vendored
View File

@ -19377,6 +19377,7 @@ fi
for ac_func in \ for ac_func in \
@ -19428,6 +19429,7 @@ for ac_func in \
sched_yield \ sched_yield \
select \ select \
sendmsg \ sendmsg \
setrlimit \
settimeofday \ settimeofday \
sigaltstack \ sigaltstack \
sigprocmask \ sigprocmask \

View File

@ -1309,6 +1309,7 @@ AC_CHECK_FUNCS(\
sched_yield \ sched_yield \
select \ select \
sendmsg \ sendmsg \
setrlimit \
settimeofday \ settimeofday \
sigaltstack \ sigaltstack \
sigprocmask \ sigprocmask \

View File

@ -587,6 +587,9 @@
/* Define to 1 if you have the `sendmsg' function. */ /* Define to 1 if you have the `sendmsg' function. */
#undef HAVE_SENDMSG #undef HAVE_SENDMSG
/* Define to 1 if you have the `setrlimit' function. */
#undef HAVE_SETRLIMIT
/* Define to 1 if you have the `settimeofday' function. */ /* Define to 1 if you have the `settimeofday' function. */
#undef HAVE_SETTIMEOFDAY #undef HAVE_SETTIMEOFDAY

View File

@ -608,6 +608,7 @@ int wine_dll_get_owner( const char *name, char *buffer, int size, int *exists )
*/ */
static void set_max_limit( int limit ) static void set_max_limit( int limit )
{ {
#ifdef HAVE_SETRLIMIT
struct rlimit rlimit; struct rlimit rlimit;
if (!getrlimit( limit, &rlimit )) if (!getrlimit( limit, &rlimit ))
@ -615,6 +616,7 @@ static void set_max_limit( int limit )
rlimit.rlim_cur = rlimit.rlim_max; rlimit.rlim_cur = rlimit.rlim_max;
setrlimit( limit, &rlimit ); setrlimit( limit, &rlimit );
} }
#endif
} }
@ -631,8 +633,12 @@ void wine_init( int argc, char *argv[], char *error, int error_size )
void (*init_func)(void); void (*init_func)(void);
/* force a few limits that are set too low on some platforms */ /* force a few limits that are set too low on some platforms */
#ifdef RLIMIT_NOFILE
set_max_limit( RLIMIT_NOFILE ); set_max_limit( RLIMIT_NOFILE );
#endif
#ifdef RLIMIT_AS
set_max_limit( RLIMIT_AS ); set_max_limit( RLIMIT_AS );
#endif
wine_init_argv0_path( argv[0] ); wine_init_argv0_path( argv[0] );
build_dll_path(); build_dll_path();