This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Q: How do I tell libc to refresh it's pid cache.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]