> Date: Thu, 26 Jun 2014 12:28:18 -0700 > From: Matthew Dempsky <matt...@dempsky.org> > > I just reviewed our mmap(2) flags to compare them against Linux, > FreeBSD, Solaris, and Darwin's flags. Of the flags listed below, none > of them are specified by POSIX, and none of them do anything > interesting on OpenBSD: MAP_COPY just gets rewritten to MAP_PRIVATE, > and the rest are silently ignored by UVM. > > Linux FreeBSD Solaris Darwin > MAP_COPY no YES* no YES* > MAP_RENAME no YES* YES* YES* > MAP_NORESERVE YES YES* YES YES* > MAP_INHERIT no YES** no no > MAP_NOEXTEND no no no YES* > MAP_HASSEMAPHORE no YES*** no YES*** > MAP_TRYFIXED no no no no
MAP_TRYFIXED is a NetBSD'ism. The others are inherited straight from 4.4BSD. > So MAP_NORESERVE is perhaps necessary/worth keeping around, but the > others seem like candidates for removal if nothing in ports needs > them. I think that MAP_NORESERVE should indeed be kept. > MAP_HASSEMAPHORE is used in rthread_sem.c, but it doesn't do anything, > so I suspect it's just cargo culting based on man page misinformation? > Are there architectures that actually have restrictions on semaphore > memory? There architectures where atomic instructions only work on pages with certain caching attributes. Those attributes tend to be the default attributes though, so there is not much value in retaining this flag.