mmap(2) fails if you pass 0 as an argument for `length` parameter, so this case has to be handled as a special case. This is needed by Gentoo's media-plugins/calf-0.90.3-r1 package.