/* Define to 1 if you have the <ws2tcpip.h> header file. */
#undef HAVE_WS2TCPIP_H
+/* Define to 1 if you have the `_beginthreadex' function. */
+#undef HAVE__BEGINTHREADEX
+
/* Define to the maximum message length to pass to syslog. */
#undef MAXSYSLOGMSGLEN
-for ac_func in tzset sigprocmask fcntl getpwnam getrlimit setsid sbrk chroot kill sleep usleep random srandom recvmsg sendmsg writev setresuid setreuid setresgid setregid glob initgroups daemon strftime localtime_r setusercontext
+
+for ac_func in tzset sigprocmask fcntl getpwnam getrlimit setsid sbrk chroot kill sleep usleep random srandom recvmsg sendmsg writev setresuid setreuid setresgid setregid glob initgroups daemon strftime localtime_r setusercontext _beginthreadex
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
AC_LIBOBJ([fake-rfc2553])
fi
AC_SEARCH_LIBS([setusercontext], [util])
-AC_CHECK_FUNCS([tzset sigprocmask fcntl getpwnam getrlimit setsid sbrk chroot kill sleep usleep random srandom recvmsg sendmsg writev setresuid setreuid setresgid setregid glob initgroups daemon strftime localtime_r setusercontext])
+AC_CHECK_FUNCS([tzset sigprocmask fcntl getpwnam getrlimit setsid sbrk chroot kill sleep usleep random srandom recvmsg sendmsg writev setresuid setreuid setresgid setregid glob initgroups daemon strftime localtime_r setusercontext _beginthreadex])
# check if setreuid en setregid fail, on MacOSX10.4(darwin8).
if echo $build_os | grep darwin8 > /dev/null; then
19 March 2009: Wouter
- winrc/README.txt dos-format text file.
- iana portlist updated.
+ - use _beginthreadex() when available (performs stack alignment).
18 March 2009: Wouter
- Added tests, unknown algorithms become insecure. fallback works.
void ub_thread_create(ub_thread_t* thr, void* (*func)(void*), void* arg)
{
+#ifndef HAVE__BEGINTHREADEX
*thr = CreateThread(NULL, /* default security (no inherit handle) */
0, /* default stack size */
(LPTHREAD_START_ROUTINE)func, arg,
0, /* default flags, run immediately */
NULL); /* do not store thread identifier anywhere */
+#else
+ /* the begintheadex routine setups for the C lib; aligns stack */
+ *thr=(ub_thread_t)_beginthreadex(NULL, 0, (void*)func, arg, 0, NULL);
+#endif
if(*thr == NULL) {
log_win_err("CreateThread failed", GetLastError());
fatal_exit("thread create failed");