--- ./sql-common/mysql_async.c.orig     2013-06-22 23:55:26.000000000 +0200
+++ ./sql-common/mysql_async.c  2013-06-23 00:08:12.000000000 +0200
@@ -29,7 +29,7 @@
  #include "mysql_async.h"
  
  
- #ifdef __WIN__
+ #if defined(__WIN__) || defined(_AIX)
  /*
    Windows does not support MSG_DONTWAIT for send()/recv(). So we need to ensure
    that the socket is non-blocking at the start of every operation.
--- ./sql-common/mysql_async.c.orig     2013-06-22 23:55:26.000000000 +0200
+++ ./sql-common/mysql_async.c  2013-06-23 00:08:12.000000000 +0200
@@ -38,6 +38,9 @@
      my_bool old_mode; \
      if ((mysql)->net.vio) vio_blocking((mysql)->net.vio, FALSE, &old_mode); \
    }
+ #if defined(_AIX) && !defined(MSG_DONTWAIT)
+ #define MSG_DONTWAIT MSG_NONBLOCK
+ #endif
  #else
  #define WIN_SET_NONBLOCKING(mysql)
  #endif
--- ./sql/threadpool_unix.cc.orig       2013-10-22 15:41:45.000000000 +0200
+++ ./sql/threadpool_unix.cc    2013-10-22 15:42:02.000000000 +0200
@@ -36,7 +36,9 @@
  #include <port.h>
  typedef port_event_t native_event;
  #else
- #error threadpool is not available on this platform
+ /** #error threadpool is not available on this platform
+ dummy impl */
+ typedef int native_event;
  #endif
  
  /** Maximum number of native events a listener can read in one go */
@@ -403,6 +405,32 @@
  static void* native_event_get_userdata(native_event *event)
  {
    return event->portev_user;
+ }
+ #else
+ /** dummy impl */
+ static int io_poll_create()
+ {
+   return -1;
+ }
+ int io_poll_start_read(int pollfd, int fd, void *data)
+ {
+   return -1;
+ }
+ static int io_poll_associate_fd(int pollfd, int fd, void *data)
+ {
+   return -1;
+ }
+ static int io_poll_disassociate_fd(int pollfd, int fd)
+ {
+   return -1;
+ }
+ int io_poll_wait(int pollfd, native_event *events, int maxevents, int timeout_ms)
+ {
+   return -1;
+ }
+ static void* native_event_get_userdata(native_event *event)
+ {
+   return NULL;
  }
  #endif

