ptm.7 (2010 09)

p
ptm(7) ptm(7)
ISPTM Determines whether the file descriptor is that of an open master device. On success, it
returns the major and minor number (type dev_t) of the master device which can be used
to determine the name of the corresponding slave device. On failure, it returns 1 with
errno set to [EINVAL].
ISPTM on HP-UX can return valid device number with negative
value. For example, with major number of the STREAMS pty master being 0x9c,
ICPTM
will return 0x9C000000 which is a negative number. Therefore, it is imperative that
applications check for an explicit 1 instead of "< 0" (less than 0) on the return value.
ISPTM is used by functions grantpt(),
unlockpt(), and ptsname(). User appli-
cations normally do not need to invoke this ioctl. The format of this ioctl is:
int ioctl(master_fd, ISPTM, 0)
UNLKPT Unlocks the master and the corresponding slave devices. On success, it returns 0. On
failure, it returns 1 with errno set to [EINVAL].
UNLKPT is used by function
unlockpt(). User applications normally do not need to invoke this ioctl. The format
of this ioctl is:
int ioctl(master_fd, UNLKPT, 0)
TIOCREMOTE This ioctl puts the STREAMS pty in and out of Remote Mode. When Remote Mode is on,
input data will be flow-controlled and passed through
ldterm without any input pro-
cessing regardless of the terminal mode. When the pty master driver receives this ioctl,
it will send an
M_CTL message downstream to ldterm via ptm, pts, and ptem
. The
command in the
M_CTL message is set to MC_NO_CANON or MC_DO_CANON depending
whether to turn on or off the Remote Mode. The format of this ioctl is:
int ioctl(master_fd, TIOCREMOTE, argument)
where the argument is set to 1 to turn on Remote Mode and 0 to turn it off. Remote Mode
is normally used when doing remote line editing in a window manager, or whenever
flow-controlled input is required. Each write to the master device produces a record
boundary for the process reading the slave devices. In normal usage, a write of data is
like the data typed as a line on the terminal; a write of 0 (zero) bytes is like typing an
EOF (End-of-File) character.
TIOCSIGNAL This ioctl allows the master process to send a signal to the slave process. The format of
this ioctl is:
int ioctl(master_fd, TIOCSIGNAL, argument)
where the argument is the signal number as defined in the header file
<sys/signal.h>. For example the master process can send an
SIGINT signal to the
slave process by doing:
ioctl(master_fd, TIOCSIGNAL, SIGINT)
AUTHOR
ptm was developed by HP and OSF.
FILES
/dev/ptmx Streams pty master clone device
/dev/pts/N Streams pty slave devices (0 <= N < NSTRPTY), where NSTRPTY is a kernel tunable
parameter which can be changed via SAM.
SEE ALSO
insf(1M), getmsg(2), ioctl(2), open(2), read(2), write(2), grantpt(3C), ptsname(3C), unlockpt(3C), clone(7),
ldterm(7), pckt(7), ptem(7), pts(7), streamio(7), termio(7).
2 Hewlett-Packard Company 2 HP-UX 11i Version 3: September 2010