1
0
Fork 0
mirror of https://gitlab.com/sortix/sortix.git synced 2023-02-13 20:55:38 -05:00

Store init process pid in INIT_PID environmental variable.

This commit is contained in:
Jonas 'Sortie' Termansen 2013-06-15 16:32:41 +02:00
parent 740187674a
commit f8f65d5713

View file

@ -34,6 +34,11 @@
int child()
{
pid_t init_pid = getppid();
char init_pid_str[sizeof(pid_t)*3];
snprintf(init_pid_str, sizeof(pid_t)*3, "%ju", (uintmax_t) init_pid);
setenv("INIT_PID", init_pid_str, 1);
const char* programname = "sh";
const char* newargv[] = { programname, NULL };