Re: Recv() to a mmap'ed file?

[ Available lists | Index of freebsd-hackers | Month of Mar 2002 | Week of 12 Mar 2002 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Alfred Perlstein <bright@mu.org>
Date
12 Mar 2002 22:05:56
Subject
Re: Recv() to a mmap'ed file?
Message-ID
20020313060553.GF32410@elvis.mu.org

In reply to

[ Hide this part ]
* Farooq Mela <fmela0@sm.socccd.cc.ca.us> [020312 21:56] wrote:
> Alfred Perlstein wrote:
> >
> > * Farooq Mela <fmela0@sm.socccd.cc.ca.us> [020312 13:01] wrote:
> > >
> > > Rather than the usual recv() to a fixed size buffer, write() to the
> > > file descriptor, loop, etc. However when I try to do this recv gives
> > > me back an EFAULT (bad address). Is there a limitation of the
> > > architecture which does not allows us to recv() to an mmap'ed area of
> > > a file, or is it just something which hasn't been implemented?
> >
> > You may not extend a file using mmap(2), you must use ftuncate(2)
> > or write(2).
> >
> > -Alfred
>
> I am aware of this, this is why I stated:
>
> > /* file_fd points to a regular file which is filled with SIZE nul
> > bytes */
>
> The file is already the required size.

Gah... oops :)

Have you tried the mapping with PROT_READ as well? I don't think
most arches allow for access without PROT_READ along with PROT_WRITE.

-Alfred

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Elapsed time: 0.147 seconds