what is the difference between fork() & exec()

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of inet_aton() Function?

1072


What is the use of inet_addr() Function?

988


How does socket communication work?

494


How to look up a Service by Port and Protocol?

1123


Are udp sockets bidirectional?

486






What is the use of endprotoent(3) Function

1342


What are Nameless Sockets?

1054


What are Private IP Numbers?

896


What is the use of PF_LOCAL and SOCK_STREAM?

1205


What is AF_UNSPEC Address?

1806


Can you send and receive on the same socket at the same time?

464


How to Close Sockets?

1033


What is socket abstraction?

493


How to use the PF_LOCAL and AF_LOCAL Macros?

1073


What are sockets in linux?

503