From owner-freebsd-hackers Tue Mar 12 13: 1: 4 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from swan.prod.itd.earthlink.net (swan.mail.pas.earthlink.net [207.217.120.123]) by hub.freebsd.org (Postfix) with ESMTP id 17B8437B404 for ; Tue, 12 Mar 2002 13:01:00 -0800 (PST) Received: from pool0199.cvx15-bradley.dialup.earthlink.net ([209.179.44.199] helo=sm.socccd.cc.ca.us) by swan.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16ktOE-0004He-00 for freebsd-hackers@freebsd.org; Tue, 12 Mar 2002 13:00:58 -0800 Message-ID: <3C8E6CD5.67F23CF2@sm.socccd.cc.ca.us> Date: Tue, 12 Mar 2002 13:02:13 -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: freebsd-hackers@freebsd.org Subject: Recv() to a mmap'ed file? 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 Hi -hackers, In trying to increase throughput in a file transfer application I am working on, I wondered if it was possible to do something like (code of course edited for brevity): /* file_fd points to a regular file which is filled with SIZE nul bytes */ map_addr = mmap(NULL, size, PROT_WRITE, MAP_PRIVATE, file_fd, 0); rv = recv(sockfd, map_addr, size, MSG_WAITALL); 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? Thanks. -- Farooq To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message