ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/host/c++/socket++-1.10/test/tfork0.C
Revision: 1.1
Committed: Mon Feb 26 15:02:39 2001 UTC (24 years, 10 months ago) by ab11
Content type: text/plain
Branch: MAIN
CVS Tags: PROJECT_COMPLETION
Log Message:
Test programs for Networking class. Unused by the host

File Contents

# Content
1 #include <iostream.h>
2 #include <Fork.h>
3
4 static void print (char* name, pid_t child)
5 {
6 if (child) {
7 cerr << "Parent " << getppid () << "; "
8 << name << ' ' << getpid () << "; Child " << child << ";\n";
9 } else if (0) {
10 cerr << "Parent " << getppid () << "; "
11 << name << "'s child " << getpid () << ";\n";
12 }
13 }
14
15 int main (int ac, char** av)
16 {
17 Fork A (1, 1);
18
19 print ("A", A.process_id ());
20 if (A.is_child ()) {
21 sleep (120);
22 return 0x8;
23 }
24 sleep (30);
25 return 0;
26 }
27