Fork of July

by Gene Michael Stover

created Tuesday, 2026 August 11
updated Tuesday, 2026 August 11

original at cybertiggyr.com/f1bd0ma.html

/index.html


#include <stdio.h>
#include <unistd.h>
#include <sys/wait.h>

int
main() {
  int wstatus;

  if (fork() == 0) {
    printf( "ju" );                     /* I'm the child */
  } else {
    wait( &wstatus );               /* I'm the parent. */
    printf( "ly\n" );
  }
  return 0;
}

Compile with “gcc -oa00 a00.c”.

Run with “./a00”.

It prints “july”.


/index.html