[mosh-devel] Solaris support

Timo Sirainen tss at iki.fi
Tue Apr 10 02:32:02 EDT 2012


I've mosh working fine with Linux and OSX, but my IRC client runs on a Solaris server, so I tried to make it work there as well. After a few hours I managed to get it compiled, but I can't verify if it actually works, since the client simply says:

mosh: Connecting... (39 s without contact.) [To quit: Ctrl-^ .]

I'm not entirely sure if this is a network problem or something else. I thought first it was the NAT, but when bypassing it it still didn't work. Is there some debug option where I can see on the server side what it does?

The list of things I changed:

 - not using curses.h and term.h, but ncurses/ncurses.h and ncurses/term.h, had to also change configure script since term.h can't be used at all

 - remove #include <stdbool.h> in base64.h:
/usr/include/stdbool.h:42:2: #error "Use of <stdbool.h> is valid only in a c99 compilation environment."

 - Added dummy macros for byteorder.h. I've Sparc CPU so these should work fine:
#define htobe64(x) x
#define be64toh(x) x
#define htobe16(x) x
#define be16toh(x) x

 - forkpty() doesn't exist, so I copied one from http://bugs.mysql.com/bug.php?id=22429

 - cfmakeraw() doesn't exist, I used the code from http://linux.die.net/man/3/cfmakeraw

 - there are many warnings about wint_t, but since it's the same size as int I guess it doesn't matter:
parseraction.cc: In member function `std::string Parser::Action::str()':
parseraction.cc:32: warning: wint_t format, int arg (arg 4)

 - I'm not sure about this:
crypto.cc: In member function `std::string Crypto::Session::encrypt(Crypto::Message)':
crypto.cc:201: warning: cast from pointer to integer of different size

 - network.h/cc try_bind() can't use "s_addr" parameter since it's a macro. I changed it to "addr".

 - A lot of warnings like these:
network.cc: In constructor `Network::Packet::Packet(std::string, Crypto::Session*)':
network.cc:56: warning: converting of negative value `-0x00000000000000001' to `uint64_t'
network.cc:56: warning: converting of negative value `-0x00000000000000001' to `uint16_t'
network.cc:56: warning: converting of negative value `-0x00000000000000001' to `uint16_t'

 - I commented out many (all?) asserts, since they don't compile:
network.cc:62: error: `__STRING' undeclared (first use this function)
network.cc:62: error: (Each undeclared identifier is reported only once for each function it appears in.)

 - frontend needs -lnsl -lsocket to link mosh-client / mosh-server





More information about the mosh-devel mailing list