|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi everyone,
Please check out this query that I have in : http://groups.google.com/group/proga...057ec587dd46b3 (its a bit long, thats why I am not typing it again; please do check that link) and please do respond... I know there are quite a number of members of progav in here... This is one query I need resolved asap... So, please do ... Regards AK |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
In article <4214cf2f-6bee-4532-95a8-8183bd5f49bb@q39g2000hsf.googlegroups.com>,
AK <anoopkammaran@gmail.com> wrote: >Please check out this query that I have in : [a google group, not a usenet group] >(its a bit long, thats why I am not typing it again; please do check >that link) >and please do respond... I know there are quite a number of members of >progav in here... This is one query I need resolved asap... fork() is off topic for comp.lang.c as it is an operating system routine, not part of the C language. [OT] POSIX.1 1989 says, The fork() function creates a new process. The new process (child process) shall be an exact copy of the calling process (parent process) except for the following: (3) The child process has its own copy of the parent's file descriptors. Each of the child's file descriptors refer to the same open file description with the corresponding file descriptor of the parent. And -none- of the other differences enumerated have to do with I/O (except for directory streams.) Notice that bit about *exact* copy. And notice that file descriptions are shared. From these two facts we can conclude that there is an exact copy in each process of whatever was in the file buffers before the fork() took place. Your program prints from the file buffers in both processes, so anything that was in the file buffers is going to be printed in both processes. If you need to have something in the file buffer output before a fork(), you should be using fflush() before the fork(). [/OT] Your program also ends its output with a printf string that does not end in a '\n'. C leaves it as implementation defined as to whether the last line of output will actually be output if the last line does not end in '\n'. Your program might output the last line on some systems but not output it on other systems. -- This is a Usenet signature block. Please do not quote it when replying to one of my postings. http://en.wikipedia.org/wiki/Signature_block |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On Feb 1, 6:24am, AK <anoopkamma...@gmail.com> wrote:
> Hi everyone, > > Please check out this query that I have in :http://groups.google.com/group/proga...ead/29057ec587... > > (its a bit long, thats why I am not typing it again; please do check > that link) > > and please do respond... I know there are quite a number of members of > progav in here... This is one query I need resolved asap... So, please > do ... > > Regards > AK BTW, I would prefer if you could post in the thread whose link is provided above... But, I'l leave it up to you... To post in that thread membership is required... So, for non-member of progav, you can post here... For members of progav in here, please post in that thread... Regards AK |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
AK <anoopkammaran@gmail.com> writes:
> Please check out this query that I have in : > http://groups.google.com/group/proga...057ec587dd46b3 > > (its a bit long, thats why I am not typing it again; please do check > that link) > > and please do respond... I know there are quite a number of members of > progav in here... This is one query I need resolved asap... So, please > do ... fork() is not a standard C function. Try asking in comp.unix.programmer. If you choose to post there, I suggest posting the article rather than a link to it. It's not that long, and I presume you have some sort of copy-and-paste facility available to you. In fact, you would have been better off using copy-and-paste when you posted to progav; your first #include directive is misspelled as "#Include". Re-typing code is never a good idea; it's impossible to tell which errors were in your original code, and which you introduced by re-typing it. -- Keith Thompson (The_Other_Keith) <kst-u@mib.org> Nokia "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister" |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
On Feb 1, 7:40am, Keith Thompson <ks...@mib.org> wrote:
> AK <anoopkamma...@gmail.com> writes: > > Please check out this query that I have in : > >http://groups.google.com/group/proga...ead/29057ec587... > > > (its a bit long, thats why I am not typing it again; please do check > > that link) > > > and please do respond... I know there are quite a number of members of > > progav in here... This is one query I need resolved asap... So, please > > do ... > > fork() is not a standard C function. Try asking in > comp.unix.programmer. Thank you very much... > If you choose to post there, I suggest posting the article rather than > a link to it. It's not that long, and I presume you have some sort of > copy-and-paste facility available to you. In fact, you would have > been better off using copy-and-paste when you posted to progav; your > first #include directive is misspelled as "#Include". Re-typing code > is never a good idea; it's impossible to tell which errors were in > your original code, and which you introduced by re-typing it. > Please accept my apologies... AK |
|
![]() |
| Outils de la discussion | |
|
|