When using socat, as installed by ‘brew install socat’ on OS X, you will likely get this error when trying to proxy a serial device to another host via TCP:
TCSADRAIN, 0x7fffffffe148):Invalid argument
This is because OS X uses the FreeBSD termios interface and the bug is explained here:
This is the patch you want to apply to ‘socat’:
Unfortunately, ‘brew install socat’ just gives you someone else’s precompiled binary and you want to retrieve the source so you can apply the above patch.
Do it like so:
cd `brew --cache` brew unpack socat cd socat-184.108.40.206 curl https://bz-attachments.freebsd.org/attachment.cgi?id=154044 > patch patch < patch ./configure make make install