ref: 8a4a2dea70aa77475a50968f4c5bd6cdab5d2fb1
dir: /sys/src/cmd/cwfs/proc.c/
#include "all.h" #include "io.h" void newproc(void (*f)(void *), void *arg, char *text) { int kid = rfork(RFPROC|RFMEM|RFNOWAIT); if (kid < 0) sysfatal("can't fork: %r"); if (kid == 0) { procsetname("%s", text); (*f)(arg); exits("child returned"); } }