diff -u libssh2-1.4.2_orig/src/agent.c libssh2-1.4.2/src/agent.c
--- libssh2-1.4.2_orig/src/agent.c	Mon Mar  5 20:04:56 2012
+++ libssh2-1.4.2/src/agent.c	Thu Aug  2 10:32:49 2012
@@ -122,7 +122,7 @@
 };
 
 struct agent_ops {
-    agent_connect_func connect;
+    agent_connect_func _connect_;
     agent_transact_func transact;
     agent_disconnect_func disconnect;
 };
@@ -671,7 +671,7 @@
     int i, rc = -1;
     for (i = 0; supported_backends[i].name; i++) {
         agent->ops = supported_backends[i].ops;
-        rc = agent->ops->connect(agent);
+        rc = agent->ops->_connect_(agent);
         if (!rc)
             return 0;
     }
Only in libssh2-1.4.2/src/: libssh2_config.h
diff -u libssh2-1.4.2_orig/src/libssh2_priv.h libssh2-1.4.2/src/libssh2_priv.h
--- libssh2-1.4.2_orig/src/libssh2_priv.h	Fri Jan 27 14:34:03 2012
+++ libssh2-1.4.2/src/libssh2_priv.h	Thu Aug  2 12:33:39 2012
@@ -184,9 +184,9 @@
                       (channel), &(channel)->abstract)
 
 #define LIBSSH2_SEND_FD(session, fd, buffer, length, flags) \
-    session->send(fd, buffer, length, flags, &session->abstract)
+    session->_send_(fd, buffer, length, flags, &session->abstract)
 #define LIBSSH2_RECV_FD(session, fd, buffer, length, flags) \
-    session->recv(fd, buffer, length, flags, &session->abstract)
+    session->_recv_(fd, buffer, length, flags, &session->abstract)
 
 #define LIBSSH2_SEND(session, buffer, length, flags)  \
     LIBSSH2_SEND_FD(session, session->socket_fd, buffer, length, flags)
@@ -561,8 +561,8 @@
       LIBSSH2_DISCONNECT_FUNC((*ssh_msg_disconnect));
       LIBSSH2_MACERROR_FUNC((*macerror));
       LIBSSH2_X11_OPEN_FUNC((*x11));
-      LIBSSH2_SEND_FUNC((*send));
-      LIBSSH2_RECV_FUNC((*recv));
+      LIBSSH2_SEND_FUNC((*_send_));
+      LIBSSH2_RECV_FUNC((*_recv_));
 
     /* Method preferences -- NULL yields "load order" */
     char *kex_prefs;
@@ -881,7 +881,7 @@
                  const LIBSSH2_CRYPT_METHOD * method, unsigned char *iv,
                  int *free_iv, unsigned char *secret, int *free_secret,
                  int encrypt, void **abstract);
-    int (*crypt) (LIBSSH2_SESSION * session, unsigned char *block,
+    int (*_crypt_) (LIBSSH2_SESSION * session, unsigned char *block,
                   void **abstract);
     int (*dtor) (LIBSSH2_SESSION * session, void **abstract);
 
Only in libssh2-1.4.2/src/: makefile.morphos
diff -u libssh2-1.4.2_orig/src/misc.c libssh2-1.4.2/src/misc.c
--- libssh2-1.4.2_orig/src/misc.c	Thu Aug 25 18:59:47 2011
+++ libssh2-1.4.2/src/misc.c	Thu Aug  2 12:30:23 2012
@@ -107,6 +107,9 @@
         else
             return -errno;
     }
