PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.c > Urgent : fork()
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Urgent : fork()

Réponse
 
LinkBack Outils de la discussion
Vieux 01/02/2008, 01h24   #1
AK
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Urgent : fork()

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
  Réponse avec citation
Vieux 01/02/2008, 01h38   #2
Walter Roberson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Urgent : fork()

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
  Réponse avec citation
Vieux 01/02/2008, 01h40   #3
AK
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Urgent : fork()

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
  Réponse avec citation
Vieux 01/02/2008, 02h40   #4
Keith Thompson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Urgent : fork()

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"
  Réponse avec citation
Vieux 02/02/2008, 02h03   #5
AK
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Urgent : fork()

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
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 11h14.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,17463 seconds with 13 queries