Unix Programming - Re: Serial port: open vs fcntl

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > August 2005 > Re: Serial port: open vs fcntl





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: Serial port: open vs fcntl
Simon Elliott

2005-08-01, 8:30 am

On 01/08/2005, Floyd L. Davidson wrote:
> However, O_NONBLOCK is defined by POSIX and will be the same on
> all platforms while O_NDELAY has slight variations between some
> platforms. Hence O_NONBLOCK is preferred for portability.


I want to use POSIX as much as possible. Unfortunately it seems that
there's no POSIX way of switching CTS/RTS flow control on or off.

>
> In a C program the way to set or clear the CLOCAL flag is with
> termios. However, you cannot guarantee the state of the serial
> port before you open it; therefore the only correct way to do
> so is with the O_NONBLOCK flag set in open(). After it is open
> the CLOCAL flag can be set as desired, and blocking can be set
> as desired with fcntl().


Thanks, understood now.

--
Simon Elliott http://www.ctsn.co.uk
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com