saleyn / erlexec

Execute and control OS processes from Erlang/OTP
https://hexdocs.pm/erlexec/readme.html
Other
541 stars 141 forks source link

Can't compile c lib on OS X #98

Closed joefiorini closed 7 years ago

joefiorini commented 7 years ago

I'm trying to build erlexec on OS X and I'm getting:

===> /Volumes/Shared/src/process_spike/deps/erlexec/c_src/exec_impl.cpp:318:10: error: use of undeclared identifier 'ptsname_r'; did you mean 'ttyname_r'?
            r = ptsname_r(fdm, pts_name, sizeof(pts_name));
                ^~~~~~~~~
                ttyname_r
/usr/include/unistd.h:488:6: note: 'ttyname_r' declared here
int      ttyname_r(int, char *, size_t) __DARWIN_ALIAS(ttyname_r);
         ^
1 error generated.

I believe this is due to #95 which it appears introduced the call to ptsname_r. This function does not exist on OS X.

jlouis commented 7 years ago

We are also being hit by this one, on OSX. Same build error. I would wish I could "star" this task and say "me too", but the 👍 doesn't really connotate that expression I think. It isn't a thumbs-up I'm giving, it is a :me too: ...

saleyn commented 7 years ago

Looks like Mac OS X has a different signature of this function. I implemented the fix, but I don't have a Mac environment to test this on. Could you please verify that it's fixed on OSX?

jlouis commented 7 years ago

Hi!

I can confirm that your patch solves the compile part of the problem, at the very least. It probably also works, but I have only done some rudimentary test of erlexec in general, as I do not know where that piece of code is being used and thus trigger an example where I'm sure I walk that code path and get coverage.