mremap

This is a discussion on mremap within the Linux Programming forums, part of the Platform Specific Boards category; Hi, anyone knows if mremap round off the new_memory parameter or it has to be done manually?...

  1. #1
    Registered User
    Join Date
    Nov 2006
    Posts
    3

    mremap

    Hi,

    anyone knows if mremap round off the new_memory parameter or it has to be done manually?

  2. #2
    .
    Join Date
    Nov 2003
    Posts
    307
    What do you mean by round off - page align?

  3. #3
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Hmm ...
    Code:
    ~ $> man mremap
    
    SYNOPSIS
           #define _GNU_SOURCE
           #include <unistd.h>
           #include <sys/mman.h>
    
           void * mremap(void *old_address, size_t old_size , size_t new_size, int
           flags);
    What new_memory are you talking about? Do you mean new_size? Or the new_address you may pass if you specify the MREMAP_FIXED flag?

    I would strongly assume that new_address must be page-aligned already, since the same requirement applies to mmap()'s start parameter.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21