diff options
-rw-r--r-- | config/ac-macros/misc.m4 | 35 | ||||
-rw-r--r-- | configure.in | 2 | ||||
-rw-r--r-- | sql/mysqld.cc | 2 |
3 files changed, 35 insertions, 4 deletions
diff --git a/config/ac-macros/misc.m4 b/config/ac-macros/misc.m4 index 186a069ac61..201702e5379 100644 --- a/config/ac-macros/misc.m4 +++ b/config/ac-macros/misc.m4 @@ -34,10 +34,10 @@ undefine([AC_CV_NAME])dnl AC_DEFUN([MYSQL_TYPE_ACCEPT], [ac_save_CXXFLAGS="$CXXFLAGS" AC_CACHE_CHECK([base type of last arg to accept], mysql_cv_btype_last_arg_accept, -AC_LANG_SAVE -AC_LANG_CPLUSPLUS +AC_LANG_PUSH(C++) if test "$ac_cv_prog_gxx" = "yes" then + # Add -Werror, remove -fbranch-probabilities (Bug #268) CXXFLAGS=`echo $CXXFLAGS -Werror | sed 's/-fbranch-probabilities//'` fi mysql_cv_btype_last_arg_accept=none @@ -64,7 +64,7 @@ fi if test "$mysql_cv_btype_last_arg_accept" = "none"; then mysql_cv_btype_last_arg_accept=int fi) -AC_LANG_RESTORE +AC_LANG_POP(C++) AC_DEFINE_UNQUOTED([SOCKET_SIZE_TYPE], [$mysql_cv_btype_last_arg_accept], [The base type of the last arg to accept]) CXXFLAGS="$ac_save_CXXFLAGS" @@ -90,6 +90,35 @@ then fi ]) +#---START: Figure out whether to use 'struct rlimit' or 'struct rlimit64' +AC_DEFUN([MYSQL_TYPE_STRUCT_RLIMIT], +[ac_save_CXXFLAGS="$CXXFLAGS" +AC_CACHE_CHECK([struct type to use with setrlimit], mysql_cv_btype_struct_rlimit, +AC_LANG_PUSH(C++) +if test "$ac_cv_prog_gxx" = "yes" +then + # Add -Werror, remove -fbranch-probabilities (Bug #268) + CXXFLAGS=`echo $CXXFLAGS -Werror | sed 's/-fbranch-probabilities//'` +fi +mysql_cv_btype_struct_rlimit=none +[AC_TRY_COMPILE([#if defined(inline) +#undef inline +#endif +#include <stdlib.h> +#include <sys/resource.h> +], +[struct rlimit64 rl; setrlimit(RLIMIT_CORE, &rl);], +mysql_cv_btype_struct_rlimit="struct rlimit64")] +if test "$mysql_cv_btype_struct_rlimit" = "none"; then +mysql_cv_btype_struct_rlimit="struct rlimit" +fi) +AC_LANG_POP(C++) +AC_DEFINE_UNQUOTED([STRUCT_RLIMIT], [$mysql_cv_btype_struct_rlimit], + [The struct rlimit type to use with setrlimit]) +CXXFLAGS="$ac_save_CXXFLAGS" +]) +#---END: + AC_DEFUN([MYSQL_TIMESPEC_TS], [AC_CACHE_CHECK([if struct timespec has a ts_sec member], mysql_cv_timespec_ts, [AC_TRY_COMPILE([#include <pthread.h> diff --git a/configure.in b/configure.in index 3c92d072b8d..d71446aa91a 100644 --- a/configure.in +++ b/configure.in @@ -1787,6 +1787,8 @@ AC_C_BIGENDIAN MYSQL_TYPE_ACCEPT #---END: +# Figure out what type of struct rlimit to use with setrlimit +MYSQL_TYPE_STRUCT_RLIMIT # Find where the stack goes MYSQL_STACK_DIRECTION # We want to skip alloca on irix unconditionally. It may work on some version.. diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 9c592d068ee..e96870d4088 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2022,7 +2022,7 @@ static void init_signals(void) if (test_flags & TEST_CORE_ON_SIGNAL) { /* Change limits so that we will get a core file */ - struct rlimit rl; + STRUCT_RLIMIT rl; rl.rlim_cur = rl.rlim_max = RLIM_INFINITY; if (setrlimit(RLIMIT_CORE, &rl) && global_system_variables.log_warnings) sql_print_warning("setrlimit could not change the size of core files to 'infinity'; We may not be able to generate a core file on signals"); |