Pseudo-terminal (PTY)
PASE for i supports both AT&T and Berkeley Software Distributions (BSD) style devices. From a programming perspective, these devices work in PASE for i in the same way that they work on AIX®.
PASE for i allows a maximum of 1024 instances for AT&T style devices, and a maximum of 592 BSD style devices. When the system is started, the first 32 instances of each device type are created automatically.
Configuring PTY devices in PASE for i
On AIX, an administrator uses smit to configure the number of available devices of each type. In PASE for i, these devices are configured in the following way:
- For AT&T-style devices, PASE for i supports autoconfiguration. If the first 32 instances are in use and an application tries to open another instance, the CHRSF device is created in the integrated file system automatically, up to the limit of 1024 devices.
- For BSD-style devices, you must create the CHRSF devices manually,
using the PASE for i mknod utility.
To do this, you need to know the major numbers for the BSD subordinate
and BSD primary devices as well as the naming convention. The following
example shell script shows how to create additional BSD pseudo-terminal
(PTY) devices. It creates them in groups of 16.Note: By using the code examples, you agree to the terms of the Code license and disclaimer information.
#!/QOpenSys/usr/bin/ksh prefix="pqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" bsd_tty_major=32949 bsd_pty_major=32948 if [ $# -lt 1 ] then echo "usage: $(basename $0) ptyN " exit 10 fi function mkdev { if [ ! -e $1 ] then mknod $1 c $2 $3 chown QSYS $1 chmod 0666 $1 fi } while [ "$1" ] do N=${1##pty} if [ "$N" = "$1" -o "$N" = "" -o $N -lt 0 -o $N -gt 36 ] then echo "skipping: \"$1\": not valid, must be in the form ptyN where: 0 <= N <= 36" shift continue fi minor=$((N * 16)) pre=$(expr "$prefix" : ".\{$N\}\(.\)") echo "creating /dev/[pt]ty${pre}0 - /dev/[pt]ty${pre}f" for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f do echo ".\c" mkdev /dev/pty${pre}${i} $bsd_pty_major $minor echo ".\c" mkdev /dev/tty${pre}${i} $bsd_tty_major $minor minor=$((minor + 1)) done echo "" shift done
For more information about PTY devices, see the AIX Resources Web page.