Open System Services Library Calls Reference Manual (G06.27+, H06.04+)

realpath(3) OSS Library Calls Reference Manual
NAME
realpath - Resolves pathname
LIBRARY
G-series native OSS processes: /G/system/sysnn/zosshsrl
H-series OSS processes: /G/system/zdllnnn/zosshdll
SYNOPSIS
#include <stdlib.h>
char *realpath(
const char *le_name,
char *resolved_name);
PARAMETERS
file_name Is a pointer to a pathname that is to be converted to an absolute pathname.
resolved_name Is a pointer to a buffer where the resolved pathname can be stored.
DESCRIPTION
The realpath() function takes the pathname pointed to by the ile_name parameter and derives an
absolute pathname for that same le. This absolute pathname does not include ".", "..", or sym-
bolic links among its components. It is stored in the buffer pointed to by the resolved_name
pointer and can have a maximum length of PATH_MAX bytes.
NOTES
The realpath() function can be called by native processes only.
RETURN VALUES
On successful completion, the realpath() function returns a pointer to the absolute pathname
derived. Otherwise, it returns a null pointer and sets errno to indicate the error, leaving the con-
tents of the buffer pointed to by the resolved_name pointer undened.
ERRORS
If any of the following conditions occur, the realpath() function sets errno to the corresponding
value:
[EACCES] Read or search permission was denied for a component of the pathname pointed
to by le_name.
[EINVAL] Either the le_name parameter or the resolved_name parameter was a null
pointer.
[EIO] An error occurred while reading from the le system.
[ELOOP] When resolving lename, too many symbolic links were encountered.
[ENAMETOOLONG]
The pathname pointed to by either the le_name parameter or the resolved_name
parameters was longer than PATH_MAX bytes or a pathname component was
longer than NAME_MAX bytes. Also, pathname resolution of a symbolic link
produced an intermediate result whose length exceeds PATH_MAX.
[ENOENT] A component of the pathname pointed to by the le_name parameter names a
nonexistent le, or the le_name parameter points to an empty string.
568 Hewlett-Packard Company 527187-004