LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-15-2005, 07:53 PM   #1
GarroteYou
LQ Newbie
 
Registered: Feb 2003
Location: Bay Area
Distribution: RH 8.0
Posts: 10

Rep: Reputation: 0
tcsetattr() TCSANOW vs. TCSETA


Hello,

I'm using the tcsetattr() function to change various console attributes, and I've seen code that uses both the TCSANOW vs. TCSETA options as the second parameter to the function. I'm trying to determine the difference between the two. It would seem as if they are very similar, but I can't seem to find any solid documentation which defines the differences between the two.

Thanks in advance

~Dave
 
Old 05-16-2005, 09:45 AM   #2
itsme86
Senior Member
 
Registered: Jan 2004
Location: Oregon, USA
Distribution: Slackware
Posts: 1,246

Rep: Reputation: 59
According to the man page, only these values are valid for the second parameter:
Quote:
TCSANOW
the change occurs immediately.

TCSADRAIN
the change occurs after all output written to fd
has been transmitted. This function should be used
when changing parameters that affect output.

TCSAFLUSH
the change occurs after all output written to the
object referred by fd has been transmitted, and all
input that has been received but not read will be
discarded before the change is made.
And I also found this in /usr/include/term.h:
Code:
/* Add definitions to make termio look like termios.
 * But ifdef it, since there are some implementations
 * that try to do this for us in a fake <termio.h>.
 */
#ifndef TCSANOW
#define TCSANOW TCSETA
#endif
#ifndef TCSADRAIN
#define TCSADRAIN TCSETAW
#endif
#ifndef TCSAFLUSH
#define TCSAFLUSH TCSETAF
#endif
It looks like TCSANOW and TCSETA are exactly the same. I'd probably stick with TCSANOW though since it's actually in the man page.

Last edited by itsme86; 05-16-2005 at 09:46 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration