PDA

View Full Version : mremap



forumuser06
12-03-2006, 10:56 PM
Hi,

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

jim mcnamara
12-07-2006, 09:54 AM
What do you mean by round off - page align?

CornedBee
12-07-2006, 10:16 AM
Hmm ...

~ $> 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.