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