diff options
-rw-r--r-- | manifest | 2 | ||||
-rw-r--r-- | openssl/agent/pkcs11/agent.cxx | 16 |
2 files changed, 15 insertions, 3 deletions
@@ -13,7 +13,7 @@ doc-url: https://build2.org/doc.xhtml src-url: https://git.build2.org/cgit/openssl-agent/tree/ email: users@build2.org build-warning-email: builds@build2.org -builds: host : &linux ; Currently only supported on Linux. +builds: host : &( +linux +freebsd ); Currently only supported on Linux and BSD. requires: c++14 depends: * build2 >= 0.15.0- depends: * bpkg >= 0.15.0- diff --git a/openssl/agent/pkcs11/agent.cxx b/openssl/agent/pkcs11/agent.cxx index 8d61208..273414e 100644 --- a/openssl/agent/pkcs11/agent.cxx +++ b/openssl/agent/pkcs11/agent.cxx @@ -6,6 +6,20 @@ #include <sys/socket.h> #include <signal.h> // kill(), sigaction(), sigemptyset(), SIG* + +// _NSIG is Linux-specific but *BSD appear to have NSIG/_NSIG. +// +#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) +# include <sys/signal.h> +# ifndef _NSIG +# ifdef NSIG +# define _NSIG NSIG +# else +# error neither _NSIG nor NSIG defined +# endif +# endif +#endif + #include <unistd.h> // fork(), getpid(), dup2(), setsid() #include <termios.h> // tcgetattr(), tcsetattr() @@ -235,8 +249,6 @@ namespace openssl // future versions. Thus, we will provide our own implementation of the // function that is inspired by the openssh implementation. // - // Note: _NSIG is Linux-specic. - // static volatile sig_atomic_t received_signals[_NSIG]; extern "C" void |