Commit 0307dd3b authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Use pipe(2) if descriptors are selectable.

parent ac8b5468
This diff is collapsed.
......@@ -639,7 +639,7 @@ dnl hopefully we won't include too many libraries
dnl require select
AC_CHECK_FUNC(select, :, AC_MSG_ERROR([select() required.]))
AC_CHECK_FUNCS(socketpair)
dnl AC_CHECK_FUNCS(socketpair)
dnl Select arg types
dnl (if this detection becomes permenent, it and the select() detection
......@@ -647,7 +647,7 @@ dnl should be done before the yielding select test)
AC_FUNC_SELECT_ARGTYPES
dnl check to see if system call automatically restart
AC_SYS_RESTARTABLE_SYSCALLS
dnl AC_SYS_RESTARTABLE_SYSCALLS
dnl require POSIX regex
AC_CHECK_HEADERS( regex.h )
......@@ -1838,6 +1838,7 @@ AC_CHECK_FUNCS( \
memcpy \
memmove \
mkstemp \
pipe \
read \
recv \
recvfrom \
......
......@@ -115,8 +115,8 @@ extern char* WSAGetErrorString LDAP_P((int));
# define tcp_read( s, buf, len) read( s, buf, len )
# define tcp_write( s, buf, len) write( s, buf, len )
#ifdef HAVE_PAIR
#define USE_PAIR HAVE_PAIR
#ifdef HAVE_PIPE
#define USE_PIPE HAVE_PIPE
#endif
#endif /* MACOS */
......
......@@ -34,10 +34,6 @@
/* Define if you don't have vprintf but do have _doprnt. */
#undef HAVE_DOPRNT
/* Define if system calls automatically restart after interruption
by a signal. */
#undef HAVE_RESTARTABLE_SYSCALLS
/* Define if your struct stat has st_blksize. */
#undef HAVE_ST_BLKSIZE
......@@ -217,6 +213,9 @@
/* Define if you have the mkstemp function. */
#undef HAVE_MKSTEMP
/* Define if you have the pipe function. */
#undef HAVE_PIPE
/* Define if you have the pthread_getconcurrency function. */
#undef HAVE_PTHREAD_GETCONCURRENCY
......@@ -277,9 +276,6 @@
/* Define if you have the snprintf function. */
#undef HAVE_SNPRINTF
/* Define if you have the socketpair function. */
#undef HAVE_SOCKETPAIR
/* Define if you have the strdup function. */
#undef HAVE_STRDUP
......
......@@ -20,6 +20,9 @@
int lutil_pair( LBER_SOCKET_T sds[2] )
{
#ifdef USE_PIPE
return pipe( sds );
#else
struct sockaddr_in si;
int rc, len = sizeof(si);
LBER_SOCKET_T sd;
......@@ -53,4 +56,5 @@ int lutil_pair( LBER_SOCKET_T sds[2] )
sds[0] = sds[1] = sd;
return 0;
#endif
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment