Related to #1422 an #1521.
# AC_HEADER_STDC
AC_CHECK_HEADERS( \
- fcntl.h search.h termios.h \
+ fcntl.h search.h stropts.h termios.h \
unistd.h strings.h stat.h vfork.h \
- sys/time.h sys/types.h sys/select.h \
+ sys/time.h sys/types.h sys/select.h sys/socket.h \
sys/stat.h sys/mman.h sys/vfork.h \
sys/ioctl.h sys/inotify.h crt_externs.h)
#define POOLMTXSTART(p)
#define POOLMTXRETURN(p,v) { return(v); }
-/* functions for polling readiness of streams */
-
-#if _stream_peek
-#include <stropts.h>
-#endif
-
-#if _socket_peek
-#include <sys/socket.h>
-#endif
-
/* to test for executable access mode of a file */
#ifndef X_OK
#define X_OK 01
*************************************************************************/
#include <sfio/sfhdr.h>
-#ifndef FIONREAD
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_STROPTS_H
+#include <stropts.h>
#endif
/* Read/Peek a record from an unseekable device
return read(fd, buf, n);
t = (action > 0 || rc >= 0) ? (STREAM_PEEK | SOCKET_PEEK) : 0;
-#if !_stream_peek
+#ifndef I_PEEK
t &= ~STREAM_PEEK;
#endif
-#if !_socket_peek
+#ifndef MSG_PEEK
t &= ~SOCKET_PEEK;
#endif
for (ntry = 0; ntry < 2; ++ntry) {
r = -1;
-#if _stream_peek
+#ifdef I_PEEK
if ((t & STREAM_PEEK) && (ntry == 1 || tm < 0)) {
struct strpeek pbuf;
pbuf.flags = 0;
break;
}
}
-#endif /* stream_peek */
+#endif
if (ntry == 1)
break;
break;
}
-#if _socket_peek
+#ifdef MSG_PEEK
if (t & SOCKET_PEEK) {
while ((r = recv(fd, (char *) buf, n, MSG_PEEK)) < 0) {
if (errno == EINTR)