Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
OSS Library Calls (t - v) ttyname_r(3)
• Link your application to:
/G/system/sysnn/zsptsrl (G-series)
or
/G/system/zdllnnn/zsptdll (H-series or J-series)
• Compile your application using the #define _SPT_MODEL_ macro or an equivalent
compiler command option
If you are using this function in a threaded application on a system running H06.21 or a later H- |
series RVU or J06.10 or a later J-series RVU, or in a 64-bit application on a system running |
H06.24 or a later H-series RVU or J06.13 or a later J-series RVU, you might need to include |
additional files or use additional macros. For more information about threaded and 64-bit appli- |
cations in the OSS environment, see the Open System Services Programmer’s Guide.
RETURN VALUES
Upon successful completion, the ttyname_r( ) function returns 0 (zero). Otherwise, an error
number is returned to indicate the error and errno is set. For the possible values returned, see the
ERRORS subsection of this reference page.
ERRORS
If any of these conditions occur, the ttyname_r( ) function sets errno to the corresponding value:
[EBADF] The filedes parameter is not a valid file descriptor.
[EINVAL] The name parameter contains a null pointer.
[EISGUARDIAN]
The value used for the filedes parameter is appropriate only in the Guardian
environment.
[ENOCRE] The function was called from a process that is not using the Common Run-Time
Environment (CRE).
[ENOMEM] Static memory is not available to complete the function call.
[ENOTTY] The file associated with filedes is not a terminal.
[ERANGE] The value of namesize is smaller than the length of the string to be returned
including the terminating null character.
RELATED INFORMATION
Functions: ttyname(3).
Files: thread_safety(5).
Miscellaneous: filename(5).
STANDARDS CONFORMANCE
H06.21 and later H-series RVUs, J06.10 and later J-series RVUs
This function conforms to IEEE Std 1003.1 2004, POSIX System Application Program Interface.
The following are HP extensions to the standard:
• The errno value [EINVAL] can be returned.
Standard POSIX Threads Library
This function is an extension to the UNIX98 specification. Interfaces documented on this refer-
ence page conform to the following industry standards:
• IEEE Std 1003.1c-1995, POSIX System Application Program Interface
527187-017 Hewlett-Packard Company 7−71