subproc: comments

This commit is contained in:
Robert Swiecki 2017-06-09 14:34:01 +02:00
parent fbf5b76ef8
commit 6e21eaa0da
2 changed files with 4 additions and 3 deletions

View File

@ -152,4 +152,3 @@ subproc.o: util.h
user.o: user.h common.h log.h subproc.h util.h user.o: user.h common.h log.h subproc.h util.h
util.o: util.h common.h log.h util.o: util.h common.h log.h
uts.o: uts.h common.h log.h uts.o: uts.h common.h log.h
config.pb-c.o: config.pb-c.h

View File

@ -375,7 +375,9 @@ static bool subprocInitParent(struct nsjconf_t *nsjconf, pid_t pid, int pipefd)
return true; 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 __thread jmp_buf env;
static int subprocCloneFunc(void *arg __attribute__ ((unused))) 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(), * 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 * or wrong PID/TIDs being used in raise()/abort() functions
*/ */