Hi all,

I've been experimenting with UNIX C programming. I made a program
recently. All this (useless) program does is to print out the PID of
the process using getpid(), fork a child process, get the child to
print its PID and to print out its parent's PID using getppid() and
then exit.

The problem is that the parent's getpid() output and the child's
getppid() output do not match! getppid() always returns the number
'1'. Why is this happening?

I did the same on an AIX machine, and it worked as I expected it to.

Thanks in advance,
Ishaaq

Reply via email to