Re: 2.2.10-ac7 compile errors on Alpha

Matthew Wilcox (Matthew.Wilcox@genedata.com)
Fri, 2 Jul 1999 22:10:51 +0200


On Fri, Jul 02, 1999 at 07:53:40PM +0100, Alan Cox wrote:
> > 1) SLAB_DEBUG_SUPPORT (in mm/slab.c) does not work on Alpha (or any
> > other non-i386 architecture, I presume) for lack of a memchr()
>
> Care to submit a memchr 8)

For the architectures which don't have it, let's have a na\"\ive one in C.
Since it's debug code, who cares, right?

void *memchr(const void *s, int c, size_t n)
{
while (n-- != 0) {
if (c == (char *)s++) {
return s-1;
}
}
return NULL;
}

-- 
Matthew Wilcox <willy@bofh.ai>
"Windows and MacOS are products, contrived by engineers in the service of
specific companies. Unix, by contrast, is not so much a product as it is a
painstakingly compiled oral history of the hacker subculture." - N Stephenson

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/