This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: second call to mmap() results in error


On 1/30/2014 2:46 PM, Lavrentiev, Anton (NIH/NLM/NCBI) [C] wrote:

OP privately wrote:

The problem is also fixed by correct type-casting in the calls to mmap() ...

  mmap1 = mmap(NULL, (size_t) 524304, PROT_WRITE | PROT_READ, MAP_SHARED,
shm_fd1, 0);

The address returned from the call to mmap() -- with or without the
ftruncate() -- was bad without the (size_t) specification.

(note "with or without ftruncate()")

And I ask again (last time, I promise), how on Earth adding <unistd.h> to
the code below would make the code suddenly working?  (Like I said before,
that code worked for me, with -Wall showing nothing, from the very beginning.)

OK, I didn't realize you were asking Steve specifically, on list, to
clarify a statement he made to you in a private message.  And now that I
recognize which code you've been thinking about when you've been asking
questions throughout this thread, I can only tell you the behavior I see
with it, which doesn't match yours if I understand correctly what you've
been seeing.  That said, it really doesn't matter what I see if you want to
know more details specifically from Steve.  Given that, I'll bow out of
this thread.

--
Larry

_____________________________________________________________________

A: Yes.
> Q: Are you sure?
>> A: Because it reverses the logical flow of conversation.
>>> Q: Why is top posting annoying in email?

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]