subproc: comments
authorRobert Swiecki <robert@swiecki.net>
Fri, 9 Jun 2017 12:34:01 +0000 (14:34 +0200)
committerRobert Swiecki <robert@swiecki.net>
Fri, 9 Jun 2017 12:34:01 +0000 (14:34 +0200)
Makefile
subproc.c

index 3788aaefc35963e4737e1b7de681b70b6f018bbc..67a1992834d5a863835a7c2f4a70e8d4dfc541cc 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -152,4 +152,3 @@ subproc.o: util.h
 user.o: user.h common.h log.h subproc.h util.h
 util.o: util.h common.h log.h
 uts.o: uts.h common.h log.h
-config.pb-c.o: config.pb-c.h
index 71f7f17b635f1908716d4f84f9b03348e352affe..f2e97289af6d0837ed2be3f5756eca83e57af21f 100644 (file)
--- a/subproc.c
+++ b/subproc.c
@@ -375,7 +375,9 @@ static bool subprocInitParent(struct nsjconf_t *nsjconf, pid_t pid, int pipefd)
        return true;
 }
 
-static uint8_t subprocCloneStack[PTHREAD_STACK_MIN * 2];
+/* Will be used inside the child process only, so it's save to have it in BSS */
+static uint8_t subprocCloneStack[128 * 1024]; /* 128 KiB */
+/* Cannot be on the stack, as the child's stack pointer will change after clone() */
 static __thread jmp_buf env;
 
 static int subprocCloneFunc(void *arg __attribute__ ((unused)))
@@ -385,7 +387,7 @@ static int subprocCloneFunc(void *arg __attribute__ ((unused)))
 }
 
 /*
- * Avoid problems with caching of PID/TID in glibc - when using syscall(__NR_clone) glibc will
+ * Avoid problems with caching of PID/TID in glibc - when using syscall(__NR_clone) glibc doesn't
  * not update internal PID/TID caches, which can lead to invalid values returned by getpid(),
  * or wrong PID/TIDs being used in raise()/abort() functions
  */