Le specifiche POSIX dicono che
Per cui credo che per scrivere un'applicazione portabile tu debba necessariamente fare lo stat (eventualmente ricorsivamente) del percorso a cui punta il link simbolico e verificare lì se effettivamente si tratta di un file o una directory.For symbolic links, the st_mode member shall contain meaningful information, which can be used with the file type macros described below, that take a mode argument. The st_size member shall contain the length, in bytes, of the pathname contained in the symbolic link. File mode bits and the contents of the remaining members of the stat structure are unspecified. The value returned in the st_size field shall be the length of the contents of the symbolic link, and shall not count a trailing null if one is present.