Paul Millar : libwine: Add a configure check for setrlimit.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jul 17 08:14:44 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: df10b7d5800b5a4418a72d76fc99b6b533f36314
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=df10b7d5800b5a4418a72d76fc99b6b533f36314

Author: Paul Millar <paul at astro.gla.ac.uk>
Date:   Sun Jul 16 15:06:28 2006 +0100

libwine: Add a configure check for setrlimit.

---

 configure           |    2 ++
 configure.ac        |    1 +
 include/config.h.in |    3 +++
 libs/wine/loader.c  |    6 ++++++
 4 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/configure b/configure
index f1e9b25..a03a85c 100755
--- a/configure
+++ b/configure
@@ -19379,6 +19379,7 @@ fi
 
 
 
+
 for ac_func in \
 	_lwp_create \
 	_lwp_self \
@@ -19428,6 +19429,7 @@ for ac_func in \
 	sched_yield \
 	select \
 	sendmsg \
+	setrlimit \
 	settimeofday \
 	sigaltstack \
 	sigprocmask \
diff --git a/configure.ac b/configure.ac
index 0904a60..7894a57 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1309,6 +1309,7 @@ AC_CHECK_FUNCS(\
 	sched_yield \
 	select \
 	sendmsg \
+	setrlimit \
 	settimeofday \
 	sigaltstack \
 	sigprocmask \
diff --git a/include/config.h.in b/include/config.h.in
index e1c5692..48c047d 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -587,6 +587,9 @@ #undef HAVE_SELECT
 /* Define to 1 if you have the `sendmsg' function. */
 #undef HAVE_SENDMSG
 
+/* Define to 1 if you have the `setrlimit' function. */
+#undef HAVE_SETRLIMIT
+
 /* Define to 1 if you have the `settimeofday' function. */
 #undef HAVE_SETTIMEOFDAY
 
diff --git a/libs/wine/loader.c b/libs/wine/loader.c
index adbadd5..4406a32 100644
--- a/libs/wine/loader.c
+++ b/libs/wine/loader.c
@@ -608,6 +608,7 @@ int wine_dll_get_owner( const char *name
  */
 static void set_max_limit( int limit )
 {
+#ifdef HAVE_SETRLIMIT
     struct rlimit rlimit;
 
     if (!getrlimit( limit, &rlimit ))
@@ -615,6 +616,7 @@ static void set_max_limit( int limit )
         rlimit.rlim_cur = rlimit.rlim_max;
         setrlimit( limit, &rlimit );
     }
+#endif
 }
 
 
@@ -631,8 +633,12 @@ void wine_init( int argc, char *argv[], 
     void (*init_func)(void);
 
     /* force a few limits that are set too low on some platforms */
+#ifdef RLIMIT_NOFILE
     set_max_limit( RLIMIT_NOFILE );
+#endif
+#ifdef RLIMIT_AS
     set_max_limit( RLIMIT_AS );
+#endif
 
     wine_init_argv0_path( argv[0] );
     build_dll_path();




More information about the wine-cvs mailing list