Article 6P211 Is there a convenient way to specify serial baud rate in GCC terminal programs?

Is there a convenient way to specify serial baud rate in GCC terminal programs?

by
BruceV
from LinuxQuestions.org on (#6P211)
Setting baud rate with gcc is done using enumerations, eg. B9600. This makes for awkward coding in terminal programs when the user specifies the required rate, what would be easier would be having the user simply enter the required value, eg. '9600'. Is there a way that this can be easily and efficiently implemented?

Doing it with the enumerations seems to unavoidably result in long strings of if/else, which I'd prefer to avoid.
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments