It is not Solaris specific issue, look at open(2) manpage in Linux (e.g. ,http://linux.die.net/man/2/open), including just sys/fcntl.h is not enough, it works on some Linux distros only because of luck. It is not about some ifdef, it is about POSIX.

btw, the proposed patch above is overkill
it is sufficient to only change sys/fcntl.h to fcntl.h.
there are no other missing symbols.

i can tell this for sure since musl doesnt expose any superfluous symbols, unlike glibc which has the habit of including other headers (e.g. stdio.h there pulls in stdlib.h which is a namespace violation)