gpfs_ireadlink() subroutine

Reads a symbolic link by inode number.

GPFS Library (libgpfs.a for AIX®, libgpfs.so for Linux®)

#include <gpfs.h>
int gpfs_ireadlink(gpfs_fssnap_handle_t *fssnapHandle,
                  gpfs_ino_t ino, 
                  char *buffer, 
                  int bufferSize);

The gpfs_ireadlink() subroutine reads a symbolic link by inode number. Like gpfs_iopen(), it uses the same fssnapHandle parameter that was used by the inode scan.

Note: Compile any program that uses this subroutine with the -lgpfs flag from the following library:
  • libgpfs.a for AIX
  • libgpfs.so for Linux
fssnapHandle
File system snapshot handle.
ino
inode number of the link file to read.
buffer
Pointer to buffer for the returned link data.
bufferSize
Size of the buffer.

If the gpfs_ireadlink() subroutine is successful, it returns the number of bytes read.

If the gpfs_ireadlink() subroutine is unsuccessful, it returns a value of -1 and sets the global error variable errno to indicate the nature of the error.

None.

Error codes include but are not limited to the following:

EINVAL
Missing or incorrect parameter.
ENOENT
No such file or directory.
ENOMEM
Unable to allocate memory for the request.
ENOSYS
The gpfs_ireadlink() subroutine is not available.
EPERM
The caller does not have superuser privileges.
ERANGE
On AIX, the buffer is too small to return the symbolic link.
ESTALE
Cached file system information was not valid.
GPFS_E_INVAL_FSSNAPHANDLE
The file system snapshot handle is not valid.

/usr/lpp/mmfs/lib/libgpfs.a for AIX

/usr/lpp/mmfs/lib/libgpfs.so for Linux