pty.7 (2010 09)

p
pty(7) pty(7)
errno_error can be used to return an error for trapped slave
pty
open() requests. See the discussion of the
TIOCSMODES ioctl() for
further information on open error mode.
return_value
The success value (initialized to zero) returned by
ioctl() on the slave
side when
errno_error is not set.
When the
ioctl() argument received on the slave side is not a pointer,
its value is stored as four bytes retrievable with an
ioctl() request to
the master side equal to
argget.
When an
open() or close() is being passed,
request is set to
TIOCOPEN or TIOCCLOSE, respectively. For
TIOCOPEN and TIOC-
CLOSE, both argget and argset are zero because there is no
ioctl() structure. When TIOCTTY is enabled, the termio (7)
definition of open/close is executed first before being passed to the master
side. Note that while all opens are trapped, only the last close on a par-
ticular inode for a
pty slave side is trapped by the
pty.
A
TIOCREQCHECK returns the external variable errno error [EINVAL]
if no ioctl(), open(),orclose()
trap is pending. Accordingly, a
TIOCREQCHECK that returns [EINVAL] in response to a select()
"exceptional condition" indicates that the trapped
ioctl(), open(),or
close() request was terminated by a signal after select() returned.
TIOCREQGET Identical to TIOCREQCHECK except when no ioctl(), open(),orclose() trap is
pending. A TIOCREQGET blocks until a slave side ioctl(), open(),orclose() is
trapped; whereas a TIOCREQCHECK returns [EINVAL]. Use TIOCREQGET
when nei-
ther the preferred method of a
select() "exceptional condition" nor the master side
ioctl() TIOCTRAPSTATUS is available.
TIOCREQSET Complete the handshake started by a previous TIOCREQCHECK or TIOCREQGET. The
argument should point to the request_info structure, as defined by the
TIOCREQCHECK.
Before doing this
ioctl() request to complete the handshake, the server should set
errno_error to an external variable errno error value to be passed back to the slave
side. If there is no error, errno_error can be left alone because the pty initializes it
to zero. Also, when there is no error, return_value should be set if other than a zero
result is desired. The server can set return_value and errno_error if the trapped
request is an ioctl() and may set errno_error for a trapped open() if open error
mode is enabled. Setting either return_value or errno_error for a trapped
close() affects neither the return value of the request nor the external variable errno
value of the slave side. Setting either return_value or errno_error for a trapped
open() affects neither the return value of the request nor the external variable errno
value of the slave side unless open error mode is enabled. Open error mode allows the
server to return an error to a trapped slave open() by setting errno_error. Unlike
ioctl() requests, setting return_value never affects slave pty open() requests.
Further, setting either return_value or errno_error does not cause TIOCREQSET
to return an error to the server.
If the
TIOCREQSET request is made and the request value in the passed
request_info structure does not equal the trapped value, the external variable
errno is set and returned as [EINVAL]. [EINVAL] is also returned if there are no
trapped ioctl(), open(),orclose() requests. If the trapped request has been
interrupted by a signal between the time that the server has done the TIOCREQGET and
the TIOCREQSET, the TIOCREQSET request returns [EINVAL].
TIOCGFLAGS Get the file status flags associated with a trapped request. Upon successful return, the
ioctl() returns in an integer referenced by arg the file status flags for the trapped
request. The flag definitions in <sys/file.h> can be used to interpret the flags. If no
trap is currently pending, the TIOCGFLAGS ioctl() returns an error with the exter-
nal variable errno set to [EINVAL].
TIOCMONITOR
Enable or disable read-only trapping of termio ioctl() requests. TIOCMONITOR
HP-UX 11i Version 3: September 2010 5 Hewlett-Packard Company 5