On Tue, Apr 25, 2006 at 04:38:02PM -0400, Greg Troxel wrote:
> NetBSD says to use MAP_FAILED, and to include sys/mman.h, which
> contains:
> 
> #define       MAP_FAILED      ((void *) -1)   /* mmap() failed */

Strange that is exactly what we use. The only place that mmaps in rwcdb
is rwcdb_file.c:file_mread. And that file includes <sys/mman.h> and even
defines MAP_FAILED the same way if it happens to be missing.

Then the mmap return is checked against MAP_FAILED in which case we set
f->map to NULL to make us fall back on the 'read into allocated memory
buffer' code.

I actually wonder how much the mmap buys us here, we clearly have the
potential for unaligned accesses and solving that will require the extra
memory copy. Reading into the pre-allocated buffer will always be
aligned.

Also the pdb database is really only accessed when a new RPC2 connection
is set up. We get the sorted list of all groups a user is a member of at
that time and associate the list with the connection. After that when we
need to check a directory ACL it is compared against the cached list.

Jan

Reply via email to