diff --git a/include/libwebsockets.h b/include/libwebsockets.h index c60b87dcc..544a9db5d 100644 --- a/include/libwebsockets.h +++ b/include/libwebsockets.h @@ -147,6 +147,10 @@ typedef unsigned long long lws_intptr_t; #endif #endif +#if defined(__FreeBSD__) +#include +#endif + #if defined(__GNUC__) /* warn_unused_result attribute only supported by GCC 3.4 or later */ diff --git a/lib/plat/unix/unix-spawn.c b/lib/plat/unix/unix-spawn.c index 9d2d20759..894a17186 100644 --- a/lib/plat/unix/unix-spawn.c +++ b/lib/plat/unix/unix-spawn.c @@ -435,7 +435,11 @@ lws_spawn_piped(const struct lws_spawn_piped_info *i) if (lsp->info.disable_ctrlc) /* stops non-daemonized main processess getting SIGINT * from TTY */ +#if defined(__FreeBSD__) + setpgid(0, 0); +#else setpgrp(); +#endif if (lsp->child_pid) {