提交 d607494a authored 作者: Anthony Minessale's avatar Anthony Minessale

add mlockall

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1584 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 f7e6e528
差异被折叠。
差异被折叠。
......@@ -34,7 +34,7 @@ AC_PROG_GCC_TRADITIONAL
AC_FUNC_MALLOC
AC_TYPE_SIGNAL
AC_FUNC_STRFTIME
AC_CHECK_FUNCS([gethostname vasprintf mmap])
AC_CHECK_FUNCS([gethostname vasprintf mmap mlock mlockall])
AC_C_BIGENDIAN(AC_DEFINE([__BYTE_ORDER],__BIG_ENDIAN,[Big Endian]),AC_DEFINE([__BYTE_ORDER],__LITTLE_ENDIAN,[Little Endian]))
AC_DEFINE([__LITTLE_ENDIAN],1234,[for the places where it is not defined])
......
......@@ -20,6 +20,12 @@
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `mlock' function. */
#undef HAVE_MLOCK
/* Define to 1 if you have the `mlockall' function. */
#undef HAVE_MLOCKALL
/* Define to 1 if you have the `mmap' function. */
#undef HAVE_MMAP
......
......@@ -32,6 +32,9 @@
#include <switch.h>
#include <switch_version.h>
#ifdef HAVE_MLOCKALL
#include <sys/mman.h>
#endif
static int RUNNING = 0;
......@@ -81,6 +84,10 @@ int main(int argc, char *argv[])
//nice(-20);
#endif
#ifdef HAVE_MLOCKALL
mlockall(MCL_CURRENT|MCL_FUTURE);
#endif
#ifndef WIN32
if (argv[1] && !strcmp(argv[1], "-stop")) {
pid_t pid = 0;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论