Re: madvise() first draft

Jeff Garzik (jgarzik@pobox.com)
Wed, 25 Aug 1999 19:53:34 -0400


Chuck Lever wrote:
>
> copied to l-k, in case anyone else is wondering about this.
>
> On Wed, 25 Aug 1999, Jeff Garzik wrote:
> > If MADV_xxx are the same on all platforms, shouldn't they go in
> > include/linux somewhere (perhaps referenced by something in asm-arch/*)
> > ?
>
> most of the stuff in include/asm/mman.h is the same for all platforms, i
> believe, so i was following precedent there.

Understand, but arch already has wads of duplicate code and constants ;)

> according to man pages from other OSes like Solaris and HP/UX, sys/mman.h
> is where applications are supposed to get those macros, and
> include/asm/mman.h is the place to put things that are in the sys/mman.h
> user level header.

Did you check how things are set up on a Linux system?

On RH6.0, sys/mman.h includes bits/mman.h, and so references no kernel
code at all. On RH5.2, sys/mman.h includes linux/mman.h, which in turn
includes asm/mman.h.

Either way a common location for these constants seems desireable. If
there are platform-specific differences you can always provide a default
set of constants in include/linux, and override them with arch-specific
code if need be.

Jeff

-- 
"Nuclear war can ruin your whole compile."
                -- Karl Lehenbauer

- 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/