Date: Wed, 20 Dec 1995 19:57:28 -0500 (EST) From: "Marc G. Fournier" <scrappy@hub.org> To: steve hovey <shovey@buffnet.net> Cc: freebsd-questions@FreeBSD.org Subject: Re: Making more pty's Message-ID: <Pine.BSF.3.91.951220195609.15487C-100000@hub.org> In-Reply-To: <Pine.SCO.3.91.951220140440.12250A-100000@buffnet3.buffnet.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 20 Dec 1995, steve hovey wrote:
>
> I know Im pushing my luck today - but.
>
> If I want more than 32 pty's, what do I name them?
>
> I assume I keep the major number of the other ptyp and ttyp's and just
> keep incrementing the minor -
>
> But what of the names? They currently end at ttypv - would I go
> ttypw,x,y,z then ttyq0???
>
Take a look at /dev/MAKEDEV, in particular, the following section.
MAKEDEV pty1 should give you ptyq*:
pty*)
class=`expr $i : 'pty\(.*\)'`
case $class in
0) offset=0 name=p;;
1) offset=32 name=q;;
2) offset=64 name=r;;
3) offset=96 name=s;;
# Note that xterm (at least) only look at p-s.
4) offset=128 name=P;;
5) offset=160 name=Q;;
6) offset=192 name=R;;
7) offset=224 name=S;;
# This still leaves [tuTU].
*) echo bad unit for pty in: $i;;
esac
case $class in
0|1|2|3|4|5|6|7)
umask 0
eval `echo $offset $name | awk ' { b=$1; n=$2 } END { \
for (i = 0; i < 32; i++) {
c = substr("0123456789abcdefghijklmnopqrstuv", i
+ 1, 1); \
printf("rm -f tty%s%s pty%s%s; \
mknod tty%s%s c 5 %d; \
mknod pty%s%s c 6 %d; \
chown root.wheel tty%s%s pty%s%s;", \
n, c, n, c, \
n, c, b+i, \
n, c, b+i, \
n, c, n, c); \
} \
}'`
umask 77
;;
esac
;;
Marc G. Fournier | POP Mail Telnet Acct DNS Hosting
scrappy@hub.org | WWW Services Database Services | Knowledge,
soon to be: | | Information and
scrappy@ki.net | WWW: http://hub.org | Communications, Inc
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.91.951220195609.15487C-100000>
