Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!comp-sources-3b1 From: brad@bradley.bradley.edu (Bradley E. Smith) Newsgroups: comp.sources.3b1 Subject: v01i008: Latest version of uipc code, Part01/05 Message-ID: <123389@uunet.UU.NET> Date: 20 Feb 91 01:27:36 GMT Sender: dhb@uunet.UU.NET Lines: 431 Approved: dave@galaxia.newport.ri.us X-Checksum-Snefru: 8c661d2c a285597e 202dfcf3 d78c452e Submitted-by: brad@bradley.bradley.edu (Bradley E. Smith) Posting-number: Volume 1, Issue 8 Archive-name: uipc/part01 # This is a shell archive. Remove anything before this line, # then unpack it by saving it in a file and typing "sh file". # # Wrapped by bradley!brad on Fri Feb 15 22:37:37 CST 1991 # Contents: uipc/ uipc/Makedev uipc/sysconfig.m4 uipc/Mkflop uipc/Makefile # uipc/README uipc/Files uipc/Install uipc/Remove uipc/Remove.orig # uipc/Version uipc/Name uipc/Size uipc/Fullname uipc/sysconfig.m4.B echo mkdir - uipc mkdir uipc chmod u=rwx,g=rx,o=rx uipc echo x - uipc/Makedev sed 's/^@//' > "uipc/Makedev" <<'@//E*O*F uipc/Makedev//' MODULE=pty MODULEDEVNO=`/etc/masterupd -c ${MODULE}` if [ ! ${MODULEDEVNO} ] then echo "${MODULEDEVNO} not in /etc/master file" exit 1 fi # NOTE!!!!!!!!!!!!!! # To change the number of ptys, change the value in number-ptys.h. # VVVVVVV # get the assigned device number PTYCNT=`grep NUMBER_OF_PTYS src/number-ptys.h | \ sed -e "s/#define//" -e "s/NUMBER_OF_PTYS//" -e "s/ //g"` echo "PTYCNT=$PTYCNT" > Remove cat Remove.orig >> Remove # make the pty device files echo "Making pty pseudo device files" cnt=0 for x in p q r s t u v w x y z do for y in 0 1 2 3 4 5 6 7 8 9 a b c d e f do i=$x$y if [ $cnt -ge ${PTYCNT} ] then break fi /etc/mknod /dev/pty$i c ${MODULEDEVNO}\ `expr $cnt + $PTYCNT` || : /etc/mknod /dev/tty$i c ${MODULEDEVNO} $cnt || : chown root /dev/tty$i /dev/pty$i chgrp root /dev/tty$i /dev/pty$i chmod 0666 /dev/tty$i /dev/pty$i cnt=`expr $cnt + 1` done done @//E*O*F uipc/Makedev// chmod u=rwx,g=rwx,o=rwx uipc/Makedev echo x - uipc/sysconfig.m4 sed 's/^@//' > "uipc/sysconfig.m4" <<'@//E*O*F uipc/sysconfig.m4//' ifelse(REALTIME,1,`divert(-1)') # # @(#)sysconfig.m4 1.1 (Alex Crain) 6/20/89 # # System call definition file # # each line should be a DEFSYSCALL macro, where the # arguments are the number of arguments that the # syscall expects and the syscall name. # # the syscall number for syslocal() # define(SYSL_SYSCALL, 68) # # the offset of the last known local system call. # define(SYSENT_OFFSET,18) # # the offset of the first new system call in the sysentries[] array # define(SYSENT_START,incr(SYSENT_OFFSET)) ifelse(REALTIME,1,`divert') DEFSYSCALL(3,socket) DEFSYSCALL(3,bind) DEFSYSCALL(2,listen) DEFSYSCALL(3,accept) DEFSYSCALL(3,connect) DEFSYSCALL(4,socketpair) DEFSYSCALL(1,sockpipe) DEFSYSCALL(6,sendto) DEFSYSCALL(4,send) DEFSYSCALL(6,recvfrom) DEFSYSCALL(4,recv) DEFSYSCALL(5,setsockopt) DEFSYSCALL(5,getsockopt) DEFSYSCALL(5,select) @//E*O*F uipc/sysconfig.m4// chmod u=rw,g=r,o=r uipc/sysconfig.m4 echo x - uipc/Mkflop sed 's/^@//' > "uipc/Mkflop" <<'@//E*O*F uipc/Mkflop//' echo Figuring out Size file >Size cat Files | while read a;do du -a $a; done | awk 'BEGIN {X=0}{X+=$1}END{print X}' >Size echo "Insert floppy disk and press return" read junk find `cat Files` -print | cpio -oBc > /dev/fp021 @//E*O*F uipc/Mkflop// chmod u=rwx,g=rx,o=rx uipc/Mkflop echo x - uipc/Makefile sed 's/^@//' > "uipc/Makefile" <<'@//E*O*F uipc/Makefile//' # # @(#)Makefile 1.1 (Alex Crain) 6/20/89 # SHELL=/bin/sh TAR=/usr/bin/tar # # uncomment the next 3 lines out if you want to use cc not gcc # CC=gcc # VFLAG= -v # LIB=/usr/local/lib/gcc-gnulib # # end of gcc defines Version=1.1 SOURCES=Makefile README BUGS sysconfig.m4 doc lib src test uipc all: cd src; make all CC=$(CC) VFLAG=$(VFLAG) LIB=$(LIB) cd lib; make all CC=$(CC) VFLAG=$(VFLAG) clean: cd src; make clean cd lib; make clean cd test; make clean remove: sh Remove install: all sh Install dist: clear tar cvf uipc-$(Version).tar $(SOURCES) @//E*O*F uipc/Makefile// chmod u=rw,g=r,o=r uipc/Makefile echo x - uipc/README sed 's/^@//' > "uipc/README" <<'@//E*O*F uipc/README//' See the file doc/README for information about this driver @//E*O*F uipc/README// chmod u=rw,g=r,o=r uipc/README echo x - uipc/Files sed 's/^@//' > "uipc/Files" <<'@//E*O*F uipc/Files//' Size Install Name Files Remove Remove.orig Version Fullname lib/libuipc.a pty.o support/socket_init uipc/conf.h uipc/domain.h uipc/fproto.h uipc/mbuf.h uipc/protosw.h uipc/socket.h uipc/socketvar.h uipc/un.h uipc/unpcb.h uipc/pty.h uipc/number-ptys.h @//E*O*F uipc/Files// chmod u=rw,g=r,o=r uipc/Files echo x - uipc/Install sed 's/^@//' > "uipc/Install" <<'@//E*O*F uipc/Install//' # Eric H. Herrin II # University of Kentucky Mathematical Sciences # eric@ms.uky.edu, !cbosgd!ukma!eric # # Install script for System V Pty driver SRCDIR=uipc MODULE=pty # put the module in the appropriate place cp ${MODULE}.o /etc/lddrv/${MODULE}.o chmod 700 /etc/lddrv/${MODULE}.o chown root /etc/lddrv/${MODULE}.o chgrp root /etc/lddrv/${MODULE}.o # add the entry to the /etc/master file /etc/masterupd -a char init release open close read write ioctl ${MODULE} # get the assigned device number ( cd /etc/lddrv # allocate and load the module echo "Allocating pty module with lddrv" @./lddrv -av -o ${MODULE}.o ${MODULE} if [ $? -eq 0 ] then echo "Driver ${MODULE} successfully loaded" else echo "Error: Driver ${MODULE} failed loading stage" exit 1 fi ) # load the ${MODULE} at boot time echo load the ${MODULE} at boot time echo ${MODULE} >> /etc/lddrv/drivers echo "Loading Libraries and /usr/include/uipc files" cp lib/libuipc.a /usr/lib/libuipc.a chown bin /usr/lib/libuipc.a chgrp bin /usr/lib/libuipc.a chmod 644 /usr/lib/libuipc.a echo "/usr/lib/libuipc.a loaded..." UIPC=/usr/include/uipc mkdir ${UIPC} chown bin ${UIPC} chgrp bin ${UIPC} chmod 755 ${UIPC} (cd uipc; find * -print | cpio -pvdum ${UIPC} ) chmod 644 ${UIPC}/* chown bin ${UIPC}/* chgrp bin ${UIPC}/* Makedev exit 0 @//E*O*F uipc/Install// chmod u=rwx,g=rx,o=rx uipc/Install echo x - uipc/Remove sed 's/^@//' > "uipc/Remove" <<'@//E*O*F uipc/Remove//' PTYCNT=32 # Eric H. Herrin II # University of Kentucky Mathematical Sciences # eric@ms.uky.edu, eric@ms.uky.csnet, !cbosgd!ukma!eric # # Remove script for pty driver. MODULE=pty # remove the pty device files cnt=0 echo "Removing the pty device files" for x in p q r s t u v w x y z do for y in 0 1 2 3 4 5 6 7 8 9 a b c d e f do i=$x$y if [ ${cnt} -ge ${PTYCNT} ] then break fi /bin/rm -f /dev/pty$i /bin/rm -f /dev/tty$i cnt=`expr ${cnt} + 1` done done # get rid of stuff in /etc/lddrv # (cd /etc/lddrv;./lddrv -dv pty || ./lddrv -dv pty) echo "removing InstDrv entries, etc." /bin/rm -f /etc/lddrv/${MODULE}.o /etc/lddrv/${MODULE} \ /etc/lddrv/ifile.${MODULE} grep -v "^${MODULE}" /etc/lddrv/drivers > /tmp/XXX$$ mv /tmp/XXX$$ /etc/lddrv/drivers grep -v "${MODULE}" /etc/lddrv/InstDrv > /tmp/XXX$$ mv /tmp/XXX$$ /etc/lddrv/InstDrv chmod +r /etc/lddrv/drivers /etc/lddrv/InstDrv chmod go-w /etc/lddrv/drivers /etc/lddrv/InstDrv chown root /etc/lddrv/drivers /etc/lddrv/InstDrv echo "Remove support, libraries and include files" rm /etc/daemons/socket_init rm -rf /usr/lib/libuipc.a /usr/include/uipc sync echo "Removing /etc/master entry" /etc/masterupd -d ${MODULE} sync sync echo "Shuting Down machine" shutdown;read a @//E*O*F uipc/Remove// chmod u=rwx,g=rx,o=rx uipc/Remove echo x - uipc/Remove.orig sed 's/^@//' > "uipc/Remove.orig" <<'@//E*O*F uipc/Remove.orig//' # Eric H. Herrin II # University of Kentucky Mathematical Sciences # eric@ms.uky.edu, eric@ms.uky.csnet, !cbosgd!ukma!eric # # Remove script for pty driver. MODULE=pty # remove the pty device files cnt=0 echo "Removing the pty device files" for x in p q r s t u v w x y z do for y in 0 1 2 3 4 5 6 7 8 9 a b c d e f do i=$x$y if [ ${cnt} -ge ${PTYCNT} ] then break fi /bin/rm -f /dev/pty$i /bin/rm -f /dev/tty$i cnt=`expr ${cnt} + 1` done done # get rid of stuff in /etc/lddrv # (cd /etc/lddrv;./lddrv -dv pty || ./lddrv -dv pty) echo "removing InstDrv entries, etc." /bin/rm -f /etc/lddrv/${MODULE}.o /etc/lddrv/${MODULE} \ /etc/lddrv/ifile.${MODULE} grep -v "^${MODULE}" /etc/lddrv/drivers > /tmp/XXX$$ mv /tmp/XXX$$ /etc/lddrv/drivers grep -v "${MODULE}" /etc/lddrv/InstDrv > /tmp/XXX$$ mv /tmp/XXX$$ /etc/lddrv/InstDrv chmod +r /etc/lddrv/drivers /etc/lddrv/InstDrv chmod go-w /etc/lddrv/drivers /etc/lddrv/InstDrv chown root /etc/lddrv/drivers /etc/lddrv/InstDrv echo "Remove support, libraries and include files" rm /etc/daemons/socket_init rm -rf /usr/lib/libuipc.a /usr/include/uipc sync echo "Removing /etc/master entry" /etc/masterupd -d ${MODULE} sync sync echo "Shuting Down machine" shutdown;read a @//E*O*F uipc/Remove.orig// chmod u=rw,g=r,o=r uipc/Remove.orig echo x - uipc/Version sed 's/^@//' > "uipc/Version" <<'@//E*O*F uipc/Version//' 3 @//E*O*F uipc/Version// chmod u=rw,g=r,o=r uipc/Version echo x - uipc/Name sed 's/^@//' > "uipc/Name" <<'@//E*O*F uipc/Name//' Pty-Socket Driver Version 2.0 @//E*O*F uipc/Name// chmod u=rw,g=r,o=r uipc/Name echo x - uipc/Size sed 's/^@//' > "uipc/Size" <<'@//E*O*F uipc/Size//' 238 @//E*O*F uipc/Size// chmod u=rw,g=r,o=r uipc/Size echo x - uipc/Fullname sed 's/^@//' > "uipc/Fullname" <<'@//E*O*F uipc/Fullname//' Pty-Socket Driver Version 2.0 ----------------------------- Pty Code by Jens-Uwe Mager Pty Code modified by Eric H. Herrin II Socket Code by Alex Crain. Socket Code modified and Pty Code merged by Bradley Smith @//E*O*F uipc/Fullname// chmod u=rw,g=r,o=r uipc/Fullname echo x - uipc/sysconfig.m4.B sed 's/^@//' > "uipc/sysconfig.m4.B" <<'@//E*O*F uipc/sysconfig.m4.B//' ifelse(REALTIME,1,`divert(-1)') # # @(#)sysconfig.m4 1.1 (Alex Crain) 6/20/89 # # System call definition file # # each line should be a DEFSYSCALL macro, where the # arguments are the number of arguments that the # syscall expects and the syscall name. # # the syscall number for syslocal() # define(SYSL_SYSCALL, 67) # # the offset of the last known local system call. # define(SYSENT_OFFSET,18) # # the offset of the first new system call in the sysentries[] array # define(SYSENT_START,incr(SYSENT_OFFSET)) ifelse(REALTIME,1,`divert') DEFSYSCALL(3,socket) DEFSYSCALL(3,bind) DEFSYSCALL(2,listen) DEFSYSCALL(3,accept) DEFSYSCALL(3,connect) DEFSYSCALL(4,socketpair) DEFSYSCALL(1,sockpipe) DEFSYSCALL(6,sendto) DEFSYSCALL(4,send) DEFSYSCALL(6,recvfrom) DEFSYSCALL(4,recv) DEFSYSCALL(5,setsockopt) DEFSYSCALL(5,getsockopt) DEFSYSCALL(5,soselect) DEFSYSCALL(2,sosetup) @//E*O*F uipc/sysconfig.m4.B// chmod u=rw,g=r,o=r uipc/sysconfig.m4.B exit 0 -- David H. Brierley Home: dave@galaxia.newport.ri.us; Work: dhb@quahog.ssd.ray.com Send comp.sources.3b1 submissions to comp-sources-3b1@galaxia.newport.ri.us %% Can I be excused, my brain is full. **