__realpath_chk

Name

__realpath_chk -- return the canonicalized absolute pathname, with buffer overflow checking

Synopsis

#include <stdlib.h>

char * __realpath_chk(const char * path, char * resolved_path, size_t resolved_len);

Description

The interface __realpath_chk() shall function in the same way as the interface realpath(), except that __realpath_chk() shall check for buffer overflow before computing a result. If an overflow is anticipated, the function shall abort and the program calling it shall exit.

The parameter resolved_len specifies the size of the string resolved_path. If resolved_len is less than PATH_MAX, then the function shall abort, and the program calling it shall exit.

The __realpath_chk() function is not in the source standard; it is only in the binary standard.