diff --git a/apps/sshtosnmp.c b/apps/sshtosnmp.c
index 7b082b0..a001565 100644
--- a/apps/sshtosnmp.c
+++ b/apps/sshtosnmp.c
@@ -21,11 +21,13 @@
 #include <sys/un.h>
 #endif
 
+#include <sys/types.h>  //FIXME: needed for sendmsg?
 #include <sys/select.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <errno.h>
 #include <stdio.h>
+#include <string.h> // FIXME: use strcpy, memset, ...
 
 #ifndef MAXPATHLEN
 #warn no system max path length detected
@@ -37,6 +39,10 @@
 #define NETSNMP_SSHTOSNMP_VERSION_NUMBER 1
 
 
+#ifndef darwin9
+#define SNMPSSHDOMAIN_USE_EXTERNAL_PIPE 1
+#endif
+
 
 /*
  * Extra debugging output for, um, debugging.
@@ -89,6 +95,7 @@ main(int argc, char **argv) {
         exit(1);
     }
 
+#ifdef SNMPSSHDOMAIN_USE_EXTERNAL_PIPE
     /* set the SO_PASSCRED option so we can pass uid */
     /* XXX: according to the unix(1) manual this shouldn't be needed
        on the sending side? */
@@ -97,6 +104,7 @@ main(int argc, char **argv) {
         setsockopt(sock, SOL_SOCKET, SO_PASSCRED, (void *) &one,
                    sizeof(one));
     }
+#endif
 
     if (connect(sock, (struct sockaddr *) &addr,
                 sizeof(struct sockaddr_un)) != 0) {
@@ -122,12 +130,13 @@ main(int argc, char **argv) {
     buf[0] = NETSNMP_SSHTOSNMP_VERSION_NUMBER;
     buf_len = 1;
     
+#ifdef SNMPSSHDOMAIN_USE_EXTERNAL_PIPE
     /* send the prelim message and the credentials together using sendmsg() */
     {
         struct msghdr m;
         struct {
            struct cmsghdr cm;
-           struct ucred ouruser;
+           struct ucred ouruser;    //FIXME error on Darwin: field 'ouruser' has incomplete type
         } cmsg;
         struct iovec iov = { buf, buf_len };
 
@@ -138,6 +147,7 @@ main(int argc, char **argv) {
         /* set up the basic message */
         cmsg.cm.cmsg_len = sizeof(struct cmsghdr) + sizeof(struct ucred);
         cmsg.cm.cmsg_level = SOL_SOCKET;
+        //FIXME error on Darwin: 'SCM_CREDENTIALS' undeclared 
         cmsg.cm.cmsg_type = SCM_CREDENTIALS;
 
         cmsg.ouruser.uid = getuid();
@@ -151,6 +161,7 @@ main(int argc, char **argv) {
         m.msg_flags             = 0;
         
         DEBUG("sending to sock");
+        //FIXME error on Darwin: 'MSG_NOSIGNAL' undeclared
         rc = sendmsg(sock, &m, MSG_NOSIGNAL|MSG_DONTWAIT);
         if (rc < 0) {
             fprintf(stderr, "failed to send startup message\n");
@@ -158,6 +169,7 @@ main(int argc, char **argv) {
             exit(1);
         }
     }
+#endif
 
     DEBUG("sent name");
     
diff --git a/snmplib/transports/snmpSSHDomain.c b/snmplib/transports/snmpSSHDomain.c
index 72cc59e..8820b2c 100644
--- a/snmplib/transports/snmpSSHDomain.c
+++ b/snmplib/transports/snmpSSHDomain.c
@@ -83,7 +83,9 @@ typedef struct netsnmp_ssh_addr_pair_s {
 const oid netsnmp_snmpSSHDomain[] = { TRANSPORT_DOMAIN_SSH_IP };
 static netsnmp_tdomain sshDomain;
 
+#ifndef darwin9
 #define SNMPSSHDOMAIN_USE_EXTERNAL_PIPE 1
+#endif
 
 /*
  * Not static since it is needed here as well as in snmpUDPDomain, but not
