--- /dev/null
+#define _GNU_SOURCE 1
+#include <dlfcn.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <stdlib.h>
+
+ssize_t
+read (int fd, void *buf, size_t count)
+{
+ static ssize_t (*read2) (int fd, void *buf, size_t count) = NULL;
+
+ if (read2 == NULL)
+ {
+ unsetenv ("LD_PRELOAD");
+ read2 = dlsym (RTLD_NEXT, "read");
+ }
+
+ if (count > 0 && isatty (fd) >= 1)
+ count = 1;
+
+ return read2 (fd, buf, count);
+}