Path: utzoo!utgpu!jarvis.csri.toronto.edu!torsqnt!tmsoft!masnet!canremote!perry@macom1.uucp From: perry@macom1.uucp@canremote.uucp (perry@macom1.UUCP) Newsgroups: comp.dcom.modems Subject: Re: Telebit config Question c Message-ID: <89122504055112@masnet.uucp> Date: 21 Dec 89 05:05:00 GMT Organization: Canada Remote Systems Limited, Mississauga, ON, Canada Lines: 98 From: perry@macom1.UUCP (Guru's Inc.) Subj: Telebit config Question c-code uugetty Orga: CENTEL Federal Systems, Reston, VA. 22091-1506 *-*-*-*-* Message continued from prior message *-*-*-*-* if (k == CR ) { mask = umask(0); /* change mask */ lockfd = creat( Lock, 0444 ); /* create the lock file */ umask(mask); /* restore mask */ if ( lockfd < 0) { track("errlock"); sprintf(buf, "%s: cannot create lock %s\n",prg, device); conprint(60); } write( lockfd, pbuf, (unsigned)strlen(pbuf) ); close( lockfd ); track("incoming"); return(0); } } else { switch( atoi(speed) ) /* change baud rate */ { case 5: speed = "2"; break; case 3: speed = "6"; break; case 6: speed = "8"; break; case 8: speed = "5"; break; case 2: speed = "3"; break; } xlucent( pterm, &targ ); ioctl( pterm, TCFLSH, 2 ); track("break"); } k = c; } } checkout(lock) char *lock; { dbf = fopen(lock, "r"); fgets(buf, 20, dbf); fgets(cbuf, 10, dbf); fclose(dbf); if ( !(strcmp(pbuf+11, cbuf)) ) { unlink(lock); return; } /* tty=tty */ track("outgoing"); signal( SIGHUP, trap0 ); while (!(access(Lock, 0))) sleep(20); conprint(0); } intread() /*** die if here too often ***/ { track("IR-"); if ( ++i > 40 ) trap0(); } !SYSIII end System III uugetty.c cut System V version argetty.c here>>!SYSV static char Version[] = "@(#)/usr/lib/uucp/argetty 5.4 27 Mar 88 - Centel"; /************************************************* argetty: Bidirectional getty 5.4 27 Mar 88"; System V version. P. Mathis *************************************************/ #include /* used for database accesses only */ #include #include #include #include #define CR 0x0D /* incoming connect signal */ extern char * strcpy(); extern void exit(); extern sleep(); static char port[20] = "/dev/", trace[35] = "/usr/spool/locks/u", lock[35] = "/usr/spool/locks/LCK..", cbuf[60], buf[100], pbuf[20], prg[34], sspeed[10], *optt, *optn, *device, *speed; int parent, child, mask, i=0, r=1; int intrexit(); FILE *dbf; static int fd1, fd2, lockfd, pterm; static struct termio targ; /***... Interrupt routines ...***/ *-*-*-*-* Message continued in next message *-*-*-*-* --- * Via MaSNet/HST96/HST144/V32 - UN Datacommun./Modems * Via Usenet Newsgroup comp.dcom.modems