[PATCH] procd: fix compilation with uClibc-ng

Rosen Penev rosenp at gmail.com
Wed Jun 24 19:48:54 EDT 2020


_GNU_SOURCE was missing.

Also defined two macros unavailable with uClibc-ng.

Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 jail/console.c | 4 ++++
 jail/jail.c    | 4 ++++
 trace/trace.c  | 5 +++++
 3 files changed, 13 insertions(+)

diff --git a/jail/console.c b/jail/console.c
index eacb2fa..588d241 100644
--- a/jail/console.c
+++ b/jail/console.c
@@ -11,6 +11,10 @@
  * GNU General Public License for more details.
  */
 
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
 #include <stdlib.h>
 #include <fcntl.h>
 #include <libubox/ustream.h>
diff --git a/jail/jail.c b/jail/jail.c
index 4590690..2a0391c 100644
--- a/jail/jail.c
+++ b/jail/jail.c
@@ -39,6 +39,10 @@
 #include <libubox/uloop.h>
 #include <libubus.h>
 
+#ifndef CLONE_NEWCGROUP
+#define CLONE_NEWCGROUP 0x02000000
+#endif
+
 #define STACK_SIZE	(1024 * 1024)
 #define OPT_ARGS	"S:C:n:h:r:w:d:psulocU:G:NR:fFO:T:Ey"
 
diff --git a/trace/trace.c b/trace/trace.c
index 78b99dd..93554f7 100644
--- a/trace/trace.c
+++ b/trace/trace.c
@@ -33,6 +33,11 @@
 #define PTRACE_EVENT_STOP 128
 #endif
 
+#ifndef PTRACE_EVENT_SECCOMP
+/* undefined with uClibc-ng */
+#define PTRACE_EVENT_SECCOMP 7
+#endif
+
 #include <libubox/ulog.h>
 #include <libubox/uloop.h>
 #include <libubox/blobmsg.h>
-- 
2.26.2


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
http://lists.infradead.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list