--- src/tail.c_orig	2019-01-01 19:39:32 +0000
+++ src/tail.c	2019-01-15 17:58:23 +0000
@@ -30,6 +30,9 @@
 #include <getopt.h>
 #include <sys/types.h>
 #include <signal.h>
+#ifdef _AIX
+# include <poll.h>
+#endif
 
 #include "system.h"
 #include "argmatch.h"
@@ -338,6 +341,15 @@
   if (! monitor_output)
     return;
 
+#ifdef _AIX
+  /* select on AIX was seen to give a readable event immediately.  */
+  struct pollfd pfd;
+  pfd.fd = STDOUT_FILENO;
+  pfd.events = POLLERR;
+
+   if (poll (&pfd, 1, 0) >= 0 && (pfd.revents & POLLERR))
+    raise (SIGPIPE);
+#else
   struct timeval delay;
   delay.tv_sec = delay.tv_usec = 0;
 
@@ -349,6 +361,7 @@
      and implies an error condition on output like broken pipe.  */
   if (select (STDOUT_FILENO + 1, &rfd, NULL, NULL, &delay) == 1)
     raise (SIGPIPE);
+#endif
 }
 
 static bool
