*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->OpenBSD man pages -> mprotect (2)              
Title
Content
Arch
Section
 

MPROTECT(2)

Contents


NAME    [Toc]    [Back]

     mprotect - control the protection of pages

SYNOPSIS    [Toc]    [Back]

     #include <sys/types.h>
     #include <sys/mman.h>

     int
     mprotect(void *addr, size_t len, int prot);

DESCRIPTION    [Toc]    [Back]

     The mprotect() system call changes the  specified  pages  to
have protection
     prot.   Not all implementations will guarantee protection on
a page basis;
     the granularity of protection changes may be as large as  an
entire region.


     The  protections (region accessibility) are specified in the
prot argument
     by OR'ing the following values:

     PROT_EXEC   Pages may be executed.

     PROT_READ   Pages may be read.

     PROT_WRITE  Pages may be written.

     PROT_NONE   No permissions.

RETURN VALUES    [Toc]    [Back]

     Upon successful completion, a value of 0 is returned.   Otherwise, a value
     of -1 is returned and errno is set to indicate the error.

SEE ALSO    [Toc]    [Back]

      
      
     madvise(2), mincore(2), msync(2), munmap(2)

HISTORY    [Toc]    [Back]

     The mprotect() function first appeared in 4.4BSD.

OpenBSD      3.6                           June      9,      1993
[ Back ]
 Similar pages
Name OS Title
minherit OpenBSD control the inheritance of pages
minherit NetBSD control the inheritance of pages
minherit FreeBSD control the inheritance of pages
vm_page_protect FreeBSD lower a page's protection
pmap_protect FreeBSD set physical page protection
pts OpenBSD Manage AFS protection database
mprotect IRIX set protection of memory mapping
pmap_page_protect FreeBSD set physical page protection
fbtab OpenBSD change device protection upon login
fbtab FreeBSD change device protection upon login
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service