github.com/mvdan/u-root-coreutils@v0.0.0-20230122170626-c2eef2898555/pkg/strace/test/fork.c (about)

     1  #include <stdio.h>
     2  #include <sys/types.h>
     3  #include <unistd.h>
     4  
     5  int main() {
     6    pid_t pid = fork();
     7    if (pid == 0) {
     8      printf("child\n");
     9    } else {
    10      printf("parent\n");
    11    }
    12    return 0;
    13  }