Description
For compatibility reasons, Solaris historically had its header files setup so that, unless specifically requested through specific header defines, either the old pre-POSIX interfaces or POSIX.1c Draft 6 interfaces were used. However, in the case of rust, since these symbols are linked directly instead of via system header files, the underlying posix symbol name can be used directly instead.
Therefore, in the case of readdir_r and sigwait, rust should explicitly link to __posix_readdir_r and __posix_sigwait respectively.
Secondly, the definitions of getpwnam_r and getpwuid_r are also based on the historical interfaces provided for backwards compatibility by Solaris instead of the POSIX interfaces. There is no reason to use these historical interfaces and in fact, the respective man pages heavily discourage such use.
These definitions should be corrected to match what they do on almost every other platform.
Changing these definitions as proposed is compatible with both commercial releases of Solaris and older opensource-based derivatives.
I will provide a pull request shortly. Be aware this is a breaking change in terms of interface for any crates / consumers of these interfaces for Solaris.