From 5f2850931190f82de4095c933bd4b5a630d1e465 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Mon, 28 Jun 1999 04:11:41 +0000 Subject: [PATCH] detect write() and use HAVE_WRITE instead of !defined( DOS ) && !defined( MACOS ) Add detection for read & recv/send for later use. --- configure | 28 ++++++++++++++++------------ configure.in | 4 ++++ include/portable.h.in | 12 ++++++++++++ libraries/liblber/io.c | 2 +- 4 files changed, 33 insertions(+), 13 deletions(-) diff --git a/configure b/configure index b19271c58a..0c12cb51e0 100755 --- a/configure +++ b/configure @@ -11684,6 +11684,7 @@ for ac_func in \ memcpy \ memmove \ mkstemp \ + read \ recv \ recvfrom \ setpwfile \ @@ -11707,15 +11708,18 @@ for ac_func in \ sysconf \ waitpid \ wait4 \ + write \ + send \ + sendto \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:11714: checking for $ac_func" >&5 +echo "configure:11718: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -11766,12 +11770,12 @@ done for ac_func in getopt tempnam do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:11770: checking for $ac_func" >&5 +echo "configure:11774: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -11824,13 +11828,13 @@ done # Check Configuration echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6 -echo "configure:11828: checking declaration of sys_errlist" >&5 +echo "configure:11832: checking declaration of sys_errlist" >&5 if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -11840,7 +11844,7 @@ int main() { char *c = (char *) *sys_errlist ; return 0; } EOF -if { (eval echo configure:11844: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:11848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ol_cv_dcl_sys_errlist=yes else @@ -11860,20 +11864,20 @@ if test $ol_cv_dcl_sys_errlist = no ; then EOF echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6 -echo "configure:11864: checking existence of sys_errlist" >&5 +echo "configure:11868: checking existence of sys_errlist" >&5 if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *c = (char *) *sys_errlist ; return 0; } EOF -if { (eval echo configure:11877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_have_sys_errlist=yes else diff --git a/configure.in b/configure.in index 6e12246df4..25bb59a99b 100644 --- a/configure.in +++ b/configure.in @@ -1748,6 +1748,7 @@ AC_CHECK_FUNCS( \ memcpy \ memmove \ mkstemp \ + read \ recv \ recvfrom \ setpwfile \ @@ -1771,6 +1772,9 @@ AC_CHECK_FUNCS( \ sysconf \ waitpid \ wait4 \ + write \ + send \ + sendto \ ) dnl We actually may need to replace more than this. diff --git a/include/portable.h.in b/include/portable.h.in index 4f2647ee5c..240e480b63 100644 --- a/include/portable.h.in +++ b/include/portable.h.in @@ -332,6 +332,9 @@ /* Define if you have the pthread_yield function. */ #undef HAVE_PTHREAD_YIELD +/* Define if you have the read function. */ +#undef HAVE_READ + /* Define if you have the recv function. */ #undef HAVE_RECV @@ -344,6 +347,12 @@ /* Define if you have the sched_yield function. */ #undef HAVE_SCHED_YIELD +/* Define if you have the send function. */ +#undef HAVE_SEND + +/* Define if you have the sendto function. */ +#undef HAVE_SENDTO + /* Define if you have the setegid function. */ #undef HAVE_SETEGID @@ -425,6 +434,9 @@ /* Define if you have the waitpid function. */ #undef HAVE_WAITPID +/* Define if you have the write function. */ +#undef HAVE_WRITE + /* Define if you have the header file. */ #undef HAVE_ARPA_INET_H diff --git a/libraries/liblber/io.c b/libraries/liblber/io.c index 73c8c57ad5..98c5d5d552 100644 --- a/libraries/liblber/io.c +++ b/libraries/liblber/io.c @@ -236,7 +236,7 @@ ber_flush( Sockbuf *sb, BerElement *ber, int freeit ) ber->ber_rwptr, towrite ); } -#if HAVE_WRITE || (!defined(MACOS) && !(defined(DOS) && !defined(_WIN32))) +#if HAVE_WRITE if ( sb->sb_options & (LBER_TO_FILE | LBER_TO_FILE_ONLY) ) { rc = write( sb->sb_fd, ber->ber_rwptr, towrite ); if ( sb->sb_options & LBER_TO_FILE_ONLY ) { -- 2.39.5