what is the difference between fork() & exec()
Answers were Sorted based on User's Feedback
Answer / nitin
fork() creates a child process with most of the attributes
of the parent process. Both parent and child processes are
exec() replaces the current process with a the executable
pointed by the function. Control never returns to the
original program unless there is an exec() error.
|Is This Answer Correct ?||89 Yes||6 No|
Answer / laxman masadi
fork: Create a new process
exec: replace a process's objectcode with contents of file
|Is This Answer Correct ?||53 Yes||10 No|
Answer / alka
fork() creates a new process where exec() not....
exec() shares memory of parent here fork() process operates
|Is This Answer Correct ?||41 Yes||15 No|
Answer / amit
what is the difference between fork() & exec()?
fork() creates a new child process and subsequently a new
entry in process table is made for the new process.
exec(), if successful, replaces the existing text segnent
of the process with that of new process. and hence, the old
process does not exists in the system any more. i dont
think, any new entry is created in the process table after
|Is This Answer Correct ?||17 Yes||3 No|
Answer / anand
fork() created a newly independent process that has it's own
space in memory and also has own permission depends upon
what you assign
Using exec() the created process is a sub thread of calling
process. They also share area in memory and so that also
share all permission and resources.
|Is This Answer Correct ?||7 Yes||2 No|
Answer / mahitha
fork creates a new process where the childs and the parents
address space wil be different
wen we use exec system cal,the child wil be made to share
the pages of the parent..also the permissions wil be shared
between the 2.
|Is This Answer Correct ?||6 Yes||3 No|
Answer / gopi
fork() is used to creat new process.but execl() is used to load another application....see before going to load new,exexl() try to remove all data about old process..like old-----pid,vad,resourse
|Is This Answer Correct ?||0 Yes||1 No|
Answer / antony.t
fork() will create a new process and its a system call API its return values are- if fork created new process(child process), its pid will be returned, if it failed to create returns -1.
exec() is also a system call API but this will load a application, if exec() succeeds it will not return anything but 'll return -1 if it gets failed to load application...
|Is This Answer Correct ?||1 Yes||2 No|
Answer / dheeraj gahtori
processes began through a process called "fork and exec".
that is when one command starts another, the child process
first forks , the kernel copying over pages of memory from
the present process to a new location for the child process.
The child then execs, executing the new command and
overwriting the data
|Is This Answer Correct ?||8 Yes||17 No|
Answer / chander
fork() creates a new process
exec() excecte the process
|Is This Answer Correct ?||7 Yes||36 No|
Are sockets full duplex?
What are Reserved IP Numbers?
How to test socket connection in linux?
How to Write a UDP Datagram Client?
How to Specify an X.25 Address?
What is socket linux?
What is the use of PF_LOCAL and SOCK_STREAM?
How to Obtaine the Socket Address?
How to Specify the Domain of a Socket?
What is socket file in linux?
What is the difference between socket & port?
HOW TCP/IP Handles Duplicated Packets?