OpenBSD: crashing

Stuart Henderson stu at
Sun Apr 21 11:31:30 UTC 2013

On 2013/04/20 19:45, Alan Corey wrote:
> >> I forgot to mention it, but rtl_sdr (the simplest one) also doesn't
> >> work.  I was looking at trying to adapt them to use the Gnu pth
> >> threads.
> >
> > I think Pth won't help things on OpenBSD versions which already use
> > kernel threads (5.2+), and unlikely to have helped earlier versions
> > with userland threads either, the problem with userland thread
> > implementations is how file descriptor blocking is handled.
> I was trying to figure out whether pth was abandoned or just mature
> enough that it doesn't need any more updates.  Looks like it's just
> mature.  I was suspicious that it was somebody's thesis project.

It's not all that much needed now that most unix-like OS have posix
threads support..

> Your patch/diff for the cmake stuff works fine under OpenBSD, but not
> under Linux:

bleh, silly mistake ;)

OK - just setup an fc18 box to test it; here's a fixed version.

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4b91a4b..4cc77fc 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -101,12 +101,17 @@ target_link_libraries(rtl_adsb rtlsdr_shared
 target_link_libraries(rtl_fm m)
 target_link_libraries(rtl_adsb m)
-    target_link_libraries(rtl_test m)
-    target_link_libraries(rtl_test m rt)
+check_function_exists(clock_gettime LIBRT_LIBC_HAS_CLOCK_GETTIME)
+    find_library(LIBRT_LIBRARIES NAMES rt)
+target_link_libraries(rtl_test m ${LIBRT_LIBRARIES})
 target_link_libraries(rtl_sdr libgetopt_static)

More information about the osmocom-sdr mailing list