+1898. [port] sunos: non blocking i/o support. [RT #14951]
+
1897. [func] Support for IPSECKEY rdata type. [RT #14967]
1896. [bug] The cache could delete expired records too fast for
esyscmd([sed "s/^/# /" COPYRIGHT])dnl
AC_DIVERT_POP()dnl
-AC_REVISION($Revision: 1.381 $)
+AC_REVISION($Revision: 1.382 $)
AC_INIT(lib/dns/name.c)
AC_PREREQ(2.13)
ISC_ARCH_DIR=$arch
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 documentation. They are all optional, unless you are
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-AC_REVISION($Revision: 1.103 $)
+AC_REVISION($Revision: 1.104 $)
AC_INIT(resolv/herror.c)
AC_PREREQ(2.13)
SOLARIS_BITTYPES="#undef NEED_SOLARIS_BITTYPES"
BSD_COMP="#undef BSD_COMP"
USE_FIONBIO_IOCTL="#undef USE_FIONBIO_IOCTL"
+PORT_NONBLOCK="#define PORT_NONBLOCK O_NONBLOCK"
case "$host" in
*aix3.2*) PORT_DIR="port/aix32";;
*aix4*) PORT_DIR="port/aix4";;
*aux3*) PORT_DIR="port/aux3";;
*-bsdi2*) PORT_DIR="port/bsdos2";;
*-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";;
*-osf*) PORT_DIR="port/decunix";;
*-freebsd*) PORT_DIR="port/freebsd";;
*-openbsd*) PORT_DIR="port/openbsd";;
*-qnx*) PORT_DIR="port/qnx";;
*-rhapsody*) PORT_DIR="port/rhapsody";;
+ *-sunos4*)
+ PORT_NONBLOCK="#define PORT_NONBLOCK O_NDELAY"
+ PORT_DIR="port/sunos";;
*-solaris2.[[01234]]*)
BSD_COMP="#define BSD_COMP 1"
SOLARIS_BITTYPES="#define NEED_SOLARIS_BITTYPES 1"
AC_SUBST(BSD_COMP)
AC_SUBST(SOLARIS_BITTYPES)
AC_SUBST(USE_FIONBIO_IOCTL)
+AC_SUBST(PORT_NONBLOCK)
AC_SUBST(PORT_DIR)
PORT_INCLUDE=${PORT_DIR}/include
AC_SUBST(PORT_INCLUDE)
*/
#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
/* Import. */
return (-1);
} else {
#ifdef USE_FIONBIO_IOCTL
- int on = 1;
- OK(ioctl(this->fd, FIONBIO, (char *)&on));
+ int off = 0;
+ OK(ioctl(this->fd, FIONBIO, (char *)&off));
#else
- OK(fcntl(this->fd, F_SETFL, mode | PORT_NONBLOCK));
+ OK(fcntl(this->fd, F_SETFL, mode & ~PORT_NONBLOCK));
#endif
}
}
*/
#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
#include "port_before.h"
* and (b) the caller didn't ask us anything about O_NONBLOCK.
*/
#ifdef USE_FIONBIO_IOCTL
- int off = 1;
+ int off = 0;
(void) ioctl(del->fd, FIONBIO, (char *)&off);
#else
(void) fcntl(del->fd, F_SETFL, mode & ~PORT_NONBLOCK);
@INNETGR_ARGS@
@SETNETGRENT_ARGS@
@USE_IFNAMELINKID@
-
-/* XXX sunos and cygwin needs O_NDELAY */
-#define PORT_NONBLOCK O_NONBLOCK
+@PORT_NONBLOCK@
/*! \brief
* We need to know the IPv6 address family number even on IPv4-only systems.
* 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
* \brief
int ret;
int flags;
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 |= O_NONBLOCK;
+ flags |= PORT_NONBLOCK;
ret = fcntl(fd, F_SETFL, flags);
+#endif
if (ret == -1) {
isc__strerror(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
- "fcntl(%d, F_SETFL, %d): %s",
- fd, flags, strbuf);
+#ifdef USE_FIONBIO_IOCTL
+ "ioctl(%d, FIONBIO, &on): %s", fd,
+#else
+ "fcntl(%d, F_SETFL, %d): %s", fd, flags,
+#endif
+ strbuf);
return (ISC_R_UNEXPECTED);
}
if (is_usocket)
fd = socket(PF_UNIX, SOCK_STREAM, 0);
else
- fd = open(fname, O_RDONLY | O_NONBLOCK, 0);
+ fd = open(fname, O_RDONLY | PORT_NONBLOCK, 0);
if (fd < 0) {
ret = isc__errno2result(errno);
* 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 */
int ret;
int flags;
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 |= O_NONBLOCK;
+ flags |= PORT_NONBLOCK;
ret = fcntl(fd, F_SETFL, flags);
+#endif
if (ret == -1) {
isc__strerror(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
- "fcntl(%d, F_SETFL, %d): %s",
- fd, flags, strbuf);
+#ifdef USE_FIONBIO_IOCTL
+ "ioctl(%d, FIONBIO, &on): %s", fd,
+#else
+ "fcntl(%d, F_SETFL, %d): %s", fd, flags,
+#endif
+ strbuf);
return (ISC_R_UNEXPECTED);
}