Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
ttyname_r(3) OSS Library Calls Reference Manual
NAME
ttyname_r - Gets the name of a terminal (reentrant)
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
32-bit H-series and J-series OSS processes that do not use Standard POSIX Threads: |
/G/system/zdllnnn/zossfdll
64-bit H-series and J-series OSS processes that do not use Standard POSIX Threads: |
/G/system/zdllnnn/yossfdll
H-series and J-series OSS processes that use the Standard POSIX Threads Library:
/G/system/zdllnnn/zsptdll
(See NOTES)
SYNOPSIS
#include <unistd.h>
[#include <spthread.h>] /* Required if using Standard POSIX Threads Library */
int ttyname_r(
int filedes,
char *name,
size_t namesize);
PARAMETERS
filedes Specifies an open file descriptor.
name Points to the buffer to receive the pathname.
namesize Specifies the length of name passed in bytes.
DESCRIPTION
The ttyname_r( ) function is the reentrant version of the ttyname( ) function.
The ttyname_r( ) function stores the null-terminated pathname of the terminal associated with
the file descriptor filedes in the character array referenced by the name parameter. The array is
namesize characters long and should have space for the pathname and the terminating null char-
acter. The maximum length of the terminal name is TTY_NAME_MAX.
NOTES
On systems running H-series RVUs earlier than H06.21, J-series RVUs earlier than J06.10, or
G-series RVUs (native OSS processes only), follow the instructions for using the Standard
POSIX Threads library.
On systems running H06.21 or later H-series RVUs or J06.10 or later J-series RVUs, you can use
either the POSIX User Thread Model library or the Standard POSIX Threads library for threaded
applications.
On systems running H06.24 or later H-series RVUs or J06.13 or later J-series RVUs, you can use |
this function with 32-bit applications or 64-bit applications unless you are using the Standard |
POSIX Threads Library.
If you are NOT using the Standard POSIX Threads Library (this is not a threaded application or
you are using the POSIX User Thread Model Library), you must:
• Include the unistd.h header file
If you are using the Standard POSIX Threads library, you must:
• Include the spthread.h header file
7−70 Hewlett-Packard Company 527187-017