mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-29 21:47:59 +00:00
1883. [port] sunos: portability fixes. [RT #14814]
This commit is contained in:
parent
ab9871e71e
commit
e7fb847ed5
2
CHANGES
2
CHANGES
@ -1,3 +1,5 @@
|
|||||||
|
1883. [port] sunos: portability fixes. [RT #14814]
|
||||||
|
|
||||||
1882. [port] win32: isc__errno2result() now reports its caller.
|
1882. [port] win32: isc__errno2result() now reports its caller.
|
||||||
[RT #13753]
|
[RT #13753]
|
||||||
|
|
||||||
|
@ -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.
|
||||||
|
|
||||||
# $Id: Makefile.in,v 1.124 2005/03/17 03:56:10 marka Exp $
|
# $Id: Makefile.in,v 1.125 2005/06/08 02:06:57 marka Exp $
|
||||||
|
|
||||||
srcdir = @srcdir@
|
srcdir = @srcdir@
|
||||||
VPATH = @srcdir@
|
VPATH = @srcdir@
|
||||||
@ -90,7 +90,9 @@ XTARGETS = adb_test@EXEEXT@ \
|
|||||||
zone_test@EXEEXT@
|
zone_test@EXEEXT@
|
||||||
|
|
||||||
# Alphabetically
|
# Alphabetically
|
||||||
SRCS = adb_test.c \
|
SRCS = cfg_test.c genrandom.c ${XSRCS}
|
||||||
|
|
||||||
|
XSRCS = adb_test.c \
|
||||||
byaddr_test.c \
|
byaddr_test.c \
|
||||||
byname_test.c \
|
byname_test.c \
|
||||||
compress_test.c \
|
compress_test.c \
|
||||||
@ -133,7 +135,7 @@ SRCS = adb_test.c \
|
|||||||
all_tests: ${XTARGETS}
|
all_tests: ${XTARGETS}
|
||||||
|
|
||||||
genrandom@EXEEXT@: genrandom.@O@
|
genrandom@EXEEXT@: genrandom.@O@
|
||||||
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ genrandom.@O@
|
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ genrandom.@O@ @GENRANDOMLIB@
|
||||||
|
|
||||||
adb_test@EXEEXT@: adb_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
|
adb_test@EXEEXT@: adb_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
|
||||||
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ adb_test.@O@ \
|
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ adb_test.@O@ \
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: config.h.in,v 1.66 2005/05/11 06:05:28 sra Exp $ */
|
/* $Id: config.h.in,v 1.67 2005/06/08 02:09:18 marka Exp $ */
|
||||||
|
|
||||||
/*! \file */
|
/*! \file */
|
||||||
|
|
||||||
@ -231,6 +231,9 @@ int sigwait(const unsigned int *set, int *sig);
|
|||||||
/* Define to 1 if you have the <unistd.h> header file. */
|
/* Define to 1 if you have the <unistd.h> header file. */
|
||||||
#undef HAVE_UNISTD_H
|
#undef HAVE_UNISTD_H
|
||||||
|
|
||||||
|
/* Defined if extern char *optarg is not declared. */
|
||||||
|
#undef NEED_OPTARG
|
||||||
|
|
||||||
/* Define if connect does not honour the permission on the UNIX domain socket.
|
/* Define if connect does not honour the permission on the UNIX domain socket.
|
||||||
*/
|
*/
|
||||||
#undef NEED_SECURE_DIRECTORY
|
#undef NEED_SECURE_DIRECTORY
|
||||||
|
71
configure
vendored
71
configure
vendored
@ -14,7 +14,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.
|
||||||
#
|
#
|
||||||
# $Id: configure,v 1.364 2005/06/08 00:50:08 marka Exp $
|
# $Id: configure,v 1.365 2005/06/08 02:09:18 marka Exp $
|
||||||
#
|
#
|
||||||
# Portions Copyright (C) 1996-2001 Nominum, Inc.
|
# Portions Copyright (C) 1996-2001 Nominum, Inc.
|
||||||
#
|
#
|
||||||
@ -29,7 +29,7 @@
|
|||||||
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||||
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
|
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
|
||||||
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
# From configure.in Revision: 1.377 .
|
# From configure.in Revision: 1.378 .
|
||||||
# Guess values for system-dependent variables and create Makefiles.
|
# Guess values for system-dependent variables and create Makefiles.
|
||||||
# Generated by GNU Autoconf 2.59.
|
# Generated by GNU Autoconf 2.59.
|
||||||
#
|
#
|
||||||
@ -495,7 +495,7 @@ ac_includes_default="\
|
|||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
#endif"
|
#endif"
|
||||||
|
|
||||||
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS subdirs build build_cpu build_vendor build_os host host_cpu host_vendor host_os SET_MAKE RANLIB ac_ct_RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA STD_CINCLUDES STD_CDEFINES STD_CWARNINGS CCOPT AR ARFLAGS LN ETAGS PERL CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP ISC_SOCKADDR_LEN_T ISC_PLATFORM_HAVELONGLONG ISC_PLATFORM_HAVELIFCONF ISC_PLATFORM_NEEDSYSSELECTH LWRES_PLATFORM_NEEDSYSSELECTH USE_OPENSSL DST_OPENSSL_INC USE_GSSAPI DST_GSSAPI_INC DNS_CRYPTO_LIBS ALWAYS_DEFINES ISC_PLATFORM_USETHREADS ISC_THREAD_DIR MKDEPCC MKDEPCFLAGS MKDEPPROG IRIX_DNSSEC_WARNINGS_HACK purify_path PURIFY LN_S ECHO ac_ct_AR STRIP ac_ct_STRIP CXX CXXFLAGS ac_ct_CXX CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL O A SA LIBTOOL_MKDEP_SED LIBTOOL_MODE_COMPILE LIBTOOL_MODE_INSTALL LIBTOOL_MODE_LINK LIBTOOL_ALLOW_UNDEFINED LIBTOOL_IN_MAIN LIBBIND ISC_PLATFORM_HAVEIPV6 LWRES_PLATFORM_HAVEIPV6 ISC_PLATFORM_NEEDNETINETIN6H LWRES_PLATFORM_NEEDNETINETIN6H ISC_PLATFORM_NEEDNETINET6IN6H LWRES_PLATFORM_NEEDNETINET6IN6H ISC_PLATFORM_HAVEINADDR6 LWRES_PLATFORM_HAVEINADDR6 ISC_PLATFORM_NEEDIN6ADDRANY LWRES_PLATFORM_NEEDIN6ADDRANY ISC_PLATFORM_NEEDIN6ADDRLOOPBACK LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK ISC_PLATFORM_HAVEIN6PKTINFO ISC_PLATFORM_FIXIN6ISADDR ISC_IPV6_H ISC_IPV6_O ISC_ISCIPV6_O ISC_IPV6_C LWRES_HAVE_SIN6_SCOPE_ID ISC_PLATFORM_HAVESCOPEID ISC_PLATFORM_HAVEIF_LADDRREQ ISC_PLATFORM_HAVEIF_LADDRCONF ISC_PLATFORM_NEEDNTOP ISC_PLATFORM_NEEDPTON ISC_PLATFORM_NEEDATON ISC_PLATFORM_HAVESALEN LWRES_PLATFORM_HAVESALEN ISC_PLATFORM_MSGHDRFLAVOR ISC_PLATFORM_NEEDPORTT ISC_LWRES_NEEDADDRINFO ISC_LWRES_NEEDRRSETINFO ISC_LWRES_SETHOSTENTINT ISC_LWRES_ENDHOSTENTINT ISC_LWRES_GETNETBYADDRINADDR ISC_LWRES_SETNETENTINT ISC_LWRES_ENDNETENTINT ISC_LWRES_GETHOSTBYADDRVOID ISC_LWRES_NEEDHERRNO ISC_LWRES_GETIPNODEPROTO ISC_LWRES_GETADDRINFOPROTO ISC_LWRES_GETNAMEINFOPROTO ISC_PLATFORM_NEEDSTRSEP ISC_PLATFORM_NEEDMEMMOVE ISC_PLATFORM_NEEDSTRTOUL ISC_PLATFORM_NEEDSTRLCPY ISC_PLATFORM_NEEDSTRLCAT ISC_PLATFORM_NEEDSPRINTF LWRES_PLATFORM_NEEDSPRINTF ISC_PLATFORM_NEEDVSNPRINTF LWRES_PLATFORM_NEEDVSNPRINTF ISC_EXTRA_OBJS ISC_EXTRA_SRCS ISC_PLATFORM_QUADFORMAT LWRES_PLATFORM_QUADFORMAT ISC_PLATFORM_HAVESYSUNH ISC_PLATFORM_RLIMITTYPE ISC_PLATFORM_USEDECLSPEC LWRES_PLATFORM_USEDECLSPEC ISC_PLATFORM_BRACEPTHREADONCEINIT ISC_PLATFORM_HAVEIFNAMETOINDEX ISC_PLATFORM_HAVEXADD ISC_PLATFORM_HAVECMPXCHG ISC_PLATFORM_HAVEATOMICSTORE ISC_PLATFORM_USEOSFASM ISC_ARCH_DIR LATEX PDFLATEX XSLTPROC XMLLINT XSLT_DOCBOOK_STYLE_HTML XSLT_DOCBOOK_STYLE_XHTML XSLT_DOCBOOK_STYLE_MAN XSLT_DOCBOOK_CHUNK_HTML XSLT_DOCBOOK_CHUNK_XHTML XSLT_DB2LATEX_STYLE XSLT_DB2LATEX_ADMONITIONS BIND9_TOP_BUILDDIR BIND9_ISC_BUILDINCLUDE BIND9_ISCCC_BUILDINCLUDE BIND9_ISCCFG_BUILDINCLUDE BIND9_DNS_BUILDINCLUDE BIND9_LWRES_BUILDINCLUDE BIND9_BIND9_BUILDINCLUDE BIND9_VERSION LIBOBJS LTLIBOBJS'
|
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS subdirs build build_cpu build_vendor build_os host host_cpu host_vendor host_os SET_MAKE RANLIB ac_ct_RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA STD_CINCLUDES STD_CDEFINES STD_CWARNINGS CCOPT AR ARFLAGS LN ETAGS PERL CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP ISC_SOCKADDR_LEN_T ISC_PLATFORM_HAVELONGLONG ISC_PLATFORM_HAVELIFCONF ISC_PLATFORM_NEEDSYSSELECTH LWRES_PLATFORM_NEEDSYSSELECTH USE_OPENSSL DST_OPENSSL_INC USE_GSSAPI DST_GSSAPI_INC DNS_CRYPTO_LIBS ALWAYS_DEFINES ISC_PLATFORM_USETHREADS ISC_THREAD_DIR MKDEPCC MKDEPCFLAGS MKDEPPROG IRIX_DNSSEC_WARNINGS_HACK purify_path PURIFY LN_S ECHO ac_ct_AR STRIP ac_ct_STRIP CXX CXXFLAGS ac_ct_CXX CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL O A SA LIBTOOL_MKDEP_SED LIBTOOL_MODE_COMPILE LIBTOOL_MODE_INSTALL LIBTOOL_MODE_LINK LIBTOOL_ALLOW_UNDEFINED LIBTOOL_IN_MAIN LIBBIND ISC_PLATFORM_HAVEIPV6 LWRES_PLATFORM_HAVEIPV6 ISC_PLATFORM_NEEDNETINETIN6H LWRES_PLATFORM_NEEDNETINETIN6H ISC_PLATFORM_NEEDNETINET6IN6H LWRES_PLATFORM_NEEDNETINET6IN6H ISC_PLATFORM_HAVEINADDR6 LWRES_PLATFORM_HAVEINADDR6 ISC_PLATFORM_NEEDIN6ADDRANY LWRES_PLATFORM_NEEDIN6ADDRANY ISC_PLATFORM_NEEDIN6ADDRLOOPBACK LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK ISC_PLATFORM_HAVEIN6PKTINFO ISC_PLATFORM_FIXIN6ISADDR ISC_IPV6_H ISC_IPV6_O ISC_ISCIPV6_O ISC_IPV6_C LWRES_HAVE_SIN6_SCOPE_ID ISC_PLATFORM_HAVESCOPEID ISC_PLATFORM_HAVEIF_LADDRREQ ISC_PLATFORM_HAVEIF_LADDRCONF ISC_PLATFORM_NEEDNTOP ISC_PLATFORM_NEEDPTON ISC_PLATFORM_NEEDATON ISC_PLATFORM_HAVESALEN LWRES_PLATFORM_HAVESALEN ISC_PLATFORM_MSGHDRFLAVOR ISC_PLATFORM_NEEDPORTT ISC_LWRES_NEEDADDRINFO ISC_LWRES_NEEDRRSETINFO ISC_LWRES_SETHOSTENTINT ISC_LWRES_ENDHOSTENTINT ISC_LWRES_GETNETBYADDRINADDR ISC_LWRES_SETNETENTINT ISC_LWRES_ENDNETENTINT ISC_LWRES_GETHOSTBYADDRVOID ISC_LWRES_NEEDHERRNO ISC_LWRES_GETIPNODEPROTO ISC_LWRES_GETADDRINFOPROTO ISC_LWRES_GETNAMEINFOPROTO ISC_PLATFORM_NEEDSTRSEP ISC_PLATFORM_NEEDMEMMOVE ISC_PLATFORM_NEEDSTRTOUL LWRES_PLATFORM_NEEDSTRTOUL GENRANDOMLIB ISC_PLATFORM_NEEDSTRLCPY ISC_PLATFORM_NEEDSTRLCAT ISC_PLATFORM_NEEDSPRINTF LWRES_PLATFORM_NEEDSPRINTF ISC_PLATFORM_NEEDVSNPRINTF LWRES_PLATFORM_NEEDVSNPRINTF ISC_EXTRA_OBJS ISC_EXTRA_SRCS ISC_PLATFORM_QUADFORMAT LWRES_PLATFORM_QUADFORMAT ISC_PLATFORM_HAVESYSUNH ISC_PLATFORM_RLIMITTYPE ISC_PLATFORM_USEDECLSPEC LWRES_PLATFORM_USEDECLSPEC ISC_PLATFORM_BRACEPTHREADONCEINIT ISC_PLATFORM_HAVEIFNAMETOINDEX ISC_PLATFORM_HAVEXADD ISC_PLATFORM_HAVECMPXCHG ISC_PLATFORM_HAVEATOMICSTORE ISC_PLATFORM_USEOSFASM ISC_ARCH_DIR LATEX PDFLATEX XSLTPROC XMLLINT XSLT_DOCBOOK_STYLE_HTML XSLT_DOCBOOK_STYLE_XHTML XSLT_DOCBOOK_STYLE_MAN XSLT_DOCBOOK_CHUNK_HTML XSLT_DOCBOOK_CHUNK_XHTML XSLT_DB2LATEX_STYLE XSLT_DB2LATEX_ADMONITIONS BIND9_TOP_BUILDDIR BIND9_ISC_BUILDINCLUDE BIND9_ISCCC_BUILDINCLUDE BIND9_ISCCFG_BUILDINCLUDE BIND9_DNS_BUILDINCLUDE BIND9_LWRES_BUILDINCLUDE BIND9_BIND9_BUILDINCLUDE BIND9_VERSION LIBOBJS LTLIBOBJS'
|
||||||
ac_subst_files='BIND9_MAKE_INCLUDES BIND9_MAKE_RULES LIBISC_API LIBISCCC_API LIBISCCFG_API LIBDNS_API LIBBIND9_API LIBLWRES_API'
|
ac_subst_files='BIND9_MAKE_INCLUDES BIND9_MAKE_RULES LIBISC_API LIBISCCC_API LIBISCCFG_API LIBDNS_API LIBBIND9_API LIBLWRES_API'
|
||||||
|
|
||||||
# Initialize some variables set by options.
|
# Initialize some variables set by options.
|
||||||
@ -25518,12 +25518,18 @@ echo "$as_me:$LINENO: result: $ac_cv_func_strtoul" >&5
|
|||||||
echo "${ECHO_T}$ac_cv_func_strtoul" >&6
|
echo "${ECHO_T}$ac_cv_func_strtoul" >&6
|
||||||
if test $ac_cv_func_strtoul = yes; then
|
if test $ac_cv_func_strtoul = yes; then
|
||||||
ISC_PLATFORM_NEEDSTRTOUL="#undef ISC_PLATFORM_NEEDSTRTOUL"
|
ISC_PLATFORM_NEEDSTRTOUL="#undef ISC_PLATFORM_NEEDSTRTOUL"
|
||||||
|
LWRES_PLATFORM_NEEDSTRTOUL="#undef ISC_PLATFORM_NEEDSTRTOUL"
|
||||||
|
GENRANDOMLIB=""
|
||||||
else
|
else
|
||||||
ISC_PLATFORM_NEEDSTRTOUL="#define ISC_PLATFORM_NEEDSTRTOUL 1"
|
ISC_PLATFORM_NEEDSTRTOUL="#define ISC_PLATFORM_NEEDSTRTOUL 1"
|
||||||
|
LWRES_PLATFORM_NEEDSTRTOUL="#define ISC_PLATFORM_NEEDSTRTOUL 1"
|
||||||
|
"GENRANDOMLIB=${ISCLIBS}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo "$as_me:$LINENO: checking for strlcpy" >&5
|
echo "$as_me:$LINENO: checking for strlcpy" >&5
|
||||||
echo $ECHO_N "checking for strlcpy... $ECHO_C" >&6
|
echo $ECHO_N "checking for strlcpy... $ECHO_C" >&6
|
||||||
if test "${ac_cv_func_strlcpy+set}" = set; then
|
if test "${ac_cv_func_strlcpy+set}" = set; then
|
||||||
@ -26743,6 +26749,63 @@ _ACEOF
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
echo "$as_me:$LINENO: checking for optarg decarartion" >&5
|
||||||
|
echo $ECHO_N "checking for optarg decarartion... $ECHO_C" >&6
|
||||||
|
cat >conftest.$ac_ext <<_ACEOF
|
||||||
|
/* confdefs.h. */
|
||||||
|
_ACEOF
|
||||||
|
cat confdefs.h >>conftest.$ac_ext
|
||||||
|
cat >>conftest.$ac_ext <<_ACEOF
|
||||||
|
/* end confdefs.h. */
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
optarg = 0;
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_ACEOF
|
||||||
|
rm -f conftest.$ac_objext
|
||||||
|
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
|
||||||
|
(eval $ac_compile) 2>conftest.er1
|
||||||
|
ac_status=$?
|
||||||
|
grep -v '^ *+' conftest.er1 >conftest.err
|
||||||
|
rm -f conftest.er1
|
||||||
|
cat conftest.err >&5
|
||||||
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||||
|
(exit $ac_status); } &&
|
||||||
|
{ ac_try='test -z "$ac_c_werror_flag"
|
||||||
|
|| test ! -s conftest.err'
|
||||||
|
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||||
|
(eval $ac_try) 2>&5
|
||||||
|
ac_status=$?
|
||||||
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||||
|
(exit $ac_status); }; } &&
|
||||||
|
{ ac_try='test -s conftest.$ac_objext'
|
||||||
|
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||||
|
(eval $ac_try) 2>&5
|
||||||
|
ac_status=$?
|
||||||
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||||
|
(exit $ac_status); }; }; then
|
||||||
|
echo "$as_me:$LINENO: result: yes" >&5
|
||||||
|
echo "${ECHO_T}yes" >&6
|
||||||
|
else
|
||||||
|
echo "$as_me: failed program was:" >&5
|
||||||
|
sed 's/^/| /' conftest.$ac_ext >&5
|
||||||
|
|
||||||
|
echo "$as_me:$LINENO: result: no" >&5
|
||||||
|
echo "${ECHO_T}no" >&6
|
||||||
|
|
||||||
|
cat >>confdefs.h <<\_ACEOF
|
||||||
|
#define NEED_OPTARG 1
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
fi
|
||||||
|
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||||
|
|
||||||
#
|
#
|
||||||
# BSD/OS, and perhaps some others, don't define rlim_t.
|
# BSD/OS, and perhaps some others, don't define rlim_t.
|
||||||
#
|
#
|
||||||
@ -28729,6 +28792,8 @@ s,@ISC_LWRES_GETNAMEINFOPROTO@,$ISC_LWRES_GETNAMEINFOPROTO,;t t
|
|||||||
s,@ISC_PLATFORM_NEEDSTRSEP@,$ISC_PLATFORM_NEEDSTRSEP,;t t
|
s,@ISC_PLATFORM_NEEDSTRSEP@,$ISC_PLATFORM_NEEDSTRSEP,;t t
|
||||||
s,@ISC_PLATFORM_NEEDMEMMOVE@,$ISC_PLATFORM_NEEDMEMMOVE,;t t
|
s,@ISC_PLATFORM_NEEDMEMMOVE@,$ISC_PLATFORM_NEEDMEMMOVE,;t t
|
||||||
s,@ISC_PLATFORM_NEEDSTRTOUL@,$ISC_PLATFORM_NEEDSTRTOUL,;t t
|
s,@ISC_PLATFORM_NEEDSTRTOUL@,$ISC_PLATFORM_NEEDSTRTOUL,;t t
|
||||||
|
s,@LWRES_PLATFORM_NEEDSTRTOUL@,$LWRES_PLATFORM_NEEDSTRTOUL,;t t
|
||||||
|
s,@GENRANDOMLIB@,$GENRANDOMLIB,;t t
|
||||||
s,@ISC_PLATFORM_NEEDSTRLCPY@,$ISC_PLATFORM_NEEDSTRLCPY,;t t
|
s,@ISC_PLATFORM_NEEDSTRLCPY@,$ISC_PLATFORM_NEEDSTRLCPY,;t t
|
||||||
s,@ISC_PLATFORM_NEEDSTRLCAT@,$ISC_PLATFORM_NEEDSTRLCAT,;t t
|
s,@ISC_PLATFORM_NEEDSTRLCAT@,$ISC_PLATFORM_NEEDSTRLCAT,;t t
|
||||||
s,@ISC_PLATFORM_NEEDSPRINTF@,$ISC_PLATFORM_NEEDSPRINTF,;t t
|
s,@ISC_PLATFORM_NEEDSPRINTF@,$ISC_PLATFORM_NEEDSPRINTF,;t t
|
||||||
|
21
configure.in
21
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.377 $)
|
AC_REVISION($Revision: 1.378 $)
|
||||||
|
|
||||||
AC_INIT(lib/dns/name.c)
|
AC_INIT(lib/dns/name.c)
|
||||||
AC_PREREQ(2.13)
|
AC_PREREQ(2.13)
|
||||||
@ -1551,9 +1551,15 @@ AC_CHECK_FUNC(memmove,
|
|||||||
AC_SUBST(ISC_PLATFORM_NEEDMEMMOVE)
|
AC_SUBST(ISC_PLATFORM_NEEDMEMMOVE)
|
||||||
|
|
||||||
AC_CHECK_FUNC(strtoul,
|
AC_CHECK_FUNC(strtoul,
|
||||||
[ISC_PLATFORM_NEEDSTRTOUL="#undef ISC_PLATFORM_NEEDSTRTOUL"],
|
[ISC_PLATFORM_NEEDSTRTOUL="#undef ISC_PLATFORM_NEEDSTRTOUL"
|
||||||
[ISC_PLATFORM_NEEDSTRTOUL="#define ISC_PLATFORM_NEEDSTRTOUL 1"])
|
LWRES_PLATFORM_NEEDSTRTOUL="#undef ISC_PLATFORM_NEEDSTRTOUL"
|
||||||
|
GENRANDOMLIB=""],
|
||||||
|
[ISC_PLATFORM_NEEDSTRTOUL="#define ISC_PLATFORM_NEEDSTRTOUL 1"
|
||||||
|
LWRES_PLATFORM_NEEDSTRTOUL="#define ISC_PLATFORM_NEEDSTRTOUL 1"
|
||||||
|
"GENRANDOMLIB=${ISCLIBS}"])
|
||||||
AC_SUBST(ISC_PLATFORM_NEEDSTRTOUL)
|
AC_SUBST(ISC_PLATFORM_NEEDSTRTOUL)
|
||||||
|
AC_SUBST(LWRES_PLATFORM_NEEDSTRTOUL)
|
||||||
|
AC_SUBST(GENRANDOMLIB)
|
||||||
|
|
||||||
AC_CHECK_FUNC(strlcpy,
|
AC_CHECK_FUNC(strlcpy,
|
||||||
[ISC_PLATFORM_NEEDSTRLCPY="#undef ISC_PLATFORM_NEEDSTRLCPY"],
|
[ISC_PLATFORM_NEEDSTRLCPY="#undef ISC_PLATFORM_NEEDSTRLCPY"],
|
||||||
@ -1676,6 +1682,15 @@ esac
|
|||||||
#
|
#
|
||||||
AC_CHECK_FUNC(tzset, AC_DEFINE(HAVE_TZSET))
|
AC_CHECK_FUNC(tzset, AC_DEFINE(HAVE_TZSET))
|
||||||
|
|
||||||
|
AC_MSG_CHECKING(for optarg decarartion)
|
||||||
|
AC_TRY_COMPILE([
|
||||||
|
#include <unistd.h>
|
||||||
|
],
|
||||||
|
[optarg = 0;],
|
||||||
|
[AC_MSG_RESULT(yes)],
|
||||||
|
[AC_MSG_RESULT(no)
|
||||||
|
AC_DEFINE(NEED_OPTARG, 1, [Defined if extern char *optarg is not declared.])])
|
||||||
|
|
||||||
#
|
#
|
||||||
# BSD/OS, and perhaps some others, don't define rlim_t.
|
# BSD/OS, and perhaps some others, don't define rlim_t.
|
||||||
#
|
#
|
||||||
|
@ -30,9 +30,9 @@ rt13562 open marka
|
|||||||
rt13587 review
|
rt13587 review
|
||||||
rt13606 open marka // TSIG SHA256
|
rt13606 open marka // TSIG SHA256
|
||||||
rt13662 open marka // rrset-order fixed
|
rt13662 open marka // rrset-order fixed
|
||||||
rt13753 review
|
rt13753 closed
|
||||||
rt14775 closed
|
rt14775 closed
|
||||||
rt14814 review
|
rt14814 closed
|
||||||
rt14815 open marka
|
rt14815 open marka
|
||||||
rt14855 open // 9.4 ARM review
|
rt14855 open // 9.4 ARM review
|
||||||
rt5206_1 open marka
|
rt5206_1 open marka
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: gen-unix.h,v 1.16 2005/04/29 00:22:46 marka Exp $ */
|
/* $Id: gen-unix.h,v 1.17 2005/06/08 02:06:58 marka Exp $ */
|
||||||
|
|
||||||
/*! \file
|
/*! \file
|
||||||
* \brief
|
* \brief
|
||||||
@ -41,6 +41,10 @@
|
|||||||
#include <isc/boolean.h>
|
#include <isc/boolean.h>
|
||||||
#include <isc/lang.h>
|
#include <isc/lang.h>
|
||||||
|
|
||||||
|
#ifdef NEED_OPTARG
|
||||||
|
extern char *optarg;
|
||||||
|
#endif
|
||||||
|
|
||||||
#define isc_commandline_parse getopt
|
#define isc_commandline_parse getopt
|
||||||
#define isc_commandline_argument optarg
|
#define isc_commandline_argument optarg
|
||||||
|
|
||||||
|
@ -15,11 +15,12 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: journal.c,v 1.92 2005/06/07 02:02:05 marka Exp $ */
|
/* $Id: journal.c,v 1.93 2005/06/08 02:06:58 marka Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <isc/file.h>
|
#include <isc/file.h>
|
||||||
#include <isc/mem.h>
|
#include <isc/mem.h>
|
||||||
|
@ -15,10 +15,11 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: key.c,v 1.3 2005/04/29 00:22:47 marka Exp $ */
|
/* $Id: key.c,v 1.4 2005/06/08 02:06:59 marka Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <isc/region.h>
|
#include <isc/region.h>
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: print.h,v 1.21 2005/04/29 00:23:42 marka Exp $ */
|
/* $Id: print.h,v 1.22 2005/06/08 02:07:00 marka Exp $ */
|
||||||
|
|
||||||
#ifndef ISC_PRINT_H
|
#ifndef ISC_PRINT_H
|
||||||
#define ISC_PRINT_H 1
|
#define ISC_PRINT_H 1
|
||||||
@ -57,6 +57,10 @@
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef ISC_PLATFORM_NEEDSPRINTF
|
||||||
|
#include <stdio.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
ISC_LANG_BEGINDECLS
|
ISC_LANG_BEGINDECLS
|
||||||
|
|
||||||
|
@ -15,12 +15,13 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: lfsr.c,v 1.16 2005/04/29 00:23:27 marka Exp $ */
|
/* $Id: lfsr.c,v 1.17 2005/06/08 02:06:59 marka Exp $ */
|
||||||
|
|
||||||
/*! \file */
|
/*! \file */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <isc/assertions.h>
|
#include <isc/assertions.h>
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: msgcat.c,v 1.15 2005/04/29 00:23:47 marka Exp $ */
|
/* $Id: msgcat.c,v 1.16 2005/06/08 02:07:00 marka Exp $ */
|
||||||
|
|
||||||
/*! \file msgcat.c
|
/*! \file msgcat.c
|
||||||
*
|
*
|
||||||
@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <isc/magic.h>
|
#include <isc/magic.h>
|
||||||
|
@ -15,12 +15,13 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: result.c,v 1.66 2005/04/29 00:23:30 marka Exp $ */
|
/* $Id: result.c,v 1.67 2005/06/08 02:06:59 marka Exp $ */
|
||||||
|
|
||||||
/*! \file */
|
/*! \file */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <isc/lib.h>
|
#include <isc/lib.h>
|
||||||
|
@ -15,12 +15,13 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: stdtime.c,v 1.16 2005/04/29 00:23:51 marka Exp $ */
|
/* $Id: stdtime.c,v 1.17 2005/06/08 02:07:01 marka Exp $ */
|
||||||
|
|
||||||
/*! \file */
|
/*! \file */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
|
#include <stddef.h> /* NULL */
|
||||||
#include <stdlib.h> /* NULL */
|
#include <stdlib.h> /* NULL */
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
|
|
||||||
|
@ -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.
|
||||||
|
|
||||||
# $Id: Makefile.in,v 1.30 2004/08/28 06:16:59 marka Exp $
|
# $Id: Makefile.in,v 1.31 2005/06/08 02:07:01 marka Exp $
|
||||||
|
|
||||||
srcdir = @srcdir@
|
srcdir = @srcdir@
|
||||||
VPATH = @srcdir@
|
VPATH = @srcdir@
|
||||||
@ -35,14 +35,16 @@ OBJS = context.@O@ gai_strerror.@O@ getaddrinfo.@O@ gethost.@O@ \
|
|||||||
getipnode.@O@ getnameinfo.@O@ getrrset.@O@ herror.@O@ \
|
getipnode.@O@ getnameinfo.@O@ getrrset.@O@ herror.@O@ \
|
||||||
lwbuffer.@O@ lwconfig.@O@ lwpacket.@O@ lwresutil.@O@ \
|
lwbuffer.@O@ lwconfig.@O@ lwpacket.@O@ lwresutil.@O@ \
|
||||||
lwres_gabn.@O@ lwres_gnba.@O@ lwres_grbn.@O@ lwres_noop.@O@ \
|
lwres_gabn.@O@ lwres_gnba.@O@ lwres_grbn.@O@ lwres_noop.@O@ \
|
||||||
lwinetaton.@O@ lwinetpton.@O@ lwinetntop.@O@ print.@O@
|
lwinetaton.@O@ lwinetpton.@O@ lwinetntop.@O@ print.@O@ \
|
||||||
|
strtoul.@O@
|
||||||
|
|
||||||
# Alphabetically
|
# Alphabetically
|
||||||
SRCS = context.c gai_strerror.c getaddrinfo.c gethost.c \
|
SRCS = context.c gai_strerror.c getaddrinfo.c gethost.c \
|
||||||
getipnode.c getnameinfo.c getrrset.c herror.c \
|
getipnode.c getnameinfo.c getrrset.c herror.c \
|
||||||
lwbuffer.c lwconfig.c lwpacket.c lwresutil.c \
|
lwbuffer.c lwconfig.c lwpacket.c lwresutil.c \
|
||||||
lwres_gabn.c lwres_gnba.c lwres_grbn.c lwres_noop.c \
|
lwres_gabn.c lwres_gnba.c lwres_grbn.c lwres_noop.c \
|
||||||
lwinetaton.c lwinetpton.c lwinetntop.c print.c
|
lwinetaton.c lwinetpton.c lwinetntop.c print.c \
|
||||||
|
strtoul.c
|
||||||
|
|
||||||
LIBS = @LIBS@
|
LIBS = @LIBS@
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: getaddrinfo.c,v 1.45 2005/04/29 00:24:05 marka Exp $ */
|
/* $Id: getaddrinfo.c,v 1.46 2005/06/08 02:07:01 marka Exp $ */
|
||||||
|
|
||||||
/*! \file */
|
/*! \file */
|
||||||
|
|
||||||
@ -135,11 +135,11 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#include <lwres/lwres.h>
|
#include <lwres/lwres.h>
|
||||||
#include <lwres/net.h>
|
#include <lwres/net.h>
|
||||||
#include <lwres/netdb.h>
|
#include <lwres/netdb.h>
|
||||||
|
#include <lwres/stdlib.h>
|
||||||
|
|
||||||
#define SA(addr) ((struct sockaddr *)(addr))
|
#define SA(addr) ((struct sockaddr *)(addr))
|
||||||
#define SIN(addr) ((struct sockaddr_in *)(addr))
|
#define SIN(addr) ((struct sockaddr_in *)(addr))
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: platform.h.in,v 1.18 2005/05/06 02:09:51 marka Exp $ */
|
/* $Id: platform.h.in,v 1.19 2005/06/08 02:07:03 marka Exp $ */
|
||||||
|
|
||||||
/*! \file */
|
/*! \file */
|
||||||
|
|
||||||
@ -95,6 +95,11 @@
|
|||||||
*/
|
*/
|
||||||
@LWRES_PLATFORM_QUADFORMAT@
|
@LWRES_PLATFORM_QUADFORMAT@
|
||||||
|
|
||||||
|
/*! \brief
|
||||||
|
* Define if this system needs strtoul.
|
||||||
|
*/
|
||||||
|
@LWRES_PLATFORM_NEEDSTRTOUL@
|
||||||
|
|
||||||
#ifndef LWRES_PLATFORM_USEDECLSPEC
|
#ifndef LWRES_PLATFORM_USEDECLSPEC
|
||||||
#define LIBLWRES_EXTERNAL_DATA
|
#define LIBLWRES_EXTERNAL_DATA
|
||||||
#else
|
#else
|
||||||
|
40
lib/lwres/include/lwres/stdlib.h
Normal file
40
lib/lwres/include/lwres/stdlib.h
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
|
||||||
|
* Copyright (C) 2003 Internet Software Consortium.
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, and distribute this software for any
|
||||||
|
* purpose with or without fee is hereby granted, provided that the above
|
||||||
|
* copyright notice and this permission notice appear in all copies.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
|
||||||
|
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||||
|
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||||
|
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||||
|
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||||
|
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||||
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* $Id: stdlib.h,v 1.2 2005/06/08 02:07:03 marka Exp $ */
|
||||||
|
|
||||||
|
#ifndef LWRES_STDLIB_H
|
||||||
|
#define LWRES_STDLIB_H 1
|
||||||
|
|
||||||
|
/*! \file */
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include <lwres/lang.h>
|
||||||
|
#include <lwres/platform.h>
|
||||||
|
|
||||||
|
#ifdef LWRES_PLATFORM_NEEDSTRTOUL
|
||||||
|
#define strtoul lwres_strtoul
|
||||||
|
#endif
|
||||||
|
|
||||||
|
LWRES_LANG_BEGINDECLS
|
||||||
|
|
||||||
|
unsigned long lwres_strtoul(const char *, char **, int);
|
||||||
|
|
||||||
|
LWRES_LANG_ENDDECLS
|
||||||
|
|
||||||
|
#endif
|
@ -15,7 +15,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: print.c,v 1.6 2005/05/09 00:41:48 marka Exp $ */
|
/* $Id: print.c,v 1.7 2005/06/08 02:07:02 marka Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
#define LWRES__PRINT_SOURCE /* Used to get the lwres_print_* prototypes. */
|
#define LWRES__PRINT_SOURCE /* Used to get the lwres_print_* prototypes. */
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <lwres/stdlib.h>
|
||||||
|
|
||||||
#include "assert_p.h"
|
#include "assert_p.h"
|
||||||
#include "print_p.h"
|
#include "print_p.h"
|
||||||
|
135
lib/lwres/strtoul.c
Normal file
135
lib/lwres/strtoul.c
Normal file
@ -0,0 +1,135 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
|
||||||
|
* Copyright (C) 2003 Internet Software Consortium.
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, and distribute this software for any
|
||||||
|
* purpose with or without fee is hereby granted, provided that the above
|
||||||
|
* copyright notice and this permission notice appear in all copies.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
|
||||||
|
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||||
|
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||||
|
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||||
|
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||||
|
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||||
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 1990, 1993
|
||||||
|
* The Regents of the University of California. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the University of
|
||||||
|
* California, Berkeley and its contributors.
|
||||||
|
* 4. Neither the name of the University nor the names of its contributors
|
||||||
|
* may be used to endorse or promote products derived from this software
|
||||||
|
* without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||||
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||||
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
|
* SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! \file */
|
||||||
|
#if defined(LIBC_SCCS) && !defined(lint)
|
||||||
|
static char sccsid[] = "@(#)strtoul.c 8.1 (Berkeley) 6/4/93";
|
||||||
|
#endif /* LIBC_SCCS and not lint */
|
||||||
|
|
||||||
|
/* $Id: strtoul.c,v 1.2 2005/06/08 02:07:02 marka Exp $ */
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
|
||||||
|
#include <limits.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
|
#include <lwres/stdlib.h>
|
||||||
|
|
||||||
|
#define DE_CONST(konst, var) \
|
||||||
|
do { \
|
||||||
|
union { const void *k; void *v; } _u; \
|
||||||
|
_u.k = konst; \
|
||||||
|
var = _u.v; \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Convert a string to an unsigned long integer.
|
||||||
|
*
|
||||||
|
* Ignores `locale' stuff. Assumes that the upper and lower case
|
||||||
|
* alphabets and digits are each contiguous.
|
||||||
|
*/
|
||||||
|
unsigned long
|
||||||
|
lwres_strtoul(const char *nptr, char **endptr, int base) {
|
||||||
|
const char *s = nptr;
|
||||||
|
unsigned long acc;
|
||||||
|
unsigned char c;
|
||||||
|
unsigned long cutoff;
|
||||||
|
int neg = 0, any, cutlim;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* See strtol for comments as to the logic used.
|
||||||
|
*/
|
||||||
|
do {
|
||||||
|
c = *s++;
|
||||||
|
} while (isspace(c));
|
||||||
|
if (c == '-') {
|
||||||
|
neg = 1;
|
||||||
|
c = *s++;
|
||||||
|
} else if (c == '+')
|
||||||
|
c = *s++;
|
||||||
|
if ((base == 0 || base == 16) &&
|
||||||
|
c == '0' && (*s == 'x' || *s == 'X')) {
|
||||||
|
c = s[1];
|
||||||
|
s += 2;
|
||||||
|
base = 16;
|
||||||
|
}
|
||||||
|
if (base == 0)
|
||||||
|
base = c == '0' ? 8 : 10;
|
||||||
|
cutoff = (unsigned long)ULONG_MAX / (unsigned long)base;
|
||||||
|
cutlim = (unsigned long)ULONG_MAX % (unsigned long)base;
|
||||||
|
for (acc = 0, any = 0;; c = *s++) {
|
||||||
|
if (!isascii(c))
|
||||||
|
break;
|
||||||
|
if (isdigit(c))
|
||||||
|
c -= '0';
|
||||||
|
else if (isalpha(c))
|
||||||
|
c -= isupper(c) ? 'A' - 10 : 'a' - 10;
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
if (c >= base)
|
||||||
|
break;
|
||||||
|
if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
|
||||||
|
any = -1;
|
||||||
|
else {
|
||||||
|
any = 1;
|
||||||
|
acc *= base;
|
||||||
|
acc += c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (any < 0) {
|
||||||
|
acc = ULONG_MAX;
|
||||||
|
errno = ERANGE;
|
||||||
|
} else if (neg)
|
||||||
|
acc = -acc;
|
||||||
|
if (endptr != 0)
|
||||||
|
DE_CONST(any ? s - 1 : nptr, *endptr);
|
||||||
|
return (acc);
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user