Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
OSS Library Calls (a - d) ctermid_r(3)
NAME
ctermid_r - Generates the pathname for the controlling 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 <stdio.h>
[#include <spthread.h>] /* Required if using Standard POSIX Threads Library */
char *ctermid_r(
char *s);
PARAMETERS
s Indicates where to store the returned pathname. If the s parameter is a null
pointer, the function returns a null character string.
If the s parameter is not a null pointer, it points to a character array of at least
L_ctermid bytes. The symbolic constant L_ctermid is defined in the stdio.h
header file and has a value greater than 0 (zero). The pathname is placed in this
array and the value of the s parameter is returned.
DESCRIPTION
The ctermid_r( ) function is the reentrant version of the ctermid( ) function.
The ctermid_r( ) function generates the pathname to the controlling terminal for the current pro-
cess and stores it in a string.
The ctermid_r( ) function differs from the ttyname( ) function in that the ttyname( ) function is
supplied a file descriptor and returns the actual name of the terminal associated with that file
descriptor, while the ctermid_r() function returns a string (/dev/tty) that refers to the controlling
terminal if used as a pathname. ctermid_r() returns a pathname, which can be used in the
open( ) function to access the controlling terminal (if a controlling terminal exists). The existence
of a controlling terminal is checked in open( ). The ttyname( ) function returns the pathname of
a terminal type file descriptor.
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:
527187-017 Hewlett-Packard Company 1−167