Added sigsetjmp/siglongjmp and gettid to the portability library.
diff --git a/configure b/configure
index efad905..1667645 100755
--- a/configure
+++ b/configure
@@ -9706,6 +9706,62 @@
fi
+echo "$as_me:$LINENO: checking for sigsetjmp" >&5
+echo $ECHO_N "checking for sigsetjmp... $ECHO_C" >&6
+if test "${ac_cv_c_sigsetjmp+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <setjmp.h>
+int
+main ()
+{
+sigjmp_buf buf;
+ sigsetjmp( buf, 1 );
+ siglongjmp( buf, 1 );
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_c_sigsetjmp="yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_c_sigsetjmp="no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_sigsetjmp" >&5
+echo "${ECHO_T}$ac_cv_c_sigsetjmp" >&6
+if test "$ac_cv_c_sigsetjmp" = "yes"
+then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SIGSETJMP 1
+_ACEOF
+
+fi
+
echo "$as_me:$LINENO: checking for pthread_rwlock_t" >&5
echo $ECHO_N "checking for pthread_rwlock_t... $ECHO_C" >&6
if test "${ac_cv_type_pthread_rwlock_t+set}" = set; then
@@ -13800,6 +13856,7 @@
+
for ac_func in \
_lwp_create \
_lwp_self \
@@ -13824,6 +13881,7 @@
getprotobynumber \
getpwuid \
getservbyport \
+ gettid \
gettimeofday \
inet_network \
lseek64 \
diff --git a/configure.ac b/configure.ac
index 75b29bd..78c69de 100644
--- a/configure.ac
+++ b/configure.ac
@@ -517,6 +517,21 @@
AC_DEFINE(HAVE___VA_COPY, 1, [Define if we have __va_copy])
fi
+dnl **** Check for sigsetjmp ****
+AC_CACHE_CHECK([for sigsetjmp], ac_cv_c_sigsetjmp,
+ AC_TRY_LINK(
+ [#include <setjmp.h>],
+ [sigjmp_buf buf;
+ sigsetjmp( buf, 1 );
+ siglongjmp( buf, 1 );],
+ [ac_cv_c_sigsetjmp="yes"],
+ [ac_cv_c_sigsetjmp="no"])
+ )
+if test "$ac_cv_c_sigsetjmp" = "yes"
+then
+ AC_DEFINE(HAVE_SIGSETJMP, 1, [Define to 1 if you have the sigsetjmp (and siglongjmp) function])
+fi
+
dnl **** Check for pthread_rwlock_t ****
AC_CHECK_TYPES([pthread_rwlock_t, pthread_rwlockattr_t],,,[#define _GNU_SOURCE
#include <pthread.h>])
@@ -979,6 +994,7 @@
getprotobynumber \
getpwuid \
getservbyport \
+ gettid \
gettimeofday \
inet_network \
lseek64 \
diff --git a/include/config.h.in b/include/config.h.in
index 4be7ba5..b2e24c4 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -155,6 +155,9 @@
/* Define to 1 if you have the `getservbyport' function. */
#undef HAVE_GETSERVBYPORT
+/* Define to 1 if you have the `gettid' function. */
+#undef HAVE_GETTID
+
/* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
@@ -467,6 +470,9 @@
/* Define to 1 if `si_fd' is member of `siginfo_t'. */
#undef HAVE_SIGINFO_T_SI_FD
+/* Define to 1 if you have the sigsetjmp (and siglongjmp) function */
+#undef HAVE_SIGSETJMP
+
/* Define to 1 if the system has the type `size_t'. */
#undef HAVE_SIZE_T
diff --git a/include/wine/port.h b/include/wine/port.h
index 9aae76d..b76ff56 100644
--- a/include/wine/port.h
+++ b/include/wine/port.h
@@ -216,6 +216,10 @@
size_t getpagesize(void);
#endif /* HAVE_GETPAGESIZE */
+#ifndef HAVE_GETTID
+pid_t gettid(void);
+#endif /* HAVE_GETTID */
+
#ifndef HAVE_LSTAT
int lstat(const char *file_name, struct stat *buf);
#endif /* HAVE_LSTAT */
@@ -232,6 +236,13 @@
ssize_t pwrite( int fd, const void *buf, size_t count, off_t offset );
#endif /* HAVE_PWRITE */
+#ifndef HAVE_SIGSETJMP
+# include <setjmp.h>
+typedef jmp_buf sigjmp_buf;
+int sigsetjmp( sigjmp_buf buf, int savesigs );
+void siglongjmp( sigjmp_buf buf, int val );
+#endif /* HAVE_SIGSETJMP */
+
#ifndef HAVE_STATFS
int statfs(const char *name, struct statfs *info);
#endif /* !defined(HAVE_STATFS) */
diff --git a/libs/port/Makefile.in b/libs/port/Makefile.in
index 2fcfd05..70d8ec9 100644
--- a/libs/port/Makefile.in
+++ b/libs/port/Makefile.in
@@ -10,6 +10,7 @@
getopt.c \
getopt1.c \
getpagesize.c \
+ gettid.c \
interlocked.c \
lstat.c \
memcpy_unaligned.c \
@@ -17,6 +18,7 @@
mkstemps.c \
pread.c \
pwrite.c \
+ sigsetjmp.c \
spawn.c \
statfs.c \
strcasecmp.c \
diff --git a/libs/port/gettid.c b/libs/port/gettid.c
new file mode 100644
index 0000000..b962998
--- /dev/null
+++ b/libs/port/gettid.c
@@ -0,0 +1,38 @@
+/*
+ * gettid function
+ *
+ * Copyright 2003 Alexandre Julliard
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "config.h"
+#include "wine/port.h"
+
+#ifndef HAVE_GETTID
+
+pid_t gettid(void)
+{
+#if defined(__linux__) && defined(__i386__)
+ pid_t ret;
+ __asm__("int $0x80" : "=a" (ret) : "0" (224) /* SYS_gettid */);
+ if (ret < 0) ret = -1;
+ return ret;
+#else
+ return -1; /* FIXME */
+#endif
+}
+
+#endif /* HAVE_GETTID */
diff --git a/libs/port/sigsetjmp.c b/libs/port/sigsetjmp.c
new file mode 100644
index 0000000..aa2fcde
--- /dev/null
+++ b/libs/port/sigsetjmp.c
@@ -0,0 +1,36 @@
+/*
+ * sigsetjmp/siglongjmp functions
+ *
+ * Copyright 2003 Alexandre Julliard
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "config.h"
+#include "wine/port.h"
+
+#ifndef HAVE_SIGSETJMP
+
+int sigsetjmp( sigjmp_buf buf, int savesigs )
+{
+ return setjmp( buf );
+}
+
+void siglongjmp( sigjmp_buf buf, int val )
+{
+ longjmp( buf, val );
+}
+
+#endif /* HAVE_SIGSETJMP */
diff --git a/loader/pthread.c b/loader/pthread.c
index 4ec91b7..94cc089 100644
--- a/loader/pthread.c
+++ b/loader/pthread.c
@@ -44,19 +44,6 @@
static pthread_key_t teb_key;
#endif
-static inline int gettid(void)
-{
-#if defined(__linux__) && defined(__i386__)
- int ret;
- __asm__("int $0x80" : "=a" (ret) : "0" (224) /* SYS_gettid */);
- if (ret < 0) ret = -1;
- return ret;
-#else
- return -1; /* FIXME */
-#endif
-}
-
-
/***********************************************************************
* wine_pthread_init_process
*