ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzalf_5.4.0.1/rzalfpty.htm

114 lines
5.2 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="concept" />
<meta name="DC.Title" content="Pseudo-terminal" />
<meta name="abstract" content="i5/OS PASE supports both AT&amp;T and Berkeley Software Distributions (BSD) style devices. From a programming perspective, these devices work in i5/OS PASE in the same way that they work on AIX." />
<meta name="description" content="i5/OS PASE supports both AT&amp;T and Berkeley Software Distributions (BSD) style devices. From a programming perspective, these devices work in i5/OS PASE in the same way that they work on AIX." />
<meta name="DC.Relation" scheme="URI" content="rzalfinteract.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 2000, 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2000, 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rzalfpty" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>Pseudo-terminal</title>
</head>
<body id="rzalfpty"><a name="rzalfpty"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Pseudo-terminal</h1>
<div><p><span class="keyword">i5/OS™</span> PASE supports
both AT&amp;T and Berkeley Software Distributions (BSD) style devices. From
a programming perspective, these devices work in <span class="keyword">i5/OS</span> PASE
in the same way that they work on AIX<sup>®</sup>.</p>
<p><span class="keyword">i5/OS</span> PASE allows a
maximum of 1024 instances for AT&amp;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.</p>
<div class="section"><h4 class="sectiontitle">Configure PTY devices in <span class="keyword">i5/OS</span> PASE</h4><p>On AIX,
an administrator uses <tt>smit</tt> to configure the number of available devices
of each type. In <span class="keyword">i5/OS</span> PASE,
these devices are configured in the following way:</p>
<ul><li>For AT&amp;T-style devices, <span class="keyword">i5/OS</span> PASE
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.</li>
<li>For BSD-style devices, you must create the CHRSF devices manually, using
the <span class="keyword">i5/OS</span> PASE <tt>mknod</tt> 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.<div class="note"><span class="notetitle">Note:</span> By using the code
examples, you agree to the terms of the <a href="codedisclaimer.htm">Code license and disclaimer information</a>.</div>
<pre>#!/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 &lt;= N &lt;= 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
</pre>
</li>
</ul>
<p>For more information about PTY devices, see the <a href="http://www.ibm.com/servers/aix/library/" target="_blank">AIX documentation</a> Web
site.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzalfinteract.htm" title="As you customize your i5/OS PASE programs to use i5/OS functions, you need to consider the ways in which your program will interact with them.">How i5/OS PASE programs interact with i5/OS</a></div>
</div>
</div>
</body>
</html>