From cce21700ebb37329e433df2a9c056d0bc512d0af Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Wed, 9 Aug 2023 18:29:02 +0200 Subject: [PATCH] Added informative comment --- serial_linux.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/serial_linux.go b/serial_linux.go index c8a7651..adc1149 100644 --- a/serial_linux.go +++ b/serial_linux.go @@ -87,5 +87,8 @@ func setTermSettingsBaudrate(speed int, settings *unix.Termios) (error, bool) { } func (port *unixPort) Drain() error { + // It's not super well documented, but this is the same as calling tcdrain: + // - https://git.musl-libc.org/cgit/musl/tree/src/termios/tcdrain.c + // - https://elixir.bootlin.com/linux/v6.2.8/source/drivers/tty/tty_io.c#L2673 return unix.IoctlSetInt(port.handle, unix.TCSBRK, 1) }