]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2185. [port] sunos: libbind: check for ssize_t, memmove() and
authorMark Andrews <marka@isc.org>
Fri, 18 May 2007 06:22:03 +0000 (06:22 +0000)
committerMark Andrews <marka@isc.org>
Fri, 18 May 2007 06:22:03 +0000 (06:22 +0000)
                        memchr(). [RT #16463]

CHANGES
lib/bind/config.h.in
lib/bind/configure.in
lib/bind/isc/ctl_clnt.c
lib/bind/port_before.h.in

diff --git a/CHANGES b/CHANGES
index 121095ef91c8335828f5016e65694b161f11b2bc..423e89a8c997240009fa2babcdbb381db6f4833d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+2185.  [port]          sunos: libbind: check for ssize_t, memmove() and
+                       memchr(). [RT #16463]
+
 2184.  [bug]           bind9.xsl.h didn't build out of the source tree.
                        [RT #16830]
 
index c4d88d347ee9c2ab01475d74b2b596fc38d0008a..69ea2854300007cd84ec62890cc5094768145b3b 100644 (file)
@@ -11,6 +11,8 @@
 #undef POSIX_GETPWNAM_R
 #undef POSIX_GETGRGID_R
 #undef POSIX_GETGRNAM_R
+#undef HAVE_MEMMOVE
+#undef HAVE_MEMCHR
 
 #undef NEED_SETGROUPENT
 #undef NEED_GETGROUPLIST
@@ -38,6 +40,7 @@
 
 #undef HAS_PW_CLASS
 
+#undef ssize_t
 #undef uintptr_t
 
 /* Shut up warnings about sputaux in stdio.h on BSD/OS pre-4.1 */ 
index 0b4dd34d3f74f1e9abe1a4417103da47fddf1938..cbb8cbdbaa506025bb29a20769f8d8a4e1ec9ea6 100644 (file)
@@ -13,7 +13,7 @@
 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 # PERFORMANCE OF THIS SOFTWARE.
 
-AC_REVISION($Revision: 1.125 $)
+AC_REVISION($Revision: 1.126 $)
 
 AC_INIT(resolv/herror.c)
 AC_PREREQ(2.13)
@@ -174,6 +174,7 @@ AC_CHECK_HEADERS(fcntl.h db.h paths.h sys/time.h unistd.h sys/sockio.h sys/selec
 AC_C_CONST
 AC_C_INLINE
 AC_TYPE_SIZE_T
+AC_CHECK_TYPE(ssize_t,signed)
 AC_CHECK_TYPE(uintptr_t,unsigned long)
 AC_HEADER_TIME
 #
@@ -458,6 +459,8 @@ AC_SUBST(WANT_IRS_THREADS_OBJS)
 AC_SUBST(WANT_THREADS_OBJS)
 
 AC_CHECK_FUNC(strlcat, AC_DEFINE(HAVE_STRLCAT))
+AC_CHECK_FUNC(memmove, AC_DEFINE(HAVE_MEMMOVE))
+AC_CHECK_FUNC(memchr, AC_DEFINE(HAVE_MEMCHR))
 
 AC_CHECK_FUNC(if_nametoindex,
        [USE_IFNAMELINKID="#define USE_IFNAMELINKID 1"],
@@ -1117,6 +1120,17 @@ AC_TRY_COMPILE([
        ISC_PLATFORM_NEEDPORTT="#define ISC_PLATFORM_NEEDPORTT 1"])
 AC_SUBST(ISC_PLATFORM_NEEDPORTT)
 
+AC_MSG_CHECKING(for struct timespec)
+AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <time.h>],
+[struct timespec ts = { 0, 0 }; return (0);],
+       [AC_MSG_RESULT(yes)
+       ISC_PLATFORM_NEEDTIMESPEC="#undef ISC_PLATFORM_NEEDTIMESPEC"],
+        [AC_MSG_RESULT(no)
+       ISC_PLATFORM_NEEDTIMESPEC="#define ISC_PLATFORM_NEEDTIMESPEC 1"])
+AC_SUBST(ISC_PLATFORM_NEEDTIMESPEC)
+
 #
 # Check for addrinfo
 #
index a53d8d1e82f630318dbcd0095f50174fdd2969d7..5438868fe9f49c69351f99938a5f55b5fa2aae31 100644 (file)
@@ -1,5 +1,5 @@
 #if !defined(lint) && !defined(SABER)
-static const char rcsid[] = "$Id: ctl_clnt.c,v 1.8 2005/04/27 04:56:35 sra Exp $";
+static const char rcsid[] = "$Id: ctl_clnt.c,v 1.9 2007/05/18 06:22:03 marka Exp $";
 #endif /* not lint */
 
 /*
@@ -114,6 +114,19 @@ static void                touch_timer(struct ctl_cctx *);
 static void            timer(evContext, void *,
                              struct timespec, struct timespec);
 
+#ifndef HAVE_MEMCHR
+static void *
+memchr(const void *b, int c, size_t len) {
+       const unsigned char *p = b;
+       size_t i;
+
+       for (i = 0; i < len; i++, p++)
+               if (*p == (unsigned char)c)
+                       return ((void *)p); 
+       return (NULL);
+}
+#endif
+
 /* Private data. */
 
 static const char * const state_names[] = {
index 606cb83dfa670cb8ee8f4f1e1e6e5426f3f51a0a..52f1b5fafdf68f241db7c6dd709ee865fa2f2001 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: port_before.h.in,v 1.25 2007/01/09 03:11:15 marka Exp $ */
+/* $Id: port_before.h.in,v 1.26 2007/05/18 06:22:03 marka Exp $ */
 
 #ifndef port_before_h
 #define port_before_h
@@ -31,6 +31,16 @@ struct timezone;        /* silence warning */
 #endif
 #include <limits.h>
 
+#ifdef ISC_PLATFORM_NEEDTIMESPEC
+#include <time.h>              /* For time_t */
+struct timespec {
+        time_t  tv_sec;         /* seconds */
+        long    tv_nsec;        /* nanoseconds */
+};
+#endif
+#ifndef HAVE_MEMMOVE
+#define memmove(a,b,c) bcopy(b,a,c)
+#endif
 
 @WANT_IRS_GR@
 @WANT_IRS_NIS@