Standards / Extensions | C or C++ | Dependencies |
---|---|---|
Single UNIX Specification, Version 2 |
both | OS/390 V2R8 |
#define _XOPEN_SOURCE 500
#include <unistd.h>
int ttyname_r(int fildes, char *name, size_t namesize);
The ttyname_r() function stores the NULL-terminated path name of the terminal associated with the file descriptor, fildes, in the character array referenced by name. The array is namesize characters long and should have space for the name and the terminating NULL character. The maximum length of the terminal name is TTY_NAME_MAX.
If successful, ttyname_r() returns 0.