#include "private/switch_core_pvt.h"
#ifndef WIN32
#include <switch_private.h>
-#endif
-
+#ifdef HAVE_SETRLIMIT
#include <sys/resource.h>
+#endif
+#endif
SWITCH_DECLARE_DATA switch_directories SWITCH_GLOBAL_dirs = { 0 };
{
struct system_thread_handle *sth = (struct system_thread_handle *)obj;
-/* struct rlimit rlim;
-
- getrlimit(RLIMIT_STACK, &rlim);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rlim_cur: %d rlim_max: %d\n", (int)rlim.rlim_cur, (int)rlim.rlim_max);
-*/
-
sth->ret = system(sth->cmd);
switch_mutex_lock(sth->mutex);
int ret = 0;
struct system_thread_handle *sth;
switch_memory_pool_t *pool;
-#ifndef __FreeBSD__
+#ifdef HAVE_SETRLIMIT
struct rlimit rlim;
rlim.rlim_cur = SWITCH_SYSTEM_THREAD_STACKSIZE;
switch_threadattr_create(&thd_attr, sth->pool);
switch_threadattr_stacksize_set(thd_attr, SWITCH_SYSTEM_THREAD_STACKSIZE);
-// switch_threadattr_priority_increase(thd_attr);
switch_thread_create(&thread, thd_attr, system_thread, sth, sth->pool);
if (wait) {