On Mon, Jun 30, 2014 at 11:31 AM, Mark Kettenis <mark.kette...@xs4all.nl> wrote: > Yes, I'm saying that this should affect POSIX's standardization. > Solaris is where mmap(2) came from.
The full history is a bit more complicated though. From what I've managed to uncover over the past few days so far: mmap() "first appeared" in 4.1cBSD [mmap.2] and was scheduled for inclusion in 4.2BSD (1983) [UVM thesis, p36], but didn't "actually appear" until the 1993 4.4BSD release [UVM thesis, p36]. In the mean time, it was independently reimplemented for SunOS 4 [UVM thesis, p36], and released in 1988 [Wikipedia]. However, SunOS didn't implement MAP_ANON, and instead required users to pass a file descriptor for /dev/zero. In 1994 (prior to Linux's 1.0 release), Linus added support for MAP_ANONYMOUS [https://kernel.googlesource.com/pub/scm/linux/kernel/git/nico/archive/+/0b5e8609bf7e6899c1fea30aa467812d488b6c11%5E%21/#F3]. SunOS 5.8 (Feb 2000) added support for MAP_ANON [http://www.freebsd.org/cgi/man.cgi?query=mmap&apropos=0&sektion=0&manpath=SunOS+5.8&arch=default&format=html]. I'm not sure when it added MAP_ANONYMOUS support. Also according to Wikipedia, HP-UX is an SVR2 derivative and AIX is an SVR3 derivative. SVR2 and SVR3 were released in 1984 and 1986, respectively, so neither should have inherited MAP_ANON/MAP_ANONYMOUS from SVR/SunOS. I'm not sure when they picked them up. > Also, look at: > > <https://github.com/sgminer-dev/sgminer/blob/master/m4/mmap-anon.m4> Yeah, I've seen that, though despite the comment pointing out MAP_ANON is more common, it instead adds a "#define MAP_ANONYMOUS MAP_ANON" if it notices MAP_ANONYMOUS isn't provided. So ironically, that macro package's widespread use is indicative of code that uses MAP_ANONYMOUS instead of MAP_ANON. :-/