Re: A zvt fork question
- From: zucchi zedzone mmc com au (NotZed)
- To: hp redhat com (Havoc Pennington)
- Cc: aurag crm umontreal ca (Hassan Aurag), gnome-devel-list gnome org
- Subject: Re: A zvt fork question
- Date: Thu, 16 Dec 1999 09:17:56 +1030 (CST)
> Hassan Aurag <email@example.com> writes:
> > then I get two numbers, the exit number which is 0 for success and
> > before it "usually" (sometimes after it" the pid number.
> Grab your favorite UNIX book and read about fork(). You have two
> processes after the fork; each does the "print pid". The parent's pid
> variable is the child's pid, the child's pid variable is 0.
Yes that is exactlty right, the return value is identical to fork().
If the pid==0, you are in the child, otherwise you are in the parent.
Only if it is -1 was there an error (usually memory or process limits
You shouldn't need the pid for resource usage tracking anyway, you
can just attach data to the (or indexed by the) zvt widget, for example,
because it can only ever have one child. And the zvt widget
tracks the 'child' resource as well.
] [Thread Prev