Re: madvise() first draft

Chuck Lever (cel@monkey.org)
Wed, 25 Aug 1999 22:06:18 -0400 (EDT)


On Wed, 25 Aug 1999, Jeff Garzik wrote:
> > 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 ;)

i really don't want to pull on that chain! if people agree on a new
precedent, i'll be happy to follow it.

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

right -- i didn't expect that the user-level headers would include any
kernel headers. they will likely have duplicate definitions of the MADV
macros, just like everything else.

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

i agree, but i'm not sure madvise is the place to start. it would be
confusing to have madvise work that way, but nothing else. in other
words, what you are proposing seems like a bigger project that i don't
want madvise to get stuck behind, if you know what i mean. on the other
hand, i'm not familiar with how new system call stuff gets added to glibc
and user-level headers, so it may not be difficult at all.

- Chuck Lever

--
corporate:	<chuckl@netscape.com>
personal:	<chucklever@netscape.net> or <cel@monkey.org>

The Linux Scalability project: http://www.citi.umich.edu/projects/linux-scalability/

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