Subversion Repositories HelenOS-historic

Rev

Rev 1518 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1518 Rev 1547
Line 31... Line 31...
31
#include <unistd.h>
31
#include <unistd.h>
32
 
32
 
33
void *mmap(void  *start, size_t length, int prot, int flags, int fd,
33
void *mmap(void  *start, size_t length, int prot, int flags, int fd,
34
       off_t offset)
34
       off_t offset)
35
{
35
{
-
 
36
    int rc;
-
 
37
 
36
    if (!start)
38
    if (!start)
37
        start = as_get_mappable_page(length);
39
        start = as_get_mappable_page(length);
38
   
40
   
39
    prot |= AS_AREA_CACHEABLE;
-
 
40
   
-
 
41
//  if (! ((flags & MAP_SHARED) ^ (flags & MAP_PRIVATE)))
41
//  if (! ((flags & MAP_SHARED) ^ (flags & MAP_PRIVATE)))
42
//      return NULL;
42
//      return MAP_FAILED;
43
    if (! (flags & MAP_ANONYMOUS))
43
    if (! (flags & MAP_ANONYMOUS))
44
        return NULL;
44
        return MAP_FAILED;
45
 
45
 
46
    return as_area_create(start, length, prot);
46
    return as_area_create(start, length, prot);
47
}
47
}
48
 
48
 
49
int munmap(void *start, size_t length)
49
int munmap(void *start, size_t length)