__ttyname_r_chk

Name

__ttyname_r_chk -- return name of a terminal, with buffer overflow checking (reentrant)

Synopsis

#include <unistd.h>

int __ttyname_r_chk(int fd, char * buf, size_t buflen, size_t nreal);

Description

The interface __ttyname_r_chk() shall function in the same way as the interface ttyname_r(), except that __ttyname_r_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 buflen specifies the size of the object pointed to by buf. If buflen exceeds nreal, the function shall abort and the program calling it shall exit.

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