On Wed, Mar 15, 2000 at 10:24:27AM -0800, Richard Henderson wrote:
> On Wed, Mar 15, 2000 at 07:16:48PM +0100, Andrea Arcangeli wrote:
> > Do you know how the madvise syscall works on OSF/1? That matters to be
> > binary compatible.
> 
> #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_COMPAT    4       /* for backward compatibility */
> #define MADV_SPACEAVAIL 5               /* ensure resources are available */
> #define MADV_DONTNEED   6               /* dont need these pages */
> 
> Dunno what the difference between 4 and 6 are.
> 
> 
> r~
> 

Here's what I found on a DU 4.0 system:

madvise(2)                                                         madvise(2)



NAME

  madvise - Advise the system of the expected paging behavior of a process

SYNOPSIS

  #include <sys/types.h>
  #include <sys/mman.h>
  int madvise (
          caddr_t addr,
          size_t len,
          int behav );

PARAMETERS

  addr      Specifies the address of the region to which the advice refers.

  len       Specifies the length in bytes of the region specified by the addr
            parameter.

  behav     Specifies the behavior of the region.  The following values for
            the behav parameter are defined in the sys/mman.h header file:

            MADV_NORMAL
                      No further special treatment

            MADV_RANDOM
                      Expect random page references

            MADV_SEQUENTIAL
                      Expect sequential references

            MADV_WILLNEED
                      Will need these pages

            MADV_DONTNEED
                      Do not need these pages

                      The system will free any whole pages in the specified
                      region.  All modifications will be lost and any swapped
                      out pages will be discarded.  Subsequent access to the
                      region will result in a zero-fill-on-demand fault as
                      though it is being accessed for the first time.
                      Reserved swap space is not affected by this call.

            MADV_SPACEAVAIL
                      Ensure that resources are reserved

DESCRIPTION

  The madvise() function permits a process to advise the system about its
  expected future behavior in referencing a mapped file or shared memory
  region.

NOTES

  Only a few values of the behav parameter values are operational on Tru64
  UNIX systems.  Non-operational values cause the system to always return
  success (zero).

RETURN VALUES

  Upon successful completion, the madvise() function returns zero.  Other-
  wise, -1 is returned and errno is set to indicate the error.

ERRORS

  If the madvise() function fails, errno may be set to one of the following
  values:

  [EINVAL]  The behav parameter is invalid.

  [ENOSPC]  The behav parameter specifies MADV_SPACEAVAIL and resources can-
            not be reserved.

RELATED INFORMATION

  Functions: mmap(2)


--Jay++

-----------------------------------------------------------------------------
Jay A Estabrook                            Alpha Engineering - LINUX Project
Compaq Computer Corp. - MRO1-2/K20         (508) 467-2080
200 Forest Street, Marlboro MA 01752       [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to