/lib/isc/include/isc/mem.h untouched).
bk: 4ae76bf7uTw-L8b_x0cill-jemIRHg
AC_CONFIG_FILES(adjtimed/Makefile)
AC_CONFIG_FILES(clockstuff/Makefile)
AC_CONFIG_FILES(include/Makefile)
+AC_CONFIG_FILES(include/isc/Makefile)
AC_CONFIG_FILES(kernel/Makefile)
AC_CONFIG_FILES(kernel/sys/Makefile)
AC_CONFIG_FILES(libntp/Makefile)
-#AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies
+NULL =
AUTOMAKE_OPTIONS =
ETAGS_ARGS = $(srcdir)/Makefile.am
EXTRA_DIST = autogen-version.def copyright.def debug-opt.def homerc.def version.def
-NULL=
+SUBDIRS = isc
+
noinst_HEADERS = \
adjtime.h \
audio.h \
--- /dev/null
+NULL =
+AUTOMAKE_OPTIONS =
+ETAGS_ARGS = $(srcdir)/Makefile.am
+
+noinst_HEADERS = \
+ mem.h \
+ $(NULL)
--- /dev/null
+/*
+ * libntp local override of isc/mem.h to stub it out.
+ *
+ * include/isc is searched before any of the lib/isc include
+ * directories and should be used only for replacement NTP headers
+ * overriding headers of the same name under lib/isc.
+ *
+ * NOTE: this assumes the system malloc is thread-safe and does
+ * not use any normal lib/isc locking.
+ */
+
+/*
+ * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1997-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or 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: mem.h,v 1.78.120.3 2009/02/11 03:07:01 jinmei Exp $ */
+
+#ifndef ISC_MEM_H
+#define ISC_MEM_H 1
+
+#include <stdio.h>
+
+#include <isc/lang.h>
+#include <isc/mutex.h>
+#include <isc/platform.h>
+#include <isc/types.h>
+#include <isc/xml.h>
+
+#include <ntp_stdlib.h>
+
+
+#define isc_mem_get(c, cnt) emalloc((cnt))
+#define isc_mem_allocate(c, cnt) emalloc((cnt))
+#define isc_mem_reallocate(c, mem, cnt) erealloc((mem), (cnt))
+#define isc_mem_put(c, mem, cnt) free((mem))
+#define isc_mem_free(c, mem) free((mem))
+#define isc_mem_strdup(c, str) estrdup((str))
+#define isc_mem_attach(src, ptgt) do { *(ptgt) = (src); } while (0)
+#define isc_mem_detach(c) ((void)(c))
+
+#endif /* ISC_MEM_H */
$(srcdir)/../lib/isc/lib.c \
$(srcdir)/../lib/isc/log.c \
$(srcdir)/../lib/isc/md5.c \
- $(srcdir)/../lib/isc/mem.c \
$(srcdir)/../lib/isc/nls/msgcat.c \
$(srcdir)/../lib/isc/unix/net.c \
$(srcdir)/../lib/isc/netaddr.c \
{
void * mem;
- mem = realloc(prev, size);
+ mem = realloc(prev, size ? size : 1);
if (NULL == mem) {
msyslog(LOG_ERR,
{
void * mem;
- mem = _realloc_dbg(prev, size, _NORMAL_BLOCK, file, line);
+ mem = _realloc_dbg(prev, size ? size : 1,
+ _NORMAL_BLOCK, file, line);
if (NULL == mem) {
msyslog(LOG_ERR,
static struct interface *wildipv4 = NULL;
static struct interface *wildipv6 = NULL;
-/*
- * allocate/free in libisc form, using emalloc/free.
- */
-void * ntp_memalloc (void *, size_t);
-void ntp_memfree (void *, void *);
-
static void add_fd_to_list (SOCKET,
enum desc_type);
static struct interface *find_addr_in_list (sockaddr_u *);
#endif
-void *
-ntp_memalloc(
- void * ntpcontext,
- size_t octets
- )
-{
- UNUSED_ARG(ntpcontext);
-
- return emalloc(octets);
-}
-
-
-void
-ntp_memfree(
- void * ntpcontext,
- void * p
- )
-{
- UNUSED_ARG(ntpcontext);
-
- free(p);
-}
-
-
#ifdef SYS_WINNT
/*
* Windows 2000 systems incorrectly cause UDP sockets using WASRecvFrom
void * data
)
{
- static isc_mem_t * mctx;
+ isc_mem_t * mctx = (void *)-1;
interface_info_t ifi;
isc_interfaceiter_t * iter;
isc_result_t result;
DPRINTF(3, ("update_interfaces(%d)\n", port));
- if (NULL == mctx) {
- result = isc_mem_createx(0, 0, &ntp_memalloc,
- &ntp_memfree, NULL, &mctx);
- NTP_INSIST(ISC_R_SUCCESS == result);
- }
-
/*
* phase one - scan interfaces
* - create those that are not found
# End Source File\r
# Begin Source File\r
\r
-SOURCE=..\..\..\lib\isc\mem.c\r
-# End Source File\r
-# Begin Source File\r
-\r
SOURCE=..\..\..\libntp\memmove.c\r
# End Source File\r
# Begin Source File\r
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
- <File
- RelativePath="..\..\..\lib\isc\mem.c">
- </File>
<File
RelativePath="..\..\..\libntp\memmove.c">
<FileConfiguration
RelativePath="..\..\..\include\md5.h">
</File>
<File
- RelativePath="..\..\..\lib\isc\include\isc\mem.h">
+ RelativePath="..\..\..\include\isc\mem.h">
</File>
<File
RelativePath="..\..\..\lib\isc\include\isc\net.h">
/>
</FileConfiguration>
</File>
- <File
- RelativePath="..\..\..\lib\isc\mem.c"
- >
- </File>
<File
RelativePath="..\..\..\libntp\memmove.c"
>
>
</File>
<File
- RelativePath="..\..\..\lib\isc\include\isc\mem.h"
+ RelativePath="..\..\..\include\isc\mem.h"
>
</File>
<File
RelativePath="..\..\..\..\lib\isc\md5.c"
>
</File>
- <File
- RelativePath="..\..\..\..\lib\isc\mem.c"
- >
- </File>
<File
RelativePath="..\..\..\..\libntp\memmove.c"
>
>
</File>
<File
- RelativePath="..\..\..\..\lib\isc\include\isc\mem.h"
+ RelativePath="..\..\..\..\include\isc\mem.h"
>
</File>
<File
static volatile int status; /* most recent status bits */
static volatile int flash; /* most recent ntp_adjtime() bits */
char* progname;
+volatile int debug; /* for libntp */
static char optargs[] = "MNT:cde:f:hm:o:rs:t:";
int