:On Sat, May 13, 2000 at 12:08:35PM -0700, Matthew Dillon wrote:
:>     The linux mremap() is an idiotic system call.  Just unmap the file and
:>     re-mmap it.
:If you are just appending to the file, you can skip the munmap. mmap deletes
:the old mappings.
:       -Arun

    There are a thousand ways to do it, which is why linux's mremap() 
    syscall is stupid.

    * simply mmap() a larger block in the first place.  For example,
      if you have a 16K file mmap() 1MB.  You will seg fault on pages
      that are beyond the file EOF, but those pages will become valid
      the moment the file is extended into them without having to lift
      a finger.

    * mmap() the tail end of the newly extended file without removing or
      overwriting the previous mmap, by specifying an absolute address.

    * munmap() and re-mmap() the file.

    * Don't depend on a single monolithic mmap(), it won't work for files
      larger then 2-3GB anyway (on intel architecture), instead mmap the
      file in chunks on an as-needed basis.

                                        Matthew Dillon 
                                        <[EMAIL PROTECTED]>

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to