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:
parent
740187674a
commit
f8f65d5713
1 changed files with 5 additions and 0 deletions
|
@ -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 };
|
||||
|
||||
|
|
Loading…
Reference in a new issue