Thread: mremap

  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,895
    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