Hello,

I experienced the following problem with mosh-1.2.3 on a virtual Debian
Linux box (using Xen): mosh-server terminated itself instantly after
starting. Using

    $ mosh-server new -v

revealed the error message

    "select: Function not implemented".

Looking into src/frontend/mosh-server.cc, src/util/select.h and
experimenting with the example provided by the select(2) manpage, it
seemed that the pselect syscall was not supported on my particular
system; but I did not dig further to find out why.

As a quick and dirty workaround, I modified src/util/select.h to use
select() instead of pselect(), see attached patch. This resulted in a
working and usable mosh-server, but I suspect this might very well cause
some undesirable consequences; use at your own risk.

To the developers: I'd be happy to provide additional information to fix
this properly.

Thanks!
Ingo
--- orig/mosh-1.2.3/src/util/select.h	2012-10-19 21:45:18.000000000 +0200
+++ mosh-1.2.3/src/util/select.h	2012-12-25 15:06:12.000000000 +0100
@@ -125,18 +125,18 @@
     clear_got_signal();
     got_any_signal = 0;
 
-    struct timespec ts;
-    struct timespec *tsp = NULL;
+    struct timeval ts;
+    struct timeval *tsp = NULL;
 
     if ( timeout >= 0 ) {
       // timeout in milliseconds
       ts.tv_sec  = timeout / 1000;
-      ts.tv_nsec = 1000000 * (long( timeout ) % 1000);
+      ts.tv_usec = 1000 * (long( timeout ) % 1000);
       tsp = &ts;
     }
     // negative timeout means wait forever
 
-    int ret = ::pselect( max_fd + 1, &read_fds, NULL, &error_fds, tsp, &empty_sigset );
+    int ret = ::select( max_fd + 1, &read_fds, NULL, &error_fds, tsp );
 
     if ( ( ret == -1 ) && ( errno == EINTR ) ) {
       /* The user should process events as usual. */
_______________________________________________
mosh-users mailing list
[email protected]
http://mailman.mit.edu/mailman/listinfo/mosh-users

Reply via email to