Browse Source

procd: fix compilation with uClibc-ng

_GNU_SOURCE was missing.

Also defined two macros unavailable with uClibc-ng.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
[resolved conflict in jail.c]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
Rosen Penev 3 years ago
parent
commit
aed7fb3cf2
3 changed files with 13 additions and 0 deletions
  1. 4 0
      jail/console.c
  2. 4 0
      jail/jail.c
  3. 5 0
      trace/trace.c

+ 4 - 0
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>

+ 4 - 0
jail/jail.c

@@ -46,6 +46,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:EyJ:"
 

+ 5 - 0
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>