From: Nick Bowler <nbowler@elliptictech.com>
To: "Sébastien Paumier" <sebastien.paumier@univ-mlv.fr>
Cc: linux-kernel@vger.kernel.org
Subject: Re: PROBLEM: getpid() returning same value as getppid()
Date: Wed, 26 May 2010 11:16:51 -0400 [thread overview]
Message-ID: <20100526151651.GA21197@elliptictech.com> (raw)
In-Reply-To: <4BFD33F0.1060908@univ-mlv.fr>
On 16:45 Wed 26 May , Sébastien Paumier wrote:
> Hi,
> here is a bug that occurs on my kernel 2.6.31-21, maybe with older ones.
> If a C program contains a function with the constructor attribute that
> calls getpid(), then, a call to syscall(SYS_fork) produces a son that
> obtains the same value calling getpid() or getppid().
The GNU C library caches the results of getpid, which is probably the
cause of your grief. This cache relies on the glibc wrappers for fork
and friends, which you have bypassed by using syscall directly.
--
Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/)
next prev parent reply other threads:[~2010-05-26 15:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-26 14:45 PROBLEM: getpid() returning same value as getppid() Sébastien Paumier
2010-05-26 15:16 ` Nick Bowler [this message]
2010-06-02 15:02 ` Michal Hocko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100526151651.GA21197@elliptictech.com \
--to=nbowler@elliptictech.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sebastien.paumier@univ-mlv.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox