Re:Compiler bug? Linker bug? Windows Kernel bug
by gpderetta on Monday February 26, 2018 @10:34AM
(#16465948)
Not sure what UNIX variant are you thinking, but from POSIX:
> The mmap() function adds an extra reference to the file associated with the file descriptor fildes which is not removed by a subsequent close() on that file descriptor. This reference is removed when there are no more mappings to the file.
I'm sure there have been unix variants that got it wrong and might not even have been in posix from the beginning (it is there since at least SUSv2); still I think this is traditional unix behavior.
It is implementation defined on the UNIX OS variant and mounted file system.
The beauty of POSIX is how it appears to be portable, while leaving quite a few things being implementation defined.