#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>

int
main(void)
{
	pid_t ret;

	ret = fork();

	if(ret == 0)
	{
		printf("[%d] Hello, this is the child\n", getpid());
	}
	else if(ret > 0)
	{
		printf("[%d] Hello, this is the parent, child's pid is %d\n",
		       getpid(), ret);
	}
	else
	{
		fprintf(stderr, "fork(): %s\n", strerror(errno));
	}

	printf("[%d] Both the parent and the child will print this\n",
	       getpid());
}
