Re: serial port programming second question (newbie)

From: Alan Cox
Date: Tue Jan 18 2011 - 05:58:10 EST


On Mon, 17 Jan 2011 16:41:38 -0800
Donna Rigas <donna.rigas@xxxxxxxxx> wrote:

> Also, if your call to tcsetattr fails, or if the ioctl call to
> set the baud rate fails, does it matter if you restore the serial
> port settings or not?

If they fail the returned struct contains the settings you ended up with,
eg the baud rate you actually got. Older kernels didn't get that detail
right but current ones do. Generally they will try and pick a nearest
suitable rate.

Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/