HP-UX Reference (11i v2 07/12) - 7 Device (Special) Files, 9 General Information, Index (vol 10)

p
pty(7) pty(7)
otherwise cause the process to jump to an installed signal handler. Signals are not
postponed if they would otherwise cause the process to abort or if they are being
ignored. When the server process completes the handshake by means of the
TIOCREQSET ioctl() request, the process returns to the calling program and any
pending signals are then acted upon. Any signals that the user has blocked by means
of sigblock() continues to be blocked.
TIOCSIGABORT
Prevent a trapped
open() or ioctl() request from being restarted. The server
process sets this mode when it wants the interrupted requests to return to the calling
program with an [EINTR] error.
TIOCSIGNORMAL
This is the default mode of the pty
. If a signal interrupts a trapped open() or
ioctl() request, the user’s signal handler routine can specify whether the request
is to be restarted. If the request is restarted, it executes again from the beginning
and the server has to make another TIOCREQGET
request to start the handshake
over again. If the user’s signal handler routine specifies that the interrupted request
should not be restarted, the request returns to the calling program with [EINTR]
upon completion of the signal handler. Note that the restarted request is not neces-
sarily the very next one to be trapped.
The following
ioctl() requests, defined in <sys/ptyio.h>
, provide a mechanism to get and set pty
modes. Five of the modes can also be manipulated using other ioctl() requests discussed previously.
See the bit definitions for the ioctl() equivalents. The effect of enabling or disabling them by either
means is identical. Commonly, an application would use the TIOCGMODES ioctl() to get the pty
modes currently in effect, set or clear the bits for the modes being changed, and issue a
TIOCGMODES
ioctl()
to effect the desired change.
TIOCGMODES Get the pty modes currently in effect. The ioctl() returns in a long referenced by arg
bits indicating the states of various
pty modes. If a bit is set, the associated mode is
enabled. If a bit is clear, the associated mode is disabled. Unused bits are clear. The
meaning of the bits is described under the description of the TIOCSMODES ioctl().
TIOCSMODES Set the pty modes according to the value of type long referenced by arg. Unused bits are
ignored but should be set to zero. The bit values for
pty modes are listed below.
PM_REMOTE
Enable or disable remote mode. See the discussion of the TIOCREMOTE ioctl().
PM_TTY
Enable or disable tty mode. See the discussion of the TIOCTTY ioctl().
PM_PKT
Enable or disable packet mode. See the discussion of the TIOCPKT ioctl().
PM_TRAP
Enable or disable trap mode. See the discussion of the TIOCTRAP ioctl().
PM_MONITOR
Enable or disable monitor mode. See the discussion of the TIOCMONITOR
ioctl()
.
PM_OPEN_ERROR
Enable or disable open error mode. Open error mode allows a server process to
return an error to a trapped slave pty open() through the TIOCREQSET
ioctl()
. When open error mode is enabled, the server may return a trapped
open() with an error by setting the errno_error field in the request_info
structure passed to the TIOCREQSET ioctl(). When open error mode is disabled
(the default state), setting errno_error to handshake a slave open() has no
effect. Note that unlike the ioctl() trap handshaking, setting return_value
has no effect for a slave open() regardless of the state of open error mode. See the
discussion of the TIOCREQSET ioctl() for further details on handshaking a
trapped request.
WARNINGS
The slave side cannot indicate an end-of-file condition to the master side.
132 Hewlett-Packard Company 7 HP-UX 11i Version 2: December 2007 Update