Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uupsi!sunic!ugle.unit.no!nuug!isncr!ra From: ra@intsys.no (Robert Andersson) Newsgroups: comp.sys.ncr Subject: Re: Problem with uucico - lost line - on 450/32 Unix 3.00.01. Keywords: modem, uucico Message-ID: <1991Apr4.155114.6273@intsys.no> Date: 4 Apr 91 15:51:14 GMT References: <1429@safn2.UUCP> Organization: International Systems A/S, Oslo, Norway. Lines: 168 rey@safn2.UUCP (rey) writes: >I cannot reliably Poll with uucp because it fails about 1/2 the time. >The result is usually a success one hour later. An hour later than I need >it to be. >Dialers file excerpt follows: The \M \m is new in rel 3. \M sets port CLOCAL. >hayes12 =,-, "" \M\dAT\r\c OK\r AT&D3V1Q0E1S0=1&C1&S1M0&J0B1\r\c OK\r \EATDT\T\r\c CONNECT \m\c That explains it. There appears to be a bug in the HPSIO code that makes this CLOCAL fiddling fail. I'm surprised you got it working at all, personally I newer got \M \m to work. I believe NCR inherited this bug from AT&T, since I have also seen it in many other UNIX implementations. I have attached an old Usenet message and a test program that shows the bug. Regards, Robert. From: pim@cti-software.nl (Pim Zandbergen) Date: 21 Aug 90 18:06:53 GMT Newsgroups: comp.unix.i386 Subject: which multiport i/o cards pass this test? Hi netfolk, I am currently looking for a multiport I/O card to replace Specialix, because the Dutch distributor has stopped importing them. I have evaluated some cards but lots of their drivers have trouble with correctly handling modem control. This prevents them from working with the intelligent modem feature in HDB UUCP: "ttyxx,M" in Devices means open with O_NDELAY set and "\M" and "\m" in Dialers means set and clear the CLOCAL flag. The problem is that with these drivers, the O_NDELAY flag cannot be properly cleared when carrier detect is not present. I have noticed this problem with the stock ISC asy driver, with Specialix drivers older than release 3.03, with the Equinox Megaport 1.8.2 driver (a pity, I like this card) and the Chase Research AT8+ 4.02a driver. In fact, the only working drivers I have seen are the Specialix 3.03 and the PORTS and EPORTS drivers for the AT&T 3B2. Rather than evaluate every card on the market myself I would appreciate very much if you would run my little test program and mail me the result. I *think* this program emulates HDB UUCP behaviour. I only tested it on ISC 386/ix 2.0.2 and on the AT&T 3B2. If any UNIX guru would like to comment, please feel free. The crucial moment in this program is the read(). It should block, waiting for input, but returns immediately with zero bytes read on lots of cards. You should run this program on a port that has no cable whatsoever attached to it, nor should any other process have this port opened (ie. no getty's running). The port should implement modem control, ie. "> /dev/ttyxx" should hang. Thanks in advance for you help. #include #include #include #include #include main(argc, argv) int argc; char *argv[]; { int fcntl_flags; int fd; extern int errno; extern unsigned alarm(); char buf[1]; char *usage = "usage: %s \n"; extern char *sys_errlist[]; struct termio termio_flags; struct termio old_termio_flags; void on_alarm(); extern void exit(); if (argc != 2) { (void) fprintf(stderr, usage, argv[0]); exit(1); } (void) printf("opening %s with O_NDELAY set\n", argv[1]); if ((fd = open(argv[1], O_RDWR | O_NDELAY)) < 0) { (void) fprintf(stderr, "%s: can't open %s: %s\n", argv[0], argv[1], sys_errlist[errno]); exit(2); } (void) printf("clearing O_NDELAY flag\n"); if ((fcntl_flags = fcntl(fd, F_GETFL, 0)) == -1) { (void) fprintf(stderr, "%s: can't get fcntl flags: %s\n", argv[0], sys_errlist[errno]); exit(3); } fcntl_flags &= ~(O_NDELAY); if (fcntl(fd, F_SETFL, fcntl_flags) == -1) { (void) fprintf(stderr, "%s: can't set fcntl flags: %s\n", argv[0], sys_errlist[errno]); exit(4); } (void) printf("setting CLOCAL\n"); if (ioctl(fd, TCGETA, &termio_flags) < 0) { (void) fprintf(stderr, "%s: can't get termio flags: %s\n", argv[0], sys_errlist[errno]); exit(5); } old_termio_flags = termio_flags; /* save original modes */ termio_flags.c_cflag |= CLOCAL; if (ioctl(fd, TCSETAW, &termio_flags) < 0) { (void) fprintf(stderr, "%s: can't set termio flags: %s\n", argv[0], sys_errlist[errno]); exit(6); } (void) printf("reading from %s\n", argv[1]); (void) signal(SIGALRM, on_alarm); (void) alarm((unsigned) 10); if ((read(fd, buf, 1) < 1) && (errno == EINTR)) (void) printf("test succesful\n"); else (void) printf("test failed\n"); (void) printf("clearing CLOCAL\n"); if (ioctl(fd, TCSETAW, &old_termio_flags) < 0) { (void) fprintf(stderr, "%s: can't restore termio flags: %s\n", argv[0], sys_errlist[errno]); exit(7); } (void) printf("exiting\n"); return 0; } void on_alarm() { (void) printf("caught SIGALRM\n"); } -- Robert Andersson Voice +47 2 371055 International Systems A/S ra@intsys.no Fax +47 2 356448 P.O. Box 3356 ...!{uunet,mcsun,nuug}!intsys.no!ra 0405 Oslo 4, NORWAY