ref: 2c6cc121339ade33ac5aa4b46356df1cd5469fbe
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"); } }