Re:On Go, Portability, and System Interfaces
by tedunangst on Wednesday September 23, 2015 @06:33PM
(#10268705)
What is the linked post about if not code that could have been portable but wasn't? I'm having a hard time determining if you're saying the code in question was right or not.
[ Parent
| on HN ]
Re:On Go, Portability, and System Interfaces
by 4ad on Thursday September 24, 2015 @04:35AM
(#10270482)
Well the code in the linked post doesn't compile on Solaris because SYS_IOCTL is not defined on Solaris. So that was my point. You don't get code that compiles but doesn't work, unless you try really hard.
But the code is bad. If you have to call system calls through the indirect system calls and use unsafe to pass parameters, you either do something wrong, or we did something wrong. In this case the author of that code is excusable. It was our fault. We didn't expose the necessary type-safe wrappers, so the authors was forced to write code like that.
This is changing however, just yesterday I committed support for termio-related stuff for Solaris. I assume Linux, BSDs and the other systems will follow very soon.