readlink

Reads the contents of a symbolic link.

Library:LibC
Classification:Single UNIX
Service:File and Directory I/O

Syntax

  #include <unistd.h> 
   
  int readlink (
      const char   *path,
      char         *buf,
      size_t        bufsize );
  

Parameters

path

(IN) Points to the symbolic link.

buf

(IN/OUT) Points to the buffer into which the contents of the symbolic link are placed.

bufsize

(IN) Specifies the size of the buffer in the buf parameter.

Return Values

If successful, returns the number of bytes placed in the buffer. Otherwise, returns -1, leaves the buffer unchanged, and sets errno to one of the following.

Decimal

Constant

Description

66

ENOSYS

This operation is not supported.

Remarks

The readlink function is not supported on NetWare. It is included and coded to return ENOSYS so that code ported from other platforms can compile. Currently, it is not able to function meaningfully on NetWare.