💾 Archived View for thrig.me › tech › buffork.c captured on 2023-11-14 at 09:27:36.

View Raw

More Information

⬅️ Previous capture (2023-04-26)

-=-=-=-=-=-=-

// buffork - buffer across a fork (bad)

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

int
main(void)
{
	pid_t pid;
	printf("buffered in %d\n", getpid());
	pid = fork();
	if (pid == -1) abort();
	printf("after in %d\n", getpid());
	exit(0);
}