Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

OSS Library Calls (n - r) realpath(3)
NAME
realpath - Resolves pathname
LIBRARY
G-series native OSS processes: /G/system/sysnn/zosshsrl
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zosshdll |
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/yosshdll |
SYNOPSIS
#include <stdlib.h>
char *realpath(
const char *file_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 file_name parameter and derives
an absolute pathname for that same file. 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 undefined.
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 file_name.
[EINVAL] Either the file_name parameter or the resolved_name parameter was a null
pointer.
[EIO] An error occurred while reading from the file system.
[ELOOP] When resolving filename, too many symbolic links were encountered.
[ENAMETOOLONG]
The pathname pointed to by either the file_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 file_name parameter names a
nonexistent file, or the file_name parameter points to an empty string.
527187-017 Hewlett-Packard Company 5153