apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sander Striker" <stri...@apache.org>
Subject mmap bug?
Date Thu, 27 Feb 2003 13:35:51 GMT
Hi,

Using mmap to gain some performance I stumbled across the following.

$ touch empty_file

...

  rv = apr_file_open(&f, "empty_file", ...)
  rv = apr_file_info_get(&finfo, APR_FINFO_SIZE, f);
  rv = apr_mmap_create(&mm, f, 0, finfo.size, APR_MMAP_READ, ...);

  [so far rv == APR_SUCCESS the whole time]

  rv = apr_mmap_delete(mm);

  [failure, rv == 22 (EINVAL?)]

My guess is that munmap doesn't like the 0 passed in for size.  It
strikes me as odd though that mmap doesn't seem to care about that.

Is there a known issue with mmapping 0 sized files?

FYI, I'm on Linux 2.4.20, glibc 2.3.1.

Sander




Mime
View raw message