pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

libevent on QNX 6.5.0


   I need libevent on QNX 6.5.0, and there isn't much one needs to
change to build it.  However, there's are two quirks:

   - I saw some hints that getopt.h may be available in later QNX 7, but
I haven't confirmed it.
   - Commenting out SA_RESTART breaks some rather important semantics.
That said:  Apparently in earlier versions of QNX SA_RESTART was defined
but was silently ignored -- so if one is a snarky mood one could argue
there's prior art..  :/

   There are a few suggestions in various corners of the Internet about
how to create a general purpose work-around for the missing SA_RESTART,
but QNX have stated that it isn't supported _yet_, so I think everyone
is simply waiting for them to implement it.

Kind Regards,
QNX 6.5.0 doesn't support SA_RESTART.
This is not a fix, it's just a workaround which breaks signal semantics.

--- signal.c.orig	2017-09-18 00:10:26.660872338 +0200
+++ signal.c	2017-09-18 00:10:42.172654093 +0200
@@ -252,7 +252,9 @@
 	memset(&sa, 0, sizeof(sa));
 	sa.sa_handler = handler;
+#ifndef __QNX__
 	sa.sa_flags |= SA_RESTART;
 	if (sigaction(evsignal, &sa, sig->sh_old[evsignal]) == -1) {
QNX 6.5.0 doesn't have getopt.h; it has it in unistd.h, hidden behind
the macro __EXT_POSIX2.

--- test/bench_cascade.c.orig	2017-09-18 00:26:37.612694305 +0200
+++ test/bench_cascade.c	2017-09-18 00:27:09.424117803 +0200
@@ -45,10 +45,15 @@
 #include <stdio.h>
 #include <string.h>
+#ifdef __QNX__
+#define __EXT_POSIX2
 #include <unistd.h>
 #include <errno.h>
+#ifndef __QNX__
 #include <getopt.h>
 #include <event.h>
 #include <evutil.h>

Home | Main Index | Thread Index | Old Index