+#elif defined(HAVE_IOCTLSOCKET_CASE)
+    if (rc < 0) 
+        rc = (Errno() == EWOULDBLOCK) ? -EAGAIN : -Errno();
 #else
     if (rc < 0 ){
         /* Sometimes the first recv() function call sets errno to ENOENT on
@@ -139,6 +142,9 @@
         else
             return -errno;
     }
+#elif defined(HAVE_IOCTLSOCKET_CASE)
+    if (rc < 0) 
+        rc = (Errno() == EWOULDBLOCK) ? -EAGAIN : -Errno();
 #else
     if (rc < 0 )
         return -errno;
diff -u libssh2-1.4.2_orig/src/session.c libssh2-1.4.2/src/session.c
--- libssh2-1.4.2_orig/src/session.c	Wed Apr 18 21:24:04 2012
+++ libssh2-1.4.2/src/session.c	Thu Aug  2 11:01:54 2012
@@ -307,8 +307,8 @@
 #endif
 
 #if defined(HAVE_IOCTLSOCKET_CASE) && (SETBLOCK == 0)
-    /* presumably for Amiga */
-    return IoctlSocket(sockfd, FIONBIO, (long) nonblock);
+    /* Amiga/MorphOS */
+    return IoctlSocket(sockfd, FIONBIO, &nonblock);
 #undef SETBLOCK
 #define SETBLOCK 4
 #endif
@@ -370,6 +370,20 @@
 #define GETBLOCK 2
 #endif
 
+#if defined(HAVE_IOCTLSOCKET_CASE) && (GETBLOCK == 0)
+    /* Amiga/MorphOS */
+    unsigned int option_value;
+    unsigned int option_len = sizeof(option_value);
+    
+    if (getsockopt(sockfd, SOL_SOCKET, SO_ERROR, (void *) &option_value, &option_len)) {
+        /* Assume blocking on error */
+        return 1;
+    }
+    return (int) option_value;
+#undef GETBLOCK
+#define GETBLOCK 4
+#endif
+
 #if defined(HAVE_SO_NONBLOCK) && (GETBLOCK == 0)
     /* BeOS */
     long b;
@@ -490,8 +504,8 @@
         session->alloc = local_alloc;
         session->free = local_free;
         session->realloc = local_realloc;
-        session->send = _libssh2_send;
-        session->recv = _libssh2_recv;
+        session->_send_ = _libssh2_send;
+        session->_recv_ = _libssh2_recv;
         session->abstract = abstract;
         session->api_timeout = 0; /* timeout-free API by default */
         session->api_block_mode = 1; /* blocking API by default */
@@ -544,13 +558,13 @@
         return oldcb;
 
     case LIBSSH2_CALLBACK_SEND:
-        oldcb = session->send;
-        session->send = callback;
+        oldcb = session->_send_;
+        session->_send_ = callback;
         return oldcb;
 
     case LIBSSH2_CALLBACK_RECV:
-        oldcb = session->recv;
-        session->recv = callback;
+        oldcb = session->_recv_;
+        session->_recv_ = callback;
         return oldcb;
     }
     _libssh2_debug(session, LIBSSH2_TRACE_TRANS, "Setting Callback %d", cbtype);
diff -u libssh2-1.4.2_orig/src/transport.c libssh2-1.4.2/src/transport.c
--- libssh2-1.4.2_orig/src/transport.c	Fri Mar 16 16:39:58 2012
+++ libssh2-1.4.2/src/transport.c	Tue Jul 31 12:52:44 2012
@@ -139,7 +139,7 @@
     assert((len % blocksize) == 0);
 
     while (len >= blocksize) {
-        if (session->remote.crypt->crypt(session, source,
+        if (session->remote.crypt->_crypt_(session, source,
                                          &session->remote.crypt_abstract)) {
             LIBSSH2_FREE(session, p->payload);
             return LIBSSH2_ERROR_DECRYPT;
@@ -167,7 +167,7 @@
     unsigned char macbuf[MAX_MACSIZE];
     struct transportpacket *p = &session->packet;
     int rc;
-
+    
     if (session->fullpacket_state == libssh2_NB_state_idle) {
         session->fullpacket_macstate = LIBSSH2_MAC_CONFIRMED;
         session->fullpacket_payload_len = p->packet_length - 1;
@@ -833,7 +833,7 @@
            The MAC field is not encrypted. */
         for(i = 0; i < packet_length; i += session->local.crypt->blocksize) {
             unsigned char *ptr = &p->outbuf[i];
-            if (session->local.crypt->crypt(session, ptr,
+            if (session->local.crypt->_crypt_(session, ptr,
                                             &session->local.crypt_abstract))
                 return LIBSSH2_ERROR_ENCRYPT;     /* encryption failure */
         }
