From owner-freebsd-hackers Mon Jul 5 16:11: 2 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from kronos.alcnet.com (kronos.alcnet.com [63.69.28.22]) by hub.freebsd.org (Postfix) with ESMTP id DD4FB15107 for ; Mon, 5 Jul 1999 16:09:09 -0700 (PDT) (envelope-from kbyanc@alcnet.com) X-Provider: ALC Communications, Inc. http://www.alcnet.com/ Received: from kbyanc (ws-41.alcnet.com [63.69.28.41]) by kronos.alcnet.com (8.9.3/8.9.3/antispam) with SMTP id TAA32278 for ; Mon, 5 Jul 1999 19:22:27 -0400 (EDT) From: "Kelly Yancey" To: Subject: mmap question Date: Mon, 5 Jul 1999 19:19:51 -0400 Message-ID: <000101bec73c$e20e3660$291c453f@kbyanc.alcnet.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I have a quick question about mmap, hopefully someone can smack me and point out what I'm missing :) the man page says: The mmap() function causes the pages starting at addr and continuing for at most len bytes to be mapped from the object described by fd, starting at byte offset offset. If len is not a multiple of the pagesize, the mapped region may extend past the specified range. Any such extension beyond the end of the mapped object will be zero-filled. Which is fine and dandy, I'll just stat() the file to get the filesize and mmap() it. But what happens in someone comes along and replaces the file with a larger file? I understand that my view of the file will change to the new file, but only the length that I mmap()ed originally. Do I have to periodically stat() the file to determine if I need to re-mmap() it should the file size change? And if so, doesn't that partly diminish the usefulness of mmap()? I mean, sure you can edit the file as a file and they are reflected in the in-memory image, but how many edits don't change the file size? Also, in case it hasn't been notice already (I'm running -stable from May 18th), the mmap(2) manpage has a typo: it has "#include " Thanks for your help, Kelly ~kbyanc@posi.net~ FreeBSD - The Power To Serve - http://www.freebsd.org/ Join Team FreeBSD - http://www.posi.net/freebsd/Team-FreeBSD To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message