pullup BIND 8:

Solaris 2.4 (and earlier) USE_FIONBIO_IOCTL support.
This commit is contained in:
Mark Andrews 2001-07-02 02:02:27 +00:00
parent d4e535315d
commit 9e80f632c8
4 changed files with 37 additions and 6 deletions

View file

@ -18,7 +18,7 @@ AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
esyscmd([sed "s/^/# /" COPYRIGHT])dnl
AC_DIVERT_POP()dnl
AC_REVISION($Revision: 1.59 $)
AC_REVISION($Revision: 1.60 $)
AC_INIT(resolv/herror.c)
AC_PREREQ(2.13)
@ -1079,6 +1079,7 @@ AC_SUBST(HAVE_MINIMUM_IFREQ)
PORT_INCLUDE=
SOLARIS_BITTYPES="#undef NEED_SOLARIS_BITTYPES"
BSD_COMP="#undef BSD_COMP"
USE_FIONBIO_IOCTL="#undef USE_FIONBIO_IOCTL"
case "$host" in
*aix3.2*) PORT_INCLUDE="port/aix32/include";;
*aix4*) PORT_INCLUDE="port/aix4/include";;
@ -1101,9 +1102,14 @@ case "$host" in
*-openbsd*) PORT_INCLUDE="port/openbsd/include";;
*-qnx*) PORT_INCLUDE="port/qnx/include";;
*-rhapsody*) PORT_INCLUDE="port/rhapsody/include";;
*-solaris2.[[012345]]*)
*-solaris2.[[01234]]*)
BSD_COMP="#define BSD_COMP 1"
SOLARIS_BITTYPES="#define NEED_SOLARIS_BITTYPES 1";
SOLARIS_BITTYPES="#define NEED_SOLARIS_BITTYPES 1"
USE_FIONBIO_IOCTL="#define USE_FIONBIO_IOCTL 1"
PORT_INCLUDE="port/solaris/include";;
*-solaris2.5*)
BSD_COMP="#define BSD_COMP 1"
SOLARIS_BITTYPES="#define NEED_SOLARIS_BITTYPES 1"
PORT_INCLUDE="port/solaris/include";;
*-solaris2*) BSD_COMP="#define BSD_COMP 1"
PORT_INCLUDE="port/solaris/include";;
@ -1111,6 +1117,7 @@ case "$host" in
esac
AC_SUBST(BSD_COMP)
AC_SUBST(SOLARIS_BITTYPES)
AC_SUBST(USE_FIONBIO_IOCTL)
AC_SUBST(PORT_INCLUDE)

View file

@ -20,7 +20,7 @@
*/
#if !defined(LINT) && !defined(CODECENTER)
static const char rcsid[] = "$Id: ev_connects.c,v 1.1 2001/03/29 06:31:53 marka Exp $";
static const char rcsid[] = "$Id: ev_connects.c,v 1.2 2001/07/02 02:02:26 marka Exp $";
#endif
/* Import. */
@ -30,6 +30,7 @@ static const char rcsid[] = "$Id: ev_connects.c,v 1.1 2001/03/29 06:31:53 marka
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <unistd.h>
@ -77,7 +78,12 @@ evListen(evContext opaqueCtx, int fd, int maxconn,
* incorrectly.
*/
if ((mode & PORT_NONBLOCK) == 0) {
#ifdef USE_FIONBIO_IOCTL
int on = 1;
OK(ioctl(fd, FIONBIO, (char *)&on));
#else
OK(fcntl(fd, F_SETFL, mode | PORT_NONBLOCK));
#endif
new->flags |= EV_CONN_BLOCK;
}
OK(listen(fd, maxconn));
@ -160,8 +166,14 @@ evCancelConn(evContext opaqueCtx, evConnID id) {
if (mode == -1) {
if (errno != EBADF)
return (-1);
} else
} else {
#ifdef USE_FIONBIO_IOCTL
int on = 1;
OK(ioctl(this->fd, FIONBIO, (char *)&on));
#else
OK(fcntl(this->fd, F_SETFL, mode | PORT_NONBLOCK));
#endif
}
}
/* Unlink from ctx->conns. */

View file

@ -20,7 +20,7 @@
*/
#if !defined(LINT) && !defined(CODECENTER)
static const char rcsid[] = "$Id: ev_files.c,v 1.2 2001/06/27 03:55:45 marka Exp $";
static const char rcsid[] = "$Id: ev_files.c,v 1.3 2001/07/02 02:02:27 marka Exp $";
#endif
#include "port_before.h"
@ -28,6 +28,7 @@ static const char rcsid[] = "$Id: ev_files.c,v 1.2 2001/06/27 03:55:45 marka Exp
#include <sys/types.h>
#include <sys/time.h>
#include <sys/ioctl.h>
#include <errno.h>
#include <fcntl.h>
@ -72,7 +73,12 @@ evSelectFD(evContext opaqueCtx,
if (mode & PORT_NONBLOCK)
FD_SET(fd, &ctx->nonblockBefore);
else {
#ifdef USE_FIONBIO_IOCTL
int on = 1;
OK(ioctl(fd, FIONBIO, (char *)&on));
#else
OK(fcntl(fd, F_SETFL, mode | PORT_NONBLOCK));
#endif
FD_CLR(fd, &ctx->nonblockBefore);
}
}
@ -197,7 +203,12 @@ evDeselectFD(evContext opaqueCtx, evFileID opaqueID) {
* this fcntl() fails since (a) we've already done the work
* and (b) the caller didn't ask us anything about O_NONBLOCK.
*/
#ifdef USE_FIONBIO_IOCTL
int off = 1;
(void) ioctl(del->fd, FIONBIO, (char *)&off);
#else
(void) fcntl(del->fd, F_SETFL, mode & ~PORT_NONBLOCK);
#endif
}
/*

View file

@ -22,6 +22,7 @@
@HAVE_SOCKADDR_STORAGE@
@NEED_GETTIMEOFDAY@
@HAVE_STRNDUP@
@USE_FIONBIO_IOCTL@
/* XXX sunos and cygwin needs O_NDELAY */
#define PORT_NONBLOCK O_NONBLOCK