09-20-05 11:05 PM
"Vinu" <vinuwarrier@yahoo.com> writes:
Please use cross-posting instead of multi-posting.
> mSize is the size which I want to allocate
Casper knows *that*. What he asks is what is the *value* of mSize?
> When I used it like this
>
> pBase =(Ptr) mmap(0, mSize,PROT_NONE,MAP_PRIVATE,-1,0); the error is
>
> EBADF(Bad file number)
That's right. If you want to use -1 as the fd, you *must* have
MAP_ANONYMOUS in the flags.
Try this:
pBase = (Ptr)mmap(0, mSize, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
[ Post a follow-up to this message ]
|