Subject: Re: Serial Line Weirdness/Bug?
To: None <current-users@netbsd.org>
From: Jason R Thorpe <thorpej@zembu.com>
List: current-users
Date: 07/13/2000 07:50:18
On Thu, Jul 13, 2000 at 03:49:59PM +0200, Feico Dillema wrote:

 > A friend of mine tries to talk to some device on the serial port on
 > NetBSD, and ran into something strange. TRying to open() the
 > /dev/tty00 doesn't return, and he needed the code below to get things
 > to work. I thought maybe `stty clocal' or something like that might be
 > needed to get the regular open() to return, but when that is tried
 > `stty -a' doesn;t even show anything different. This behaviour is
 > seen on NetBSD-1.4ZD machines and NetBSD-1.5ALPHA. Is this known
 > behaviour or a known bug?

Try opening /dev/dty00 (the dial-out device).

 > 
 > Feico.
 > 
 > #include <sys/fcntl.h>
 > void
 > main () {
 > int portfd, n;
 > #if 1
 >         portfd = open("/dev/tty00", O_RDWR|O_NDELAY);
 >         if (portfd >= 0){
 >                 /* Cancel the O_NDELAY flag. */
 >                 n = fcntl(portfd, F_GETFL, 0);
 >                 (void) fcntl(portfd, F_SETFL, n & ~O_NDELAY);
 >         }
 > #else
 >         portfd = open("/dev/tty00", O_RDWR);
 > #endif
 > }
 > 
 > 

-- 
        -- Jason R. Thorpe <thorpej@zembu.com>