This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] PPC64 enable hp-timing 3rd try
- From: Benjamin Herrenschmidt <benh at kernel dot crashing dot org>
- To: Roland McGrath <roland at redhat dot com>
- Cc: Steven Munroe <munroesj at us dot ibm dot com>, libc-alpha at sources dot redhat dot com, Tom Gall <tgall at us dot ibm dot com>, Dwayne McConnell <decimal at us dot ibm dot com>
- Date: Mon, 31 Oct 2005 12:20:22 +1100
- Subject: Re: [PATCH] PPC64 enable hp-timing 3rd try
- References: <20051031011851.18CD41809DA@magilla.sf.frob.com>
On Sun, 2005-10-30 at 17:18 -0800, Roland McGrath wrote:
> You can't be calling malloc in there. (clock_gettime is reentrant.)
> A small stack buffer is fine, you just have to read in a loop.
> The i386 code ought to do the same, in case of zillions of CPUs.
Yup, a loop with a little care in case the string you search is half
way over two read's... like a buffer of 8k, read one half, memmove, read
one, memmove, ... That way, you always have the current one appended to
the previous one, and unless you string is gigantic, it should work.
Ben.