Back to index

glibc  2.9
munlock.c File Reference
#include <sys/types.h>
#include <sys/mman.h>
#include <errno.h>
#include <hurd.h>
#include <mach/mach_host.h>

Go to the source code of this file.


int munlock (const void *addr, size_t len)

Function Documentation

int munlock ( const void *  addr,
size_t  len 

Definition at line 29 of file munlock.c.

  mach_port_t hostpriv;
  vm_address_t page;
  error_t err;

  err = __get_privileged_ports (&hostpriv, NULL);
  if (err)
    return __hurd_fail (EPERM);

  page = trunc_page ((vm_address_t) addr);
  len = round_page ((vm_address_t) addr + len) - page;
  err = __vm_wire (hostpriv, __mach_task_self (), page, len, VM_PROT_NONE);
  __mach_port_deallocate (__mach_task_self (), hostpriv);

  return err ? __hurd_fail (err) : 0;

Here is the call graph for this function: