termios configuration/read question

Eric Norum eric at cls.usask.ca
Wed Oct 11 14:43:20 UTC 2000


jennifer averett wrote:
> 
> Thanks for the response,
> 
> That works but looking at termios description I think it is incorrect
> behavior. The iproc (termios.c) method changes the CR character
> regardless of the  setting of  ICANON setting.  The following patch
> should fix the problem, but I'd like to verify the functionality against the
> POSIX specification before it is applied.
> 
> "CR    Special character on input, which is recognized if the ICANON
>           flag is set; it is the carriage return character. When ICANON and ICRNL are
>           set and IGNCR is not set, this character is translated into an NL,
>           and has the same effect as an NL character. "
> 

What documentation are you working from?  

The termios man page on Linux makes no mention about ICRNL being
effective only when ICANON is set.  I lifted the code in question from
FreeBSD so I assumed that it was doing the right thing.  The Linux code
seems to do ICRNL processing whether or not ICANON is set.

Is this yet another change from the POSIX folks?  If so, is it better to
track POSIX or to work the way that FreeBSD and Linux do?

-- 
Eric Norum                                 eric at cls.usask.ca
Canadian Light Source                      Phone: (306) 966-6308
University of Saskatchewan                 FAX:   (306) 966-6058
Saskatoon, Canada.



More information about the users mailing list