[erlang-questions] open_port and raw mode (zlogin)

Patrik Nyblom pan@REDACTED
Fri Jan 25 19:23:41 CET 2013


Hi!
On 01/25/2013 07:13 PM, Heinz Nikolaus Gies wrote:
> Hi everyone,
> I am trying to get Erlang to talk to (solarises) zlogin. I figured, 
> open_port would be the logical step to do that BUT it dies horribly 
> the command I run is:
>
> open_port({spawn, "/usr/sbin/zlogin -C 
> 8e3b630b-d18a-4047-bad3-600b17d9ef46"}, [use_stdio]).
>
> also experimented with other port options but they don't' really make 
> a difference safe for nouse_stdio which replaces the Erlang console 
> with the zlogin one (which doesn't help much ;)
>
> the error I get from zlogin is:
>
> (chunter@REDACTED <mailto:chunter@REDACTED>)8> 
> open_port({spawn, "/usr/sbin/zlogin -C 
> 8e3b630b-d18a-4047-bad3-600b17d9ef46"}, [use_stdio]).
> zlogin: failed to get user terminal settings: Invalid argument
> zlogin: failed to set stdin pty to raw mode: Invalid argument
>
> I've tracked down that a bit further into the zlogin code and it seems 
> to be related to a call to tcgetattr(fd, &term) in the code which 
> fails with the open_socket created connection.
>
> I'm a bit at a loss here what to do next sadly, any advice?
>
It seems zlogin expects a terminal as stdin, but if you open_port, stdin 
for the program will be a pipe, which you cannot do tcgetattr on. You 
will need to either find an option to zlogin that expects input from 
something not a terminal, or create a wrapper program that creates a pty 
, starts zlogin and forwards data from/to the pty and the pipe (which 
would be some hacking, but not impossible, that's basically what run_erl 
does, but to/from a named pipe - possibly there's already a program out 
there doing that, maybe someone on the list can enlighten us :))
> Regards,
> Heinz
>
Cheers,
/Patrik
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130125/228ffa5f/attachment.htm>


More information about the erlang-questions mailing list