About fork()

S

satya

fork() does't return 2 vaule. it return only one vaule. on success it
returns '0' and of failure it returns '--ve' value.
 
S

santosh

satya said:
fork() does't return 2 vaule. it return only one vaule. on success it
returns '0' and of failure it returns '--ve' value.

Correction, it returns the child-process id to the parent process.
And, it returns 0 to the child process.

On failure, it returns -(ve) value only to the parent process, which is
logical as no child process is created.
 
K

Keith Thompson

satya said:
fork() does't return 2 vaule. it return only one vaule. on success it
returns '0' and of failure it returns '--ve' value.

If you're going to post a followup, please don't start a new thread.

If you're going to discuss fork(), please post to
comp.unix.programmer, not comp.lang.c.

Thanks.
 
R

Randy Howard

santosh wrote
(in article
Correction, it returns the child-process id to the parent process.

Correction, it can return anything, because it's not part of
standard C. On my Whizbang3 OS, it returns an array of pointers
to foods best eaten with a fork, and takes an optional parameter
to include spork matches in the results.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,175
Messages
2,570,942
Members
47,490
Latest member
Finplus

Latest Threads

Top