ZONE
FEATURES
Home
News
Check Email
LEARNING ZONE
C++ Tutorial
Tutorials collection
Ask the Expert
FAQs
Refferences
ARTICLES
All articles
DOWNLOADS
Compilers
Sourcode Library
Tools/Utilities
WINDOWS
Win programing
C++ Builder
UNIX
Unix programming
Unix downloads
WEB PROGRAMMING
CGI programming
CGI Scripts
RESOURCES
Magazines
Newsletters
Mailing Lists
Courses
Links
COMMUNICATION
Message board
Chat
Communities
Organisations
C++ Groups
C++ Newsgroups
ABOUT US
Contact us
submit a resource
Privacy
Link to us
 
 
 
Home Sourcecode Systems programming Systems programming
 
fork()

The code below demonstrate the use of the unix system call fork(). The main function of this system call is to create a new process.

 #include <iostream.h>
 #include <unistd.h>
 int main(int argc, char *argv[])
{ int pid;
cout << "process start pid=" << getpid() << "\n";
pid = fork(); //create the new process
cout << "fork returned " << pid << " to " << getpid() << "\n";
}
 
 
A
Email Login
Password
New?
sign up!
 
A
Free Online tutorial & courses
 
A
Join Our Message board Discussions on C/C++
 
A
Unix Network
programming
tutorial
 
 Join Our Mailing list