Internationalization and localization tools


File and Path Function

int ttyname_r(int filedes, char *buf, size_t len);

Internationalization (I18n) Function Overview

The ttyname_r function is similar to the ttyname function except that it is re-entrant by placing its result into the user-specified buffer starting at buf with length len.

The function returns 0 if successful; otherwise an error number is returned. The following errno errors are defined for this function:
EBADF - the filedes argument is not a valid file descriptor;
ENOTTY - the filedes is not associated with a terminal;
ERANGE - the buffer length len is too small to store the string to be returned.

There is no wide-character version of the function.

I18n Issues

On ANSI UTF-16 platforms, use a conversion function to convert the return from ttyname_r to a wide-character string.

See Pathnames for a discussion of path and filename considerations in an internationalized application.

Recommended Replacements*

*If you're already using the recommended function, see I18n Issues for other reasons why Globalyzer is detecting the function.

File and Path Functions

 

Lingoport internationalization and localization services and software