root/lang/perl/FreeBSD-i386-Ptrace/trunk/t/vfork.c
@
31413
| Revision 31413, 319 bytes (checked in by dankogai, 4 years ago) |
|---|
| Line | |
|---|---|
| 1 | #include <stdio.h> |
| 2 | #include <stdlib.h> |
| 3 | #include <unistd.h> |
| 4 | int main(int argc, char **argv){ |
| 5 | pid_t pid; |
| 6 | fprintf(stdout, "mom:0\n"); |
| 7 | if (pid = vfork()){ /* mom */ |
| 8 | fprintf(stdout, "mom:1\n"); |
| 9 | wait(); |
| 10 | exit(0); |
| 11 | }else{ /* son */ |
| 12 | fprintf(stderr, "son:2\n"); |
| 13 | fprintf(stderr, "son:3\n"); |
| 14 | exit(0); |
| 15 | } |
| 16 | } |
Note: See TracBrowser
for help on using the browser.
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)