aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2017-08-09 18:39:54 +0000
committerVincent Richard <[email protected]>2017-08-09 18:39:54 +0000
commit243efb267fe539958610ef1e2142a36dfbcd3c28 (patch)
tree643d082370021b2a944c9679663c83ce4999d649
parentClear OpenSSL error queue before calling a SSL_*() function, then SSL_get_err... (diff)
downloadvmime-243efb267fe539958610ef1e2142a36dfbcd3c28.tar.gz
vmime-243efb267fe539958610ef1e2142a36dfbcd3c28.zip
Fixed #177: thread id on OpenBSD.
-rw-r--r--CMakeLists.txt1
-rw-r--r--cmake/config.hpp.cmake1
-rw-r--r--src/vmime/platforms/posix/posixHandler.cpp2
3 files changed, 4 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 02f07eab..bab4819e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -939,6 +939,7 @@ CHECK_FUNCTION_EXISTS(getnameinfo VMIME_HAVE_GETNAMEINFO)
CHECK_FUNCTION_EXISTS(gettid VMIME_HAVE_GETTID)
CHECK_FUNCTION_EXISTS(syscall VMIME_HAVE_SYSCALL)
CHECK_SYMBOL_EXISTS(SYS_gettid sys/syscall.h VMIME_HAVE_SYSCALL_GETTID)
+CHECK_SYMBOL_EXISTS(getthrid unistd.h VMIME_HAVE_GETTHRID)
CHECK_SYMBOL_EXISTS(SO_KEEPALIVE sys/socket.h VMIME_HAVE_SO_KEEPALIVE)
CHECK_SYMBOL_EXISTS(SO_NOSIGPIPE sys/socket.h VMIME_HAVE_SO_NOSIGPIPE)
diff --git a/cmake/config.hpp.cmake b/cmake/config.hpp.cmake
index e87bf9d9..c5e9fdef 100644
--- a/cmake/config.hpp.cmake
+++ b/cmake/config.hpp.cmake
@@ -76,6 +76,7 @@ typedef unsigned @VMIME_64BIT_TYPE@ vmime_uint64;
#cmakedefine01 VMIME_HAVE_GETTID
#cmakedefine01 VMIME_HAVE_SYSCALL
#cmakedefine01 VMIME_HAVE_SYSCALL_GETTID
+#cmakedefine01 VMIME_HAVE_GETTHRID
#cmakedefine01 VMIME_HAVE_GMTIME_S
#cmakedefine01 VMIME_HAVE_GMTIME_R
#cmakedefine01 VMIME_HAVE_LOCALTIME_S
diff --git a/src/vmime/platforms/posix/posixHandler.cpp b/src/vmime/platforms/posix/posixHandler.cpp
index 14877403..e0263b2b 100644
--- a/src/vmime/platforms/posix/posixHandler.cpp
+++ b/src/vmime/platforms/posix/posixHandler.cpp
@@ -260,6 +260,8 @@ unsigned int posixHandler::getThreadId() const
return static_cast <unsigned int>(::gettid());
#elif VMIME_HAVE_SYSCALL && VMIME_HAVE_SYSCALL_GETTID
return static_cast <unsigned int>(::syscall(SYS_gettid));
+#elif VMIME_HAVE_GETTHRID // OpenBSD
+ return static_cast <unsigned int>(::getthrid());
#else
#error We have no implementation of getThreadId() for this platform!
#endif