[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: #define MADV_NORMAL different in kernel and glibc
From: |
Andreas Jaeger |
Subject: |
Re: #define MADV_NORMAL different in kernel and glibc |
Date: |
Sun, 28 Oct 2001 19:53:22 +0100 |
User-agent: |
Gnus/5.090004 (Oort Gnus v0.04) XEmacs/21.4 (Artificial Intelligence, i386-suse-linux) |
address@hidden writes:
> Not a bug, just an inconsistency:
>
> #defines for MADV_* are different between glibc-2.2.4 and recent linux
> kernels.
>
> Most src/linux/include/asm*/mman.h define MADV_* in hex.
> asm-alpha and asm-parisc in Linus and Alan trees use decimal.
>
> /usr/include/bits comes from glibc.
>
> address@hidden:/$ grep " MADV_" /usr/include/bits/mman.h
> # define MADV_NORMAL 0 /* No further special treatment. */
> # define MADV_RANDOM 1 /* Expect random page references. */
> # define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
> # define MADV_WILLNEED 3 /* Will need these pages. */
> # define MADV_DONTNEED 4 /* Don't need these pages. */
>
> /usr/include/asm comes from src/linux/include/asm.
>
> address@hidden:/$ grep " MADV_" /usr/include/asm/mman.h
> #define MADV_NORMAL 0x0 /* default page-in behavior */
> #define MADV_RANDOM 0x1 /* page-in minimum required */
> #define MADV_SEQUENTIAL 0x2 /* read-ahead aggressively */
> #define MADV_WILLNEED 0x3 /* pre-fault pages */
> #define MADV_DONTNEED 0x4 /* discard these pages */
>
>
> Programs like mremap04.c from the Linux Test Project that include mman.h
> give a warning like:
Those programs should not include asm/mman.h. Just remove the
inclusion of that header and use only glibc's headers.
Andreas
--
Andreas Jaeger
SuSE Labs address@hidden
private address@hidden
http://www.suse.de/~aj