jacobsa / go-serial

A Go library for dealing with serial ports.
Apache License 2.0
626 stars 120 forks source link

Switch to syscall.Open on Darwin #36

Open jc-m opened 6 years ago

jc-m commented 6 years ago

This resolve the high cpu caused by os.OpenFile as described here: https://github.com/golang/go/issues/22099

jc-m commented 6 years ago

I'll look at your comments, but right now, it seems that there are other issues like some of the flags not being set in termios. Still trying to debug.

jc-m commented 6 years ago

For example, the termios struct you define has a byte array of 20, which is not aligned on 64 bits. This is why the unix.termios has a padding array of 4 bytes. One the issues I see for example is that rtscts doesn't get applied to the serial port.