*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> standard/readlink (2)              


readlink(2)							   readlink(2)

NAME    [Toc]    [Back]

     readlink -	read the value of a symbolic link

SYNOPSIS    [Toc]    [Back]

     #include <unistd.h>

     int readlink(const	char *path, char *buf, size_t bufsiz);

DESCRIPTION    [Toc]    [Back]

     readlink places the contents of the symbolic link referred	to by path in
     the buffer	buf, which has size bufsiz.  The contents of the link are not
     null-terminated when returned.

     readlink fails and	the buffer remains unchanged if:

     EACCES		 Search	permission is denied for a component of	the
			 path prefix of	path.

     EACCES		 Read permission is denied on the file named by	path.

     EFAULT		 path or buf extends outside the allocated address
			 space of the process.

     EINVAL		 The named file	is not a symbolic link.

     EIO		 An I/O	error occurs while reading from	or writing to
			 the file system.

     ELOOP		 Too many symbolic links are encountered in
			 translating path.

     ENAMETOOLONG	 The length of the path	argument exceeds {PATH_MAX},
			 or the	length of a path component exceeds {NAME_MAX}
			 while _POSIX_NO_TRUNC is in effect.

     ENOENT		 The named file	does not exist.

     ENOSYS		 The file system does not support symbolic links.

NOTES    [Toc]    [Back]

     readlink updates the time of last access (see stat(2)) of the link.

     If	the buffer passed to readlink is smaller than the symbolic link	file
     being read, readlink returns only as many characters as will fit in the
     buffer.  Using a buffer of	size PATH_MAX or greater eliminates the
     possibility of reading an incomplete link value.

DIAGNOSTICS    [Toc]    [Back]

     Upon successful completion	readlink returns the number of characters
     placed in the buffer; otherwise, it returns -1 and	places an error	code
     in	errno.

									Page 1

readlink(2)							   readlink(2)

SEE ALSO    [Toc]    [Back]

     lstat(2), stat(2),	symlink(2), realpath(3).

									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
readlink Linux read value of a symbolic link
readlink NetBSD read value of a symbolic link
readlink OpenBSD read value of a symbolic link
readlink FreeBSD read value of a symbolic link
readlink HP-UX read the contents of a symbolic link
VOP_READLINK FreeBSD read the target of a symbolic link
ln Tru64 Make a hard link or a symbolic link to a file
symlink HP-UX symbolic link
readlink IRIX prints the value of a symbolic link
symlink FreeBSD symbolic link handling
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service