@node __internal_readlink, io @findex __internal_readlink @subheading Syntax @example #include int __internal_readlink(const char * path, int fhandle, char * buf, size_t max) @end example @subheading Description In general applications shouldn't call this function; use @code{readlink} instead (@pxref{readlink}). However, there is one exception: if you have a @code{FSEXT} @code{fstat} file handler, and do not want do anything special about symlinks. In this case you should call this function from your handler to set properly @code{S_IFLNK} bit in @code{st_mode}. This function operates on either @var{path} @strong{or} @var{fhandle}. In any case, the other arg should be set to @code{NULL} or 0. @subheading Return Value Number of copied characters; value -1 is returned in case of error and @code{errno} is set. When value returned is equal to @var{size}, you cannot determine if there was enough room to copy whole name. So increase @var{size} and try again. @subheading Portability @portability !ansi, !posix @subheading Example @example char buf[FILENAME_MAX + 1]; if (__internal_readlink(0, "/dev/env/DJDIR/bin/sh.exe", buf, FILENAME_MAX) == -1) if (errno == EINVAL) puts("/dev/env/DJDIR/bin/sh.exe is not a symbolic link."); @end example