second call to mmap() results in error

Larry Hall (Cygwin) reply-to-list-only-lh@cygwin.com
Thu Jan 30 19:01:00 GMT 2014


On 1/30/2014 1:52 PM, Lavrentiev, Anton (NIH/NLM/NCBI) [C] wrote:
>> Try adding -Wall to your compile line.
>
> I did.  There was no warning (and it should not have because
> #include <sys/mman.h> is there).  Why <unistd.h> ?  It's not
> needed to compile and run the original code.

Forget mmap().  That's not the issue here.  It's ftruncate()
which is declared in unistd.h.  If 'gcc -Wall -o foo foo.c',
where foo.c is Steve's code from the link below, doesn't result
in a

foo.c:18:28: error: ‘ftruncate’ was not declared in this scope
    ftruncate(shm_fd1, 524304);

complaint, then I'd say you need to send a full problem report if
you can't find a good reason for that behavior in your environment -
<http://cygwin.com/problems.html>

<http://cygwin.com/ml/cygwin/2014-01/msg00518.html>


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



More information about the Cygwin mailing list