From owner-freebsd-hackers Tue Mar 12 21:56:31 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from harrier.prod.itd.earthlink.net (harrier.mail.pas.earthlink.net [207.217.120.12]) by hub.freebsd.org (Postfix) with ESMTP id 58EA437B417 for ; Tue, 12 Mar 2002 21:56:26 -0800 (PST) Received: from pool0764.cvx14-bradley.dialup.earthlink.net ([209.179.40.254] helo=sm.socccd.cc.ca.us) by harrier.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16l1kJ-0007ey-00; Tue, 12 Mar 2002 21:56:20 -0800 Message-ID: <3C8EEA50.C3E17315@sm.socccd.cc.ca.us> Date: Tue, 12 Mar 2002 21:57:36 -0800 From: Farooq Mela X-Mailer: Mozilla 4.76 [en] (X11; U; FreeBSD 4.2-RELEASE i386) X-Accept-Language: en MIME-Version: 1.0 To: Alfred Perlstein Cc: freebsd-hackers@freebsd.org Subject: Re: Recv() to a mmap'ed file? References: <3C8E6CD5.67F23CF2@sm.socccd.cc.ca.us> <20020312214851.GK92565@elvis.mu.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Alfred Perlstein wrote: > > * Farooq Mela [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. -- Farooq To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message