{"id":132,"date":"2016-06-26T18:14:38","date_gmt":"2016-06-26T18:14:38","guid":{"rendered":"http:\/\/www.beer.org\/blog\/?p=132"},"modified":"2016-12-23T18:28:49","modified_gmt":"2016-12-23T18:28:49","slug":"socat-on-os-x-tcdrain-returns-invalid-argument","status":"publish","type":"post","link":"https:\/\/www.beer.org\/blog\/index.php\/2016\/06\/26\/socat-on-os-x-tcdrain-returns-invalid-argument\/","title":{"rendered":"socat on OS X &#8211; TCDRAIN returns Invalid Argument."},"content":{"rendered":"<p>When using socat, as installed by &#8216;brew install socat&#8217; on OS X, you will likely get this error when trying to proxy a serial device to another host via TCP:<\/p>\n<pre>TCSADRAIN, 0x7fffffffe148):Invalid argument<\/pre>\n<p>This is because OS X uses the FreeBSD termios interface and the bug is explained here:<\/p>\n<p>https:\/\/lists.freebsd.org\/pipermail\/freebsd-ports-bugs\/2015-March\/304366.html<\/p>\n<p>This is the patch you want to apply to &#8216;socat&#8217;:<\/p>\n<p>https:\/\/bz-attachments.freebsd.org\/attachment.cgi?id=154044<\/p>\n<p>&nbsp;<\/p>\n<p>Unfortunately, &#8216;brew install socat&#8217; just gives you someone else&#8217;s precompiled binary and you want to retrieve the source so you can apply the above patch.<\/p>\n<p>&nbsp;<\/p>\n<p>Do it like so:<\/p>\n<p>&nbsp;<\/p>\n<pre>cd `brew --cache`\r\nbrew unpack socat\r\ncd socat-1.7.3.1\r\ncurl https:\/\/bz-attachments.freebsd.org\/attachment.cgi?id=154044 &gt; patch\r\npatch &lt; patch\r\n.\/configure\r\nmake\r\nmake install<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When using socat, as installed by &#8216;brew install socat&#8217; 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: https:\/\/lists.freebsd.org\/pipermail\/freebsd-ports-bugs\/2015-March\/304366.html This is the patch you&#8230; <a class=\"moretag\" href=\"https:\/\/www.beer.org\/blog\/index.php\/2016\/06\/26\/socat-on-os-x-tcdrain-returns-invalid-argument\/\">Continue reading &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,7],"tags":[],"class_list":["post-132","post","type-post","status-publish","format-standard","hentry","category-memotoself","category-tech-stuff"],"_links":{"self":[{"href":"https:\/\/www.beer.org\/blog\/index.php\/wp-json\/wp\/v2\/posts\/132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.beer.org\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.beer.org\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.beer.org\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.beer.org\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=132"}],"version-history":[{"count":1,"href":"https:\/\/www.beer.org\/blog\/index.php\/wp-json\/wp\/v2\/posts\/132\/revisions"}],"predecessor-version":[{"id":133,"href":"https:\/\/www.beer.org\/blog\/index.php\/wp-json\/wp\/v2\/posts\/132\/revisions\/133"}],"wp:attachment":[{"href":"https:\/\/www.beer.org\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.beer.org\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.beer.org\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}