mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-02 15:45:25 +00:00
1898. [port] sunos: non blocking i/o support. [RT #14951]
This commit is contained in:
2
CHANGES
2
CHANGES
@@ -1,3 +1,5 @@
|
|||||||
|
1898. [port] sunos: non blocking i/o support. [RT #14951]
|
||||||
|
|
||||||
1897. [func] Support for IPSECKEY rdata type. [RT #14967]
|
1897. [func] Support for IPSECKEY rdata type. [RT #14967]
|
||||||
|
|
||||||
1896. [bug] The cache could delete expired records too fast for
|
1896. [bug] The cache could delete expired records too fast for
|
||||||
|
18
configure.in
18
configure.in
@@ -18,7 +18,7 @@ AC_DIVERT_PUSH(1)dnl
|
|||||||
esyscmd([sed "s/^/# /" COPYRIGHT])dnl
|
esyscmd([sed "s/^/# /" COPYRIGHT])dnl
|
||||||
AC_DIVERT_POP()dnl
|
AC_DIVERT_POP()dnl
|
||||||
|
|
||||||
AC_REVISION($Revision: 1.381 $)
|
AC_REVISION($Revision: 1.382 $)
|
||||||
|
|
||||||
AC_INIT(lib/dns/name.c)
|
AC_INIT(lib/dns/name.c)
|
||||||
AC_PREREQ(2.13)
|
AC_PREREQ(2.13)
|
||||||
@@ -1960,6 +1960,22 @@ AC_SUBST(ISC_PLATFORM_USESTDASM)
|
|||||||
ISC_ARCH_DIR=$arch
|
ISC_ARCH_DIR=$arch
|
||||||
AC_SUBST(ISC_ARCH_DIR)
|
AC_SUBST(ISC_ARCH_DIR)
|
||||||
|
|
||||||
|
#
|
||||||
|
# The following sets up how non-blocking i/o is established.
|
||||||
|
# Sunos, cygwin and solaris 2.x (x<5) require special handling.
|
||||||
|
#
|
||||||
|
case "$host" in
|
||||||
|
*-sunos*) AC_DEFINE(PORT_NONBLOCK, O_NDELAY);;
|
||||||
|
*-cygwin*) AC_DEFINE(PORT_NONBLOCK, O_NDELAY);;
|
||||||
|
*-solaris2.[[01234]]*)
|
||||||
|
AC_DEFINE(PORT_NONBLOCK, O_NONBLOCK)
|
||||||
|
AC_DEFINE(USE_FIONBIO_IOCTL, 1,
|
||||||
|
[Defined if you need to use ioctl(FIONBIO) instead a fcntl call to make non-blocking.])
|
||||||
|
;;
|
||||||
|
*) AC_DEFINE(PORT_NONBLOCK, O_NONBLOCK,
|
||||||
|
[Sets which flag to pass to open/fcntl to make non-blocking (O_NDELAY/O_NONBLOCK).])
|
||||||
|
;;
|
||||||
|
esac
|
||||||
#
|
#
|
||||||
# The following sections deal with tools used for formatting
|
# The following sections deal with tools used for formatting
|
||||||
# the documentation. They are all optional, unless you are
|
# the documentation. They are all optional, unless you are
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||||
# PERFORMANCE OF THIS SOFTWARE.
|
# PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
AC_REVISION($Revision: 1.103 $)
|
AC_REVISION($Revision: 1.104 $)
|
||||||
|
|
||||||
AC_INIT(resolv/herror.c)
|
AC_INIT(resolv/herror.c)
|
||||||
AC_PREREQ(2.13)
|
AC_PREREQ(2.13)
|
||||||
@@ -996,6 +996,7 @@ PORT_DIR=port/unknown
|
|||||||
SOLARIS_BITTYPES="#undef NEED_SOLARIS_BITTYPES"
|
SOLARIS_BITTYPES="#undef NEED_SOLARIS_BITTYPES"
|
||||||
BSD_COMP="#undef BSD_COMP"
|
BSD_COMP="#undef BSD_COMP"
|
||||||
USE_FIONBIO_IOCTL="#undef USE_FIONBIO_IOCTL"
|
USE_FIONBIO_IOCTL="#undef USE_FIONBIO_IOCTL"
|
||||||
|
PORT_NONBLOCK="#define PORT_NONBLOCK O_NONBLOCK"
|
||||||
case "$host" in
|
case "$host" in
|
||||||
*aix3.2*) PORT_DIR="port/aix32";;
|
*aix3.2*) PORT_DIR="port/aix32";;
|
||||||
*aix4*) PORT_DIR="port/aix4";;
|
*aix4*) PORT_DIR="port/aix4";;
|
||||||
@@ -1003,7 +1004,9 @@ case "$host" in
|
|||||||
*aux3*) PORT_DIR="port/aux3";;
|
*aux3*) PORT_DIR="port/aux3";;
|
||||||
*-bsdi2*) PORT_DIR="port/bsdos2";;
|
*-bsdi2*) PORT_DIR="port/bsdos2";;
|
||||||
*-bsdi*) PORT_DIR="port/bsdos";;
|
*-bsdi*) PORT_DIR="port/bsdos";;
|
||||||
*-cygwin*) PORT_DIR="port/cygwin";;
|
*-cygwin*)
|
||||||
|
PORT_NONBLOCK="#define PORT_NONBLOCK O_NDELAY"
|
||||||
|
PORT_DIR="port/cygwin";;
|
||||||
*-darwin*) PORT_DIR="port/darwin";;
|
*-darwin*) PORT_DIR="port/darwin";;
|
||||||
*-osf*) PORT_DIR="port/decunix";;
|
*-osf*) PORT_DIR="port/decunix";;
|
||||||
*-freebsd*) PORT_DIR="port/freebsd";;
|
*-freebsd*) PORT_DIR="port/freebsd";;
|
||||||
@@ -1019,6 +1022,9 @@ case "$host" in
|
|||||||
*-openbsd*) PORT_DIR="port/openbsd";;
|
*-openbsd*) PORT_DIR="port/openbsd";;
|
||||||
*-qnx*) PORT_DIR="port/qnx";;
|
*-qnx*) PORT_DIR="port/qnx";;
|
||||||
*-rhapsody*) PORT_DIR="port/rhapsody";;
|
*-rhapsody*) PORT_DIR="port/rhapsody";;
|
||||||
|
*-sunos4*)
|
||||||
|
PORT_NONBLOCK="#define PORT_NONBLOCK O_NDELAY"
|
||||||
|
PORT_DIR="port/sunos";;
|
||||||
*-solaris2.[[01234]]*)
|
*-solaris2.[[01234]]*)
|
||||||
BSD_COMP="#define BSD_COMP 1"
|
BSD_COMP="#define BSD_COMP 1"
|
||||||
SOLARIS_BITTYPES="#define NEED_SOLARIS_BITTYPES 1"
|
SOLARIS_BITTYPES="#define NEED_SOLARIS_BITTYPES 1"
|
||||||
@@ -1038,6 +1044,7 @@ esac
|
|||||||
AC_SUBST(BSD_COMP)
|
AC_SUBST(BSD_COMP)
|
||||||
AC_SUBST(SOLARIS_BITTYPES)
|
AC_SUBST(SOLARIS_BITTYPES)
|
||||||
AC_SUBST(USE_FIONBIO_IOCTL)
|
AC_SUBST(USE_FIONBIO_IOCTL)
|
||||||
|
AC_SUBST(PORT_NONBLOCK)
|
||||||
AC_SUBST(PORT_DIR)
|
AC_SUBST(PORT_DIR)
|
||||||
PORT_INCLUDE=${PORT_DIR}/include
|
PORT_INCLUDE=${PORT_DIR}/include
|
||||||
AC_SUBST(PORT_INCLUDE)
|
AC_SUBST(PORT_INCLUDE)
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#if !defined(LINT) && !defined(CODECENTER)
|
#if !defined(LINT) && !defined(CODECENTER)
|
||||||
static const char rcsid[] = "$Id: ev_connects.c,v 1.6 2005/04/27 04:56:35 sra Exp $";
|
static const char rcsid[] = "$Id: ev_connects.c,v 1.7 2005/07/08 04:30:21 marka Exp $";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Import. */
|
/* Import. */
|
||||||
@@ -168,10 +168,10 @@ evCancelConn(evContext opaqueCtx, evConnID id) {
|
|||||||
return (-1);
|
return (-1);
|
||||||
} else {
|
} else {
|
||||||
#ifdef USE_FIONBIO_IOCTL
|
#ifdef USE_FIONBIO_IOCTL
|
||||||
int on = 1;
|
int off = 0;
|
||||||
OK(ioctl(this->fd, FIONBIO, (char *)&on));
|
OK(ioctl(this->fd, FIONBIO, (char *)&off));
|
||||||
#else
|
#else
|
||||||
OK(fcntl(this->fd, F_SETFL, mode | PORT_NONBLOCK));
|
OK(fcntl(this->fd, F_SETFL, mode & ~PORT_NONBLOCK));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#if !defined(LINT) && !defined(CODECENTER)
|
#if !defined(LINT) && !defined(CODECENTER)
|
||||||
static const char rcsid[] = "$Id: ev_files.c,v 1.6 2005/04/27 04:56:35 sra Exp $";
|
static const char rcsid[] = "$Id: ev_files.c,v 1.7 2005/07/08 04:30:21 marka Exp $";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "port_before.h"
|
#include "port_before.h"
|
||||||
@@ -203,7 +203,7 @@ evDeselectFD(evContext opaqueCtx, evFileID opaqueID) {
|
|||||||
* and (b) the caller didn't ask us anything about O_NONBLOCK.
|
* and (b) the caller didn't ask us anything about O_NONBLOCK.
|
||||||
*/
|
*/
|
||||||
#ifdef USE_FIONBIO_IOCTL
|
#ifdef USE_FIONBIO_IOCTL
|
||||||
int off = 1;
|
int off = 0;
|
||||||
(void) ioctl(del->fd, FIONBIO, (char *)&off);
|
(void) ioctl(del->fd, FIONBIO, (char *)&off);
|
||||||
#else
|
#else
|
||||||
(void) fcntl(del->fd, F_SETFL, mode & ~PORT_NONBLOCK);
|
(void) fcntl(del->fd, F_SETFL, mode & ~PORT_NONBLOCK);
|
||||||
|
@@ -27,9 +27,7 @@
|
|||||||
@INNETGR_ARGS@
|
@INNETGR_ARGS@
|
||||||
@SETNETGRENT_ARGS@
|
@SETNETGRENT_ARGS@
|
||||||
@USE_IFNAMELINKID@
|
@USE_IFNAMELINKID@
|
||||||
|
@PORT_NONBLOCK@
|
||||||
/* XXX sunos and cygwin needs O_NDELAY */
|
|
||||||
#define PORT_NONBLOCK O_NONBLOCK
|
|
||||||
|
|
||||||
/*! \brief
|
/*! \brief
|
||||||
* We need to know the IPv6 address family number even on IPv4-only systems.
|
* We need to know the IPv6 address family number even on IPv4-only systems.
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: entropy.c,v 1.73 2005/04/29 00:23:49 marka Exp $ */
|
/* $Id: entropy.c,v 1.74 2005/07/08 04:30:22 marka Exp $ */
|
||||||
|
|
||||||
/* \file unix/entropy.c
|
/* \file unix/entropy.c
|
||||||
* \brief
|
* \brief
|
||||||
@@ -447,16 +447,25 @@ make_nonblock(int fd) {
|
|||||||
int ret;
|
int ret;
|
||||||
int flags;
|
int flags;
|
||||||
char strbuf[ISC_STRERRORSIZE];
|
char strbuf[ISC_STRERRORSIZE];
|
||||||
|
#ifdef USE_FIONBIO_IOCTL
|
||||||
|
int on = 1;
|
||||||
|
|
||||||
|
ret = ioctl(fd, FIONBIO, (char *)&on);
|
||||||
|
#else
|
||||||
flags = fcntl(fd, F_GETFL, 0);
|
flags = fcntl(fd, F_GETFL, 0);
|
||||||
flags |= O_NONBLOCK;
|
flags |= PORT_NONBLOCK;
|
||||||
ret = fcntl(fd, F_SETFL, flags);
|
ret = fcntl(fd, F_SETFL, flags);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
isc__strerror(errno, strbuf, sizeof(strbuf));
|
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||||
UNEXPECTED_ERROR(__FILE__, __LINE__,
|
UNEXPECTED_ERROR(__FILE__, __LINE__,
|
||||||
"fcntl(%d, F_SETFL, %d): %s",
|
#ifdef USE_FIONBIO_IOCTL
|
||||||
fd, flags, strbuf);
|
"ioctl(%d, FIONBIO, &on): %s", fd,
|
||||||
|
#else
|
||||||
|
"fcntl(%d, F_SETFL, %d): %s", fd, flags,
|
||||||
|
#endif
|
||||||
|
strbuf);
|
||||||
|
|
||||||
return (ISC_R_UNEXPECTED);
|
return (ISC_R_UNEXPECTED);
|
||||||
}
|
}
|
||||||
@@ -502,7 +511,7 @@ isc_entropy_createfilesource(isc_entropy_t *ent, const char *fname) {
|
|||||||
if (is_usocket)
|
if (is_usocket)
|
||||||
fd = socket(PF_UNIX, SOCK_STREAM, 0);
|
fd = socket(PF_UNIX, SOCK_STREAM, 0);
|
||||||
else
|
else
|
||||||
fd = open(fname, O_RDONLY | O_NONBLOCK, 0);
|
fd = open(fname, O_RDONLY | PORT_NONBLOCK, 0);
|
||||||
|
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
ret = isc__errno2result(errno);
|
ret = isc__errno2result(errno);
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: socket.c,v 1.250 2005/05/19 02:42:42 marka Exp $ */
|
/* $Id: socket.c,v 1.251 2005/07/08 04:30:22 marka Exp $ */
|
||||||
|
|
||||||
/*! \file */
|
/*! \file */
|
||||||
|
|
||||||
@@ -435,16 +435,25 @@ make_nonblock(int fd) {
|
|||||||
int ret;
|
int ret;
|
||||||
int flags;
|
int flags;
|
||||||
char strbuf[ISC_STRERRORSIZE];
|
char strbuf[ISC_STRERRORSIZE];
|
||||||
|
#ifdef USE_FIONBIO_IOCTL
|
||||||
|
int on = 1;
|
||||||
|
|
||||||
|
ret = ioctl(fd, FIONBIO, (char *)&on);
|
||||||
|
#else
|
||||||
flags = fcntl(fd, F_GETFL, 0);
|
flags = fcntl(fd, F_GETFL, 0);
|
||||||
flags |= O_NONBLOCK;
|
flags |= PORT_NONBLOCK;
|
||||||
ret = fcntl(fd, F_SETFL, flags);
|
ret = fcntl(fd, F_SETFL, flags);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
isc__strerror(errno, strbuf, sizeof(strbuf));
|
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||||
UNEXPECTED_ERROR(__FILE__, __LINE__,
|
UNEXPECTED_ERROR(__FILE__, __LINE__,
|
||||||
"fcntl(%d, F_SETFL, %d): %s",
|
#ifdef USE_FIONBIO_IOCTL
|
||||||
fd, flags, strbuf);
|
"ioctl(%d, FIONBIO, &on): %s", fd,
|
||||||
|
#else
|
||||||
|
"fcntl(%d, F_SETFL, %d): %s", fd, flags,
|
||||||
|
#endif
|
||||||
|
strbuf);
|
||||||
|
|
||||||
return (ISC_R_UNEXPECTED);
|
return (ISC_R_UNEXPECTED);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user