9base

revived minimalist port of Plan 9 userland to Unix
git clone git://git.suckless.org/9base
Log | Files | Refs | README | LICENSE

testfork.c (337B)


      1 #include <lib9.h>
      2 
      3 void
      4 sayhi(void *v)
      5 {
      6 	USED(v);
      7 
      8 	print("hello from subproc\n");
      9 	print("rendez got %lu from main\n", rendezvous(0x1234, 1234));
     10 	exits(0);
     11 }
     12 
     13 int
     14 main(int argc, char **argv)
     15 {
     16 	print("hello from main\n");
     17 	ffork(RFMEM|RFPROC, sayhi, nil);
     18 
     19 	print("rendez got %lu from subproc\n", rendezvous(0x1234, 0));
     20 	exits(0);
     21 }