473,491 Members | 2,221 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

About fork()

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

Feb 9 '06 #1
4 3026

satya wrote:
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.

Feb 9 '06 #2
"satya" <ks***********@gmail.com> writes:
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.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Feb 9 '06 #3
Dev
Better you move to unix group and post ur comments..

Feb 9 '06 #4
santosh wrote
(in article
<11*********************@z14g2000cwz.googlegroups. com>):

satya wrote:
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.


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.
--
Randy Howard (2reply remove FOOBAR)
"The power of accurate observation is called cynicism by those
who have not got it." - George Bernard Shaw

Feb 12 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2379
by: shellcode | last post by:
the code: ------fork.c------ #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> int main() {
27
5931
by: steve | last post by:
I was given the following code, and asked what the possible outputs could be. We're learning about processes and forking. int value; int main(){ int pid, number = 1; value = 2; pid = fork();...
11
8250
by: ramu | last post by:
Hi All, We know that a c function never returns more than one value. Then how come the fork() function returns two values? How it is implemented? Regards
1
5049
by: vduber6er | last post by:
Hi I want to have a wait page while the rest of the cgi does its process, but it seems like the wait page waits till everything is complete and never appears. I've tried forking twice already as...
3
2707
by: thrillseekersforever | last post by:
The questions(A&B) are to fine no# of process running from the below codes. However, I couldn't decipher the solution. Will someone please throw some light on this? Thanks a lot!! A] void...
5
12203
by: JoeW | last post by:
Now before I go into detail I just want to say that this is purely for my own benefit and has no real world usage. I remember way back when the tool for *nix systems called forkbomb was created. I...
3
5654
by: CMorgan | last post by:
Hi everybody, I am experiencing an annoying problem with fork() and execv(). In my program I need to launch the "pppd" from a thread, so, I create a new process with fork and then in the child...
9
5248
by: Gilles Ganault | last post by:
Hello I need to launch a Python script, and fork it so that the calling script can resume with the next step will the Python script keeps running. I tried those two, but they don't work, as...
23
2109
by: student.matt | last post by:
ok i am trying to solve this little problem i have my program waits for the 1st system() call to finish before starting the next i will just throw an example of what i mean out in this example...
2
4222
by: Radz | last post by:
when the fork system call is executed, a new process is created. The original process is called the parent process whereas the new process is called the child process. The new process consists of a...
0
7115
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6978
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7154
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7190
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6858
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5451
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3086
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1392
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
280
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.