Path: utzoo!utgpu!watmath!clyde!att!laidbak!rayd From: rayd@laidbak.UUCP (Ray Dueland) Newsgroups: comp.mail.uucp Subject: Re: Bidirectional Modem Lines under SunOS 4.0.1 Message-ID: <2209@laidbak.UUCP> Date: 5 Apr 89 19:39:33 GMT References: <160@osc.COM> <743@key.COM> Reply-To: rayd@laidbak.UUCP (Ray Dueland) Organization: Lachman Associates, Inc. Naperville, Il. Lines: 34 In article <743@key.COM> perry@arkon.key.COM (Perry The Cynic) writes: >Sounds like your setup doesn't properly handle the CD (carrier detect) >signal. In the correct setup, getty will hang on the open(2) call for >the modem because CD is down (off) until somebody actually dials in and >the modem connects and turns CD on. Conversely, the corresponding >/dev/cua* device will return open errors while CD is up (because the line >is currently used for dial-in). If you think about it, this won't work. The dial out will cause CD to go high and the getty to complete its open. There has to be additional lock to secure access to the tty. In the bidirectional setups I've seen this is done with the LCK..tty file. Getty opens the tty and then *tries* to create the lockfile, cu/uucico creates the lockfile and then opens the tty. There is still a little time for a dialin user to get hosed here though. I have no experience with Sun uucp (other than the fact that its HDB). >So: check your documentation. Find the dip switch and/or modem command that >sounds like "raise and lower Carrier Detect depending on modem connection" >as opposed to "always keep Carrier Detect asserted". Use it. I agree on the problem. >Next potential gotcha: for similar reasons, the default configuration >of the serial drivers pretends that the CD signal is always on, no matter >what the hardware says (does that start to sound familiar?!). The file /usr/include/sys/tty.h on my Sun 3.5 system does not have the NOHANG tty mode flag that I've seen in other kernels to prevent the blocking on the open system call. -- Ray Dueland {amdahl|clout|masscomp|nucsrl|sun|tellab5}!laidbak!rayd