From owner-freebsd-hackers Sun Oct 26 17:25:54 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id RAA03910 for hackers-outgoing; Sun, 26 Oct 1997 17:25:54 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from server.local.sunyit.edu (A-T34.rh.sunyit.edu [150.156.210.241]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id RAA03905 for ; Sun, 26 Oct 1997 17:25:51 -0800 (PST) (envelope-from perlsta@cs.sunyit.edu) Received: from localhost (perlsta@localhost) by server.local.sunyit.edu (8.8.7/8.8.5) with SMTP id VAA19784 for ; Sun, 26 Oct 1997 21:31:01 -0500 (EST) X-Authentication-Warning: server.local.sunyit.edu: perlsta owned process doing -bs Date: Sun, 26 Oct 1997 21:31:01 -0500 (EST) From: Alfred Perlstein X-Sender: perlsta@server.local.sunyit.edu To: hackers@FreeBSD.ORG Subject: Re: help with fstat? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk don't want to look a gift answer in the mouth but i don't think this is a good idea, i'm working on a distributed system for transfering files across the internet. the system is supposed to be able to manage a large load of file transfers over TCP. if i mmap tons of files across many processes i think i will cause a large amount of unnessesary paging, as most of the files will be in the 200k-5meg range this will be too much laod on the system. unless mmap() maps in on demand... but i think i'll be eating up all my address space... isn't fstat supposed to be what i'm looking for? i don't want to exhaust the virtual memory on the machine, just get optimal transfers. > ... > > i want to run a loop doing reads from the file into a buffer of optimal > > size... > > Don't do that. Just mmap() the file, and use memcpy(). Much more > efficient. > > Tom > >