gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-dev] What is our current bug state?


From: Hal Murray
Subject: Re: [gpsd-dev] What is our current bug state?
Date: Sun, 01 Feb 2015 23:13:26 -0800

> We probaly *don't* want to set CLOCAL.

stty says it's set on a device that's working with PPS.

>     If this bit is set, it indicates that the terminal is connected
>     "locally" and that the modem status lines (such as carrier detect)
>     should be ignored.

I think "ignored" means that it doesn't wait for them.  You can still read 
and set them.

>     On many systems if this bit is not set and you call open without
>     the O_NONBLOCK flag set, open blocks until a modem connection is
>     established. 

That's the case I was trying to warn you about.  If CLOCAL is set before you 
try to open it, all will be fine.  If it's not set, an open without 
O_NONBLOCK will hang when trying to open the typical GPS device that doesn't 
have anything connected to most of the modem control pins.

> But it's OK.  It turns out that justb removing O_NONBLOCK works; see my
> previous email to Gary.  

That's depending on the system or the previous user to leave CLOCAL set.

Linux leaves that stuff alone after a close.  So you can use things like stty 
to set things up the way your program needs them without having to change any 
code.

I'm pretty sure some NetBSD and/or FreeBSD have a shadow TTY and copy the 
state from that shadow on close and/or just before open.  I'll try to get 
more info if you think it will help.  stty on the shadow does what you want.

If you decide to just remove the O_NONBLOCK from the open, please add a 
comment referring to this discussion.


-- 
These are my opinions.  I hate spam.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]