--- src/lib/libc/sys/madvise.2 2007/07/30 22:11:33 1.6 +++ src/lib/libc/sys/madvise.2 2008/10/06 21:01:37 1.7 @@ -33,11 +33,12 @@ .\" $FreeBSD: src/lib/libc/sys/madvise.2,v 1.17.2.8 2003/01/06 23:33:59 trhodes Exp $ .\" $DragonFly$ .\" -.Dd December 12, 2006 +.Dd October 6, 2008 .Dt MADVISE 2 .Os .Sh NAME .Nm madvise , +.Nm posix_madvise , .Nm mcontrol .Nd give advice about use of memory .Sh LIBRARY @@ -48,6 +49,8 @@ .Ft int .Fn madvise "void *addr" "size_t len" "int behav" .Ft int +.Fn posix_madvise "void *addr" "size_t len" "int behav" +.Ft int .Fn mcontrol "void *addr" "size_t len" "int behav" "off_t value" .Sh DESCRIPTION The @@ -56,6 +59,9 @@ system call allows a process that has knowledge of its memory behavior to describe it to the system. The +.Fn posix_madvise +interface is identical and is provided for standards conformance. +The .Fn mcontrol system call is an extension of .Fn madvise @@ -147,17 +153,29 @@ the specified area of memory. The entir management should be specified. You may encounter unexpected effects if you only set the page directory page for part of the mapping. .El +.Pp +Portable programs that call the +.Fn posix_madvise +interface should use the aliases +.Dv POSIX_MADV_NORMAL , POSIX_MADV_SEQUENTIAL , +.Dv POSIX_MADV_RANDOM , POSIX_MADV_WILLNEED , +and +.Dv POSIX_MADV_DONTNEED +rather than the flags described above. .Sh RETURN VALUES -.Rv -std madvise mcontrol +.Rv -std madvise posix_madvise mcontrol .Sh ERRORS The -.Fn madvise +.Fn madvise , +.Fn posix_madvise , and .Fn mcontrol functions will fail if: .Bl -tag -width Er .It Bq Er EINVAL -The virtual address range specified by the +The +.Fa behav +argument is not valid or the virtual address range specified by the .Fa addr and .Fa len @@ -168,6 +186,11 @@ arguments is not valid. .Xr mprotect 2 , .Xr msync 2 , .Xr munmap 2 +.Sh STANDARDS +The +.Fn posix_madvise +interface conforms to +.St -p1003.1-2001 . .Sh HISTORY The .Fn madvise