Created
September 26, 2014 09:38
-
-
Save gfreezy/5daebd9ac2b916341891 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "tlpi_hdr.h" | |
int | |
main(int argc, char *argv[]) | |
{ | |
printf("Hello world\n"); | |
write(STDOUT_FILENO, "Ciao\n", 5); | |
if (fork() == -1) | |
errExit("fork"); | |
/* Both child and parent continue execution here */ | |
exit(EXIT_SUCCESS); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
./a.out
输出:
Hello world
Ciao
./a.out > /tmp/a
输出
Ciao
Hello world
Hello world