This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Q: How do I tell libc to refresh it's pid cache.
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: "Eric W. Biederman" <ebiederm at xmission dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Sat, 2 Sep 2006 01:12:22 +0200
- Subject: Re: Q: How do I tell libc to refresh it's pid cache.
- References: <m1mz9me4nv.fsf@ebiederm.dsl.xmission.com>
Hi Eric,
On Wed, 30 Aug 2006 15:25:56 +0200, Eric W. Biederman wrote:
...
> Is there a good way to have glibc refresh it's pid cache besides
> calling fork an additional time?
Sure it is hack but you can
according to
glibc/nptl/sysdeps/unix/sysv/linux/getpid.c
set
(%gs:offsetof (struct pthread, pid)) = 0
by
PTRACE_POKE*
where
%gs base you get remotely by PTRACE_GET_THREAD_AREA
and you should possibly query `offsetof' from the remote program's debug info,
internal or external, unaware how to get it if it is stripped.
Regards,
Jan