summaryrefslogtreecommitdiff
path: root/lib/isc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/isc')
-rw-r--r--lib/isc/alpha/Makefile.in2
-rw-r--r--lib/isc/alpha/include/Makefile.in2
-rw-r--r--lib/isc/alpha/include/isc/Makefile.in2
-rw-r--r--lib/isc/api4
-rw-r--r--lib/isc/ia64/Makefile.in2
-rw-r--r--lib/isc/ia64/include/Makefile.in2
-rw-r--r--lib/isc/ia64/include/isc/Makefile.in2
-rw-r--r--lib/isc/ia64/include/isc/atomic.h6
-rw-r--r--lib/isc/include/Makefile.in2
-rw-r--r--lib/isc/include/isc/file.h13
-rw-r--r--lib/isc/include/isc/heap.h4
-rw-r--r--lib/isc/include/isc/namespace.h2
-rw-r--r--lib/isc/include/isc/queue.h20
-rw-r--r--lib/isc/include/isc/task.h27
-rw-r--r--lib/isc/mem.c10
-rw-r--r--lib/isc/mips/Makefile.in2
-rw-r--r--lib/isc/mips/include/Makefile.in2
-rw-r--r--lib/isc/mips/include/isc/Makefile.in2
-rw-r--r--lib/isc/nls/Makefile.in2
-rw-r--r--lib/isc/noatomic/Makefile.in2
-rw-r--r--lib/isc/noatomic/include/Makefile.in2
-rw-r--r--lib/isc/noatomic/include/isc/Makefile.in2
-rw-r--r--lib/isc/nothreads/Makefile.in2
-rw-r--r--lib/isc/nothreads/include/Makefile.in2
-rw-r--r--lib/isc/nothreads/include/isc/Makefile.in2
-rw-r--r--lib/isc/powerpc/Makefile.in2
-rw-r--r--lib/isc/powerpc/include/Makefile.in2
-rw-r--r--lib/isc/powerpc/include/isc/Makefile.in2
-rw-r--r--lib/isc/pthreads/Makefile.in2
-rw-r--r--lib/isc/pthreads/condition.c11
-rw-r--r--lib/isc/pthreads/include/Makefile.in2
-rw-r--r--lib/isc/pthreads/include/isc/Makefile.in2
-rw-r--r--lib/isc/sparc64/Makefile.in2
-rw-r--r--lib/isc/sparc64/include/Makefile.in2
-rw-r--r--lib/isc/sparc64/include/isc/Makefile.in2
-rw-r--r--lib/isc/task.c45
-rw-r--r--lib/isc/task_api.c11
-rw-r--r--lib/isc/tests/isctest.c8
-rw-r--r--lib/isc/tests/queue_test.c12
-rw-r--r--lib/isc/unix/Makefile.in2
-rw-r--r--lib/isc/unix/file.c31
-rw-r--r--lib/isc/unix/include/Makefile.in2
-rw-r--r--lib/isc/unix/include/isc/Makefile.in2
-rw-r--r--lib/isc/win32/Makefile.in2
-rw-r--r--lib/isc/win32/file.c84
-rw-r--r--lib/isc/win32/include/Makefile.in2
-rw-r--r--lib/isc/win32/include/isc/Makefile.in2
-rw-r--r--lib/isc/win32/include/isc/stat.h7
-rw-r--r--lib/isc/win32/libisc.def6
-rw-r--r--lib/isc/x86_32/Makefile.in2
-rw-r--r--lib/isc/x86_32/include/Makefile.in2
-rw-r--r--lib/isc/x86_32/include/isc/Makefile.in2
-rw-r--r--lib/isc/x86_64/Makefile.in2
-rw-r--r--lib/isc/x86_64/include/Makefile.in2
-rw-r--r--lib/isc/x86_64/include/isc/Makefile.in2
55 files changed, 295 insertions, 82 deletions
diff --git a/lib/isc/alpha/Makefile.in b/lib/isc/alpha/Makefile.in
index 324db070..9c24cdf9 100644
--- a/lib/isc/alpha/Makefile.in
+++ b/lib/isc/alpha/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2007 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
diff --git a/lib/isc/alpha/include/Makefile.in b/lib/isc/alpha/include/Makefile.in
index f1d8bdd3..e3995599 100644
--- a/lib/isc/alpha/include/Makefile.in
+++ b/lib/isc/alpha/include/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2007 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
diff --git a/lib/isc/alpha/include/isc/Makefile.in b/lib/isc/alpha/include/isc/Makefile.in
index 5f116cac..4927e210 100644
--- a/lib/isc/alpha/include/isc/Makefile.in
+++ b/lib/isc/alpha/include/isc/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2007 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
diff --git a/lib/isc/api b/lib/isc/api
index ed4b69f8..178430ae 100644
--- a/lib/isc/api
+++ b/lib/isc/api
@@ -3,6 +3,6 @@
# 9.7: 60-79
# 9.8: 80-89
# 9.9: 90-109
-LIBINTERFACE = 91
-LIBREVISION = 1
+LIBINTERFACE = 93
+LIBREVISION = 0
LIBAGE = 1
diff --git a/lib/isc/ia64/Makefile.in b/lib/isc/ia64/Makefile.in
index 324db070..9c24cdf9 100644
--- a/lib/isc/ia64/Makefile.in
+++ b/lib/isc/ia64/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2007 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
diff --git a/lib/isc/ia64/include/Makefile.in b/lib/isc/ia64/include/Makefile.in
index f1d8bdd3..e3995599 100644
--- a/lib/isc/ia64/include/Makefile.in
+++ b/lib/isc/ia64/include/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2007 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
diff --git a/lib/isc/ia64/include/isc/Makefile.in b/lib/isc/ia64/include/isc/Makefile.in
index 5f116cac..4927e210 100644
--- a/lib/isc/ia64/include/isc/Makefile.in
+++ b/lib/isc/ia64/include/isc/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2007 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
diff --git a/lib/isc/ia64/include/isc/atomic.h b/lib/isc/ia64/include/isc/atomic.h
index 6c22f2a5..557941d0 100644
--- a/lib/isc/ia64/include/isc/atomic.h
+++ b/lib/isc/ia64/include/isc/atomic.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2006, 2007, 2009, 2012 Internet Systems Consortium, Inc. ("ISC")
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -41,7 +41,7 @@ isc_atomic_xadd(isc_int32_t *p, isc_int32_t val)
for (prev = *(volatile isc_int32_t *)p; ; prev = swapped) {
swapped = prev + val;
__asm__ volatile(
- "mov ar.ccv=%2;"
+ "mov ar.ccv=%2;;"
"cmpxchg4.acq %0=%4,%3,ar.ccv"
: "=r" (swapped), "=m" (*p)
: "r" (prev), "r" (swapped), "m" (*p)
@@ -84,7 +84,7 @@ isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val)
isc_int32_t ret;
__asm__ volatile(
- "mov ar.ccv=%2;"
+ "mov ar.ccv=%2;;"
"cmpxchg4.acq %0=%4,%3,ar.ccv"
: "=r" (ret), "=m" (*p)
: "r" (cmpval), "r" (val), "m" (*p)
diff --git a/lib/isc/include/Makefile.in b/lib/isc/include/Makefile.in
index 04778d78..70c165ef 100644
--- a/lib/isc/include/Makefile.in
+++ b/lib/isc/include/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2004, 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 1998-2001 Internet Software Consortium.
#
# Permission to use, copy, modify, and/or distribute this software for any
diff --git a/lib/isc/include/isc/file.h b/lib/isc/include/isc/file.h
index 8794065b..38f78b74 100644
--- a/lib/isc/include/isc/file.h
+++ b/lib/isc/include/isc/file.h
@@ -25,6 +25,7 @@
#include <stdio.h>
#include <isc/lang.h>
+#include <isc/stat.h>
#include <isc/types.h>
ISC_LANG_BEGINDECLS
@@ -33,6 +34,9 @@ isc_result_t
isc_file_settime(const char *file, isc_time_t *time);
isc_result_t
+isc_file_mode(const char *file, mode_t *modep);
+
+isc_result_t
isc_file_getmodtime(const char *file, isc_time_t *time);
/*!<
* \brief Get the time of last modification of a file.
@@ -97,15 +101,22 @@ isc_file_mktemplate(const char *path, char *buf, size_t buflen);
* of the path with the internal template string.
*/
-
isc_result_t
isc_file_openunique(char *templet, FILE **fp);
isc_result_t
isc_file_openuniqueprivate(char *templet, FILE **fp);
isc_result_t
isc_file_openuniquemode(char *templet, int mode, FILE **fp);
+isc_result_t
+isc_file_bopenunique(char *templet, FILE **fp);
+isc_result_t
+isc_file_bopenuniqueprivate(char *templet, FILE **fp);
+isc_result_t
+isc_file_bopenuniquemode(char *templet, int mode, FILE **fp);
/*!<
* \brief Create and open a file with a unique name based on 'templet'.
+ * isc_file_bopen*() open the file in binary mode in Windows.
+ * isc_file_open*() open the file in text mode in Windows.
*
* Notes:
*\li 'template' is a reserved work in C++. If you want to complain
diff --git a/lib/isc/include/isc/heap.h b/lib/isc/include/isc/heap.h
index 77bf07c3..0b3a53b0 100644
--- a/lib/isc/include/isc/heap.h
+++ b/lib/isc/include/isc/heap.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2007, 2009, 2012 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1997-2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -60,6 +60,8 @@ isc_heap_create(isc_mem_t *mctx, isc_heapcompare_t compare,
* storage method. When the heap elements are deleted space is not freed
* but will be reused when new elements are inserted.
*
+ * Heap elements are indexed from 1.
+ *
* Requires:
*\li "mctx" is valid.
*\li "compare" is a function which takes two void * arguments and
diff --git a/lib/isc/include/isc/namespace.h b/lib/isc/include/isc/namespace.h
index cd4ec9ad..05b7daa7 100644
--- a/lib/isc/include/isc/namespace.h
+++ b/lib/isc/include/isc/namespace.h
@@ -151,6 +151,8 @@
#define isc_taskmgr_setmode isc__taskmgr_setmode
#define isc_taskmgr_mode isc__taskmgr_mode
#define isc_taskmgr_destroy isc__taskmgr_destroy
+#define isc_taskmgr_setexcltask isc__taskmgr_setexcltask
+#define isc_taskmgr_excltask isc__taskmgr_excltask
#define isc_task_beginexclusive isc__task_beginexclusive
#define isc_task_endexclusive isc__task_endexclusive
#define isc_task_setprivilege isc__task_setprivilege
diff --git a/lib/isc/include/isc/queue.h b/lib/isc/include/isc/queue.h
index 1bc9d5b4..22e2a01e 100644
--- a/lib/isc/include/isc/queue.h
+++ b/lib/isc/include/isc/queue.h
@@ -35,7 +35,7 @@
#define ISC_QLINK_INSIST(x) (void)0
#endif
-#define ISC_QLINK(type) struct { void *prev, *next; }
+#define ISC_QLINK(type) struct { type *prev, *next; }
#define ISC_QLINK_INIT(elt, link) \
do { \
@@ -142,4 +142,22 @@
(ret)->link.next = (ret)->link.prev = (void *)(-1); \
} while(0)
+#define ISC_QUEUE_UNLINK(queue, elt, link) \
+ do { \
+ ISC_QLINK_INSIST(ISC_QLINK_LINKED(elt, link)); \
+ LOCK(&(queue).headlock); \
+ LOCK(&(queue).taillock); \
+ if ((elt)->link.prev == NULL) \
+ (queue).head = (elt)->link.next; \
+ else \
+ (elt)->link.prev->link.next = (elt)->link.next; \
+ if ((elt)->link.next == NULL) \
+ (queue).tail = (elt)->link.prev; \
+ else \
+ (elt)->link.next->link.prev = (elt)->link.prev; \
+ UNLOCK(&(queue).taillock); \
+ UNLOCK(&(queue).headlock); \
+ (elt)->link.next = (elt)->link.prev = (void *)(-1); \
+ } while(0)
+
#endif /* ISC_QUEUE_H */
diff --git a/lib/isc/include/isc/task.h b/lib/isc/include/isc/task.h
index 594d80f3..c63c3e66 100644
--- a/lib/isc/include/isc/task.h
+++ b/lib/isc/include/isc/task.h
@@ -115,6 +115,8 @@ typedef struct isc_taskmgrmethods {
isc_result_t (*taskcreate)(isc_taskmgr_t *manager,
unsigned int quantum,
isc_task_t **taskp);
+ void (*setexcltask)(isc_taskmgr_t *mgr, isc_task_t *task);
+ isc_result_t (*excltask)(isc_taskmgr_t *mgr, isc_task_t **taskp);
} isc_taskmgrmethods_t;
typedef struct isc_taskmethods {
@@ -759,6 +761,31 @@ isc_taskmgr_destroy(isc_taskmgr_t **managerp);
* have been freed.
*/
+void
+isc_taskmgr_setexcltask(isc_taskmgr_t *mgr, isc_task_t *task);
+/*%<
+ * Set a task which will be used for all task-exclusive operations.
+ *
+ * Requires:
+ *\li 'manager' is a valid task manager.
+ *
+ *\li 'task' is a valid task.
+ */
+
+isc_result_t
+isc_taskmgr_excltask(isc_taskmgr_t *mgr, isc_task_t **taskp);
+/*%<
+ * Attach '*taskp' to the task set by isc_taskmgr_getexcltask().
+ * This task should be used whenever running in task-exclusive mode,
+ * so as to prevent deadlock between two exclusive tasks.
+ *
+ * Requires:
+ *\li 'manager' is a valid task manager.
+
+ *\li taskp != NULL && *taskp == NULL
+ */
+
+
#ifdef HAVE_LIBXML2
void
diff --git a/lib/isc/mem.c b/lib/isc/mem.c
index 5b4b16c5..1964b7a0 100644
--- a/lib/isc/mem.c
+++ b/lib/isc/mem.c
@@ -1191,7 +1191,7 @@ isc___mem_putanddetach(isc_mem_t **ctxp, void *ptr, size_t size FLARG) {
oldsize -= ALIGNMENT_SIZE;
INSIST(oldsize == size);
}
- isc_mem_free((isc_mem_t *)ctx, ptr);
+ isc__mem_free((isc_mem_t *)ctx, ptr FLARG_PASS);
MCTXLOCK(ctx, &ctx->lock);
ctx->references--;
@@ -1327,7 +1327,7 @@ isc___mem_put(isc_mem_t *ctx0, void *ptr, size_t size FLARG) {
oldsize -= ALIGNMENT_SIZE;
INSIST(oldsize == size);
}
- isc_mem_free((isc_mem_t *)ctx, ptr);
+ isc__mem_free((isc_mem_t *)ctx, ptr FLARG_PASS);
return;
}
@@ -1592,7 +1592,11 @@ isc___mem_reallocate(isc_mem_t *ctx0, void *ptr, size_t size FLARG) {
oldsize = (((size_info *)ptr)[-1]).u.size;
INSIST(oldsize >= ALIGNMENT_SIZE);
oldsize -= ALIGNMENT_SIZE;
- copysize = oldsize > size ? size : oldsize;
+ if ((isc_mem_debugging & ISC_MEM_DEBUGCTX) != 0) {
+ INSIST(oldsize >= ALIGNMENT_SIZE);
+ oldsize -= ALIGNMENT_SIZE;
+ }
+ copysize = (oldsize > size) ? size : oldsize;
memcpy(new_ptr, ptr, copysize);
isc__mem_free(ctx0, ptr FLARG_PASS);
}
diff --git a/lib/isc/mips/Makefile.in b/lib/isc/mips/Makefile.in
index 324db070..9c24cdf9 100644
--- a/lib/isc/mips/Makefile.in
+++ b/lib/isc/mips/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2007 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
diff --git a/lib/isc/mips/include/Makefile.in b/lib/isc/mips/include/Makefile.in
index f1d8bdd3..e3995599 100644
--- a/lib/isc/mips/include/Makefile.in
+++ b/lib/isc/mips/include/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2007 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
diff --git a/lib/isc/mips/include/isc/Makefile.in b/lib/isc/mips/include/isc/Makefile.in
index 5f116cac..4927e210 100644
--- a/lib/isc/mips/include/isc/Makefile.in
+++ b/lib/isc/mips/include/isc/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2007 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
diff --git a/lib/isc/nls/Makefile.in b/lib/isc/nls/Makefile.in
index aca4a273..7bacf1c8 100644
--- a/lib/isc/nls/Makefile.in
+++ b/lib/isc/nls/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2004, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2004, 2007, 2009, 2012 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 1999-2001 Internet Software Consortium.
#
# Permission to use, copy, modify, and/or distribute this software for any
diff --git a/lib/isc/noatomic/Makefile.in b/lib/isc/noatomic/Makefile.in
index 324db070..9c24cdf9 100644
--- a/lib/isc/noatomic/Makefile.in
+++ b/lib/isc/noatomic/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2007 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
diff --git a/lib/isc/noatomic/include/Makefile.in b/lib/isc/noatomic/include/Makefile.in
index f1d8bdd3..e3995599 100644
--- a/lib/isc/noatomic/include/Makefile.in
+++ b/lib/isc/noatomic/include/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2007 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
diff --git a/lib/isc/noatomic/include/isc/Makefile.in b/lib/isc/noatomic/include/isc/Makefile.in
index 5f116cac..4927e210 100644
--- a/lib/isc/noatomic/include/isc/Makefile.in
+++ b/lib/isc/noatomic/include/isc/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2007 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
diff --git a/lib/isc/nothreads/Makefile.in b/lib/isc/nothreads/Makefile.in
index 7e7abd6b..540b2434 100644
--- a/lib/isc/nothreads/Makefile.in
+++ b/lib/isc/nothreads/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2004, 2007, 2009, 2010 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2004, 2007, 2009, 2010, 2012 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 2000, 2001 Internet Software Consortium.
#
# Permission to use, copy, modify, and/or distribute this software for any
diff --git a/lib/isc/nothreads/include/Makefile.in b/lib/isc/nothreads/include/Makefile.in
index a52310a6..662a72df 100644
--- a/lib/isc/nothreads/include/Makefile.in
+++ b/lib/isc/nothreads/include/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2004, 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 2000, 2001 Internet Software Consortium.
#
# Permission to use, copy, modify, and/or distribute this software for any
diff --git a/lib/isc/nothreads/include/isc/Makefile.in b/lib/isc/nothreads/include/isc/Makefile.in
index 3c9eab0e..a2c347ea 100644
--- a/lib/isc/nothreads/include/isc/Makefile.in
+++ b/lib/isc/nothreads/include/isc/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2004, 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 2000, 2001 Internet Software Consortium.
#
# Permission to use, copy, modify, and/or distribute this software for any
diff --git a/lib/isc/powerpc/Makefile.in b/lib/isc/powerpc/Makefile.in
index 324db070..9c24cdf9 100644
--- a/lib/isc/powerpc/Makefile.in
+++ b/lib/isc/powerpc/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2007 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
diff --git a/lib/isc/powerpc/include/Makefile.in b/lib/isc/powerpc/include/Makefile.in
index f1d8bdd3..e3995599 100644
--- a/lib/isc/powerpc/include/Makefile.in
+++ b/lib/isc/powerpc/include/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2007 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
diff --git a/lib/isc/powerpc/include/isc/Makefile.in b/lib/isc/powerpc/include/isc/Makefile.in
index 5f116cac..4927e210 100644
--- a/lib/isc/powerpc/include/isc/Makefile.in
+++ b/lib/isc/powerpc/include/isc/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2007 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
diff --git a/lib/isc/pthreads/Makefile.in b/lib/isc/pthreads/Makefile.in
index d6e7c760..9f66ef33 100644
--- a/lib/isc/pthreads/Makefile.in
+++ b/lib/isc/pthreads/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2004, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2004, 2007, 2009, 2012 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 1998-2001 Internet Software Consortium.
#
# Permission to use, copy, modify, and/or distribute this software for any
diff --git a/lib/isc/pthreads/condition.c b/lib/isc/pthreads/condition.c
index 50281a2b..9053cf0f 100644
--- a/lib/isc/pthreads/condition.c
+++ b/lib/isc/pthreads/condition.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005, 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1998-2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -43,7 +43,14 @@ isc_condition_waituntil(isc_condition_t *c, isc_mutex_t *m, isc_time_t *t) {
* POSIX defines a timespec's tv_sec as time_t.
*/
result = isc_time_secondsastimet(t, &ts.tv_sec);
- if (result != ISC_R_SUCCESS)
+
+ /*
+ * If we have a range error ts.tv_sec is most probably a signed
+ * 32 bit value. Set ts.tv_sec to INT_MAX. This is a kludge.
+ */
+ if (result == ISC_R_RANGE)
+ ts.tv_sec = INT_MAX;
+ else if (result != ISC_R_SUCCESS)
return (result);
/*!
diff --git a/lib/isc/pthreads/include/Makefile.in b/lib/isc/pthreads/include/Makefile.in
index 0303ab13..46c243e1 100644
--- a/lib/isc/pthreads/include/Makefile.in
+++ b/lib/isc/pthreads/include/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2004, 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 1998-2001 Internet Software Consortium.
#
# Permission to use, copy, modify, and/or distribute this software for any
diff --git a/lib/isc/pthreads/include/isc/Makefile.in b/lib/isc/pthreads/include/isc/Makefile.in
index 11675ec2..7cadcf4b 100644
--- a/lib/isc/pthreads/include/isc/Makefile.in
+++ b/lib/isc/pthreads/include/isc/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2004, 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 1998-2001 Internet Software Consortium.
#
# Permission to use, copy, modify, and/or distribute this software for any
diff --git a/lib/isc/sparc64/Makefile.in b/lib/isc/sparc64/Makefile.in
index 324db070..9c24cdf9 100644
--- a/lib/isc/sparc64/Makefile.in
+++ b/lib/isc/sparc64/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2007 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
diff --git a/lib/isc/sparc64/include/Makefile.in b/lib/isc/sparc64/include/Makefile.in
index f1d8bdd3..e3995599 100644
--- a/lib/isc/sparc64/include/Makefile.in
+++ b/lib/isc/sparc64/include/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2007 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
diff --git a/lib/isc/sparc64/include/isc/Makefile.in b/lib/isc/sparc64/include/isc/Makefile.in
index 5f116cac..4927e210 100644
--- a/lib/isc/sparc64/include/isc/Makefile.in
+++ b/lib/isc/sparc64/include/isc/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2007 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
diff --git a/lib/isc/task.c b/lib/isc/task.c
index 227b2959..9c8badd4 100644
--- a/lib/isc/task.c
+++ b/lib/isc/task.c
@@ -156,6 +156,7 @@ struct isc__taskmgr {
isc_boolean_t pause_requested;
isc_boolean_t exclusive_requested;
isc_boolean_t exiting;
+ isc__task_t *excl;
#ifdef USE_SHARED_MANAGER
unsigned int refs;
#endif /* ISC_PLATFORM_USETHREADS */
@@ -225,6 +226,10 @@ isc__taskmgr_create(isc_mem_t *mctx, unsigned int workers,
unsigned int default_quantum, isc_taskmgr_t **managerp);
ISC_TASKFUNC_SCOPE void
isc__taskmgr_destroy(isc_taskmgr_t **managerp);
+ISC_TASKFUNC_SCOPE void
+isc__taskmgr_setexcltask(isc_taskmgr_t *mgr0, isc_task_t *task0);
+ISC_TASKFUNC_SCOPE isc_result_t
+isc__taskmgr_excltask(isc_taskmgr_t *mgr0, isc_task_t **taskp);
ISC_TASKFUNC_SCOPE isc_result_t
isc__task_beginexclusive(isc_task_t *task);
ISC_TASKFUNC_SCOPE void
@@ -286,7 +291,9 @@ static isc_taskmgrmethods_t taskmgrmethods = {
isc__taskmgr_destroy,
isc__taskmgr_setmode,
isc__taskmgr_mode,
- isc__task_create
+ isc__task_create,
+ isc__taskmgr_setexcltask,
+ isc__taskmgr_excltask
};
/***
@@ -1396,6 +1403,7 @@ isc__taskmgr_create(isc_mem_t *mctx, unsigned int workers,
manager->exclusive_requested = ISC_FALSE;
manager->pause_requested = ISC_FALSE;
manager->exiting = ISC_FALSE;
+ manager->excl = NULL;
isc_mem_attach(mctx, &manager->mctx);
@@ -1480,6 +1488,12 @@ isc__taskmgr_destroy(isc_taskmgr_t **managerp) {
*/
/*
+ * Detach the exclusive task before acquiring the manager lock
+ */
+ if (manager->excl != NULL)
+ isc__task_detach((isc_task_t **) &manager->excl);
+
+ /*
* Unlike elsewhere, we're going to hold this lock a long time.
* We need to do so, because otherwise the list of tasks could
* change while we were traversing it.
@@ -1629,12 +1643,41 @@ isc__taskmgr_resume(isc_taskmgr_t *manager0) {
}
#endif /* USE_WORKER_THREADS */
+ISC_TASKFUNC_SCOPE void
+isc__taskmgr_setexcltask(isc_taskmgr_t *mgr0, isc_task_t *task0) {
+ isc__taskmgr_t *mgr = (isc__taskmgr_t *) mgr0;
+ isc__task_t *task = (isc__task_t *) task0;
+
+ REQUIRE(VALID_MANAGER(mgr));
+ REQUIRE(VALID_TASK(task));
+ if (mgr->excl != NULL)
+ isc__task_detach((isc_task_t **) &mgr->excl);
+ isc__task_attach(task0, (isc_task_t **) &mgr->excl);
+}
+
+ISC_TASKFUNC_SCOPE isc_result_t
+isc__taskmgr_excltask(isc_taskmgr_t *mgr0, isc_task_t **taskp) {
+ isc__taskmgr_t *mgr = (isc__taskmgr_t *) mgr0;
+
+ REQUIRE(VALID_MANAGER(mgr));
+ REQUIRE(taskp != NULL && *taskp == NULL);
+
+ if (mgr->excl == NULL)
+ return (ISC_R_NOTFOUND);
+
+ isc__task_attach((isc_task_t *) mgr->excl, taskp);
+ return (ISC_R_SUCCESS);
+}
+
ISC_TASKFUNC_SCOPE isc_result_t
isc__task_beginexclusive(isc_task_t *task0) {
#ifdef USE_WORKER_THREADS
isc__task_t *task = (isc__task_t *)task0;
isc__taskmgr_t *manager = task->manager;
+
REQUIRE(task->state == task_state_running);
+ /* XXX: Require task == manager->excl? */
+
LOCK(&manager->lock);
if (manager->exclusive_requested) {
UNLOCK(&manager->lock);
diff --git a/lib/isc/task_api.c b/lib/isc/task_api.c
index 34510ff6..f49ab321 100644
--- a/lib/isc/task_api.c
+++ b/lib/isc/task_api.c
@@ -201,6 +201,17 @@ isc_task_purge(isc_task_t *task, void *sender, isc_eventtype_t type, void *tag)
return (task->methods->purgeevents(task, sender, type, tag));
}
+void
+isc_taskmgr_setexcltask(isc_taskmgr_t *mgr, isc_task_t *task) {
+ REQUIRE(ISCAPI_TASK_VALID(task));
+ return (mgr->methods->setexcltask(mgr, task));
+}
+
+isc_result_t
+isc_taskmgr_excltask(isc_taskmgr_t *mgr, isc_task_t **taskp) {
+ return (mgr->methods->excltask(mgr, taskp));
+}
+
isc_result_t
isc_task_beginexclusive(isc_task_t *task) {
REQUIRE(ISCAPI_TASK_VALID(task));
diff --git a/lib/isc/tests/isctest.c b/lib/isc/tests/isctest.c
index e118bbf2..41b09fce 100644
--- a/lib/isc/tests/isctest.c
+++ b/lib/isc/tests/isctest.c
@@ -42,6 +42,7 @@ isc_log_t *lctx = NULL;
isc_taskmgr_t *taskmgr = NULL;
isc_timermgr_t *timermgr = NULL;
isc_socketmgr_t *socketmgr = NULL;
+isc_task_t *maintask = NULL;
int ncpus;
static isc_boolean_t hash_active = ISC_FALSE;
@@ -63,6 +64,8 @@ static isc_logcategory_t categories[] = {
static void
cleanup_managers() {
+ if (maintask != NULL)
+ isc_task_destroy(&maintask);
if (socketmgr != NULL)
isc_socketmgr_destroy(&socketmgr);
if (taskmgr != NULL)
@@ -81,6 +84,9 @@ create_managers() {
#endif
CHECK(isc_taskmgr_create(mctx, ncpus, 0, &taskmgr));
+ CHECK(isc_task_create(taskmgr, 0, &maintask));
+ isc_taskmgr_setexcltask(taskmgr, maintask);
+
CHECK(isc_timermgr_create(mctx, &timermgr));
CHECK(isc_socketmgr_create(mctx, &socketmgr));
return (ISC_R_SUCCESS);
@@ -138,6 +144,8 @@ isc_test_begin(FILE *logfile, isc_boolean_t start_managers) {
void
isc_test_end() {
+ if (maintask != NULL)
+ isc_task_detach(&maintask);
if (taskmgr != NULL)
isc_taskmgr_destroy(&taskmgr);
if (lctx != NULL)
diff --git a/lib/isc/tests/queue_test.c b/lib/isc/tests/queue_test.c
index 74620fef..c4a80c4c 100644
--- a/lib/isc/tests/queue_test.c
+++ b/lib/isc/tests/queue_test.c
@@ -29,10 +29,11 @@
#include "isctest.h"
-typedef struct item {
+typedef struct item item_t;
+struct item {
int value;
ISC_QLINK(item_t) qlink;
-} item_t;
+};
typedef ISC_QUEUE(item_t) item_queue_t;
@@ -107,6 +108,9 @@ ATF_TC_BODY(queue_valid, tc) {
ISC_QUEUE_PUSH(queue, &five, qlink);
ATF_CHECK(ISC_QLINK_LINKED(&five, qlink));
+ /* Test unlink by removing one item from the middle */
+ ISC_QUEUE_UNLINK(queue, &three, qlink);
+
ISC_QUEUE_POP(queue, qlink, p);
ATF_REQUIRE(p != NULL);
ATF_CHECK_EQ(p->value, 1);
@@ -117,10 +121,6 @@ ATF_TC_BODY(queue_valid, tc) {
ISC_QUEUE_POP(queue, qlink, p);
ATF_REQUIRE(p != NULL);
- ATF_CHECK_EQ(p->value, 3);
-
- ISC_QUEUE_POP(queue, qlink, p);
- ATF_REQUIRE(p != NULL);
ATF_CHECK_EQ(p->value, 4);
ISC_QUEUE_POP(queue, qlink, p);
diff --git a/lib/isc/unix/Makefile.in b/lib/isc/unix/Makefile.in
index 9884ca90..c1411cb3 100644
--- a/lib/isc/unix/Makefile.in
+++ b/lib/isc/unix/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2004, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2004, 2007, 2009, 2012 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 1998-2001 Internet Software Consortium.
#
# Permission to use, copy, modify, and/or distribute this software for any
diff --git a/lib/isc/unix/file.c b/lib/isc/unix/file.c
index 0538761a..99c02ec7 100644
--- a/lib/isc/unix/file.c
+++ b/lib/isc/unix/file.c
@@ -98,6 +98,20 @@ file_stats(const char *file, struct stat *stats) {
}
isc_result_t
+isc_file_mode(const char *file, mode_t *modep) {
+ isc_result_t result;
+ struct stat stats;
+
+ REQUIRE(modep != NULL);
+
+ result = file_stats(file, &stats);
+ if (result == ISC_R_SUCCESS)
+ *modep = (stats.st_mode & 07777);
+
+ return (result);
+}
+
+isc_result_t
isc_file_getmodtime(const char *file, isc_time_t *time) {
isc_result_t result;
struct stat stats;
@@ -313,6 +327,23 @@ isc_file_openuniquemode(char *templet, int mode, FILE **fp) {
}
isc_result_t
+isc_file_bopenunique(char *templet, FILE **fp) {
+ int mode = S_IWUSR|S_IRUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH;
+ return (isc_file_openuniquemode(templet, mode, fp));
+}
+
+isc_result_t
+isc_file_bopenuniqueprivate(char *templet, FILE **fp) {
+ int mode = S_IWUSR|S_IRUSR;
+ return (isc_file_openuniquemode(templet, mode, fp));
+}
+
+isc_result_t
+isc_file_bopenuniquemode(char *templet, int mode, FILE **fp) {
+ return (isc_file_openuniquemode(templet, mode, fp));
+}
+
+isc_result_t
isc_file_remove(const char *filename) {
int r;
diff --git a/lib/isc/unix/include/Makefile.in b/lib/isc/unix/include/Makefile.in
index 0303ab13..46c243e1 100644
--- a/lib/isc/unix/include/Makefile.in
+++ b/lib/isc/unix/include/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2004, 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 1998-2001 Internet Software Consortium.
#
# Permission to use, copy, modify, and/or distribute this software for any
diff --git a/lib/isc/unix/include/isc/Makefile.in b/lib/isc/unix/include/isc/Makefile.in
index 2f4d2164..d3b50842 100644
--- a/lib/isc/unix/include/isc/Makefile.in
+++ b/lib/isc/unix/include/isc/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2004, 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 1998-2001 Internet Software Consortium.
#
# Permission to use, copy, modify, and/or distribute this software for any
diff --git a/lib/isc/win32/Makefile.in b/lib/isc/win32/Makefile.in
index 3396db1e..c129e31c 100644
--- a/lib/isc/win32/Makefile.in
+++ b/lib/isc/win32/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2004, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2004, 2007, 2009, 2012 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 1999-2001 Internet Software Consortium.
#
# Permission to use, copy, modify, and/or distribute this software for any
diff --git a/lib/isc/win32/file.c b/lib/isc/win32/file.c
index c6b9e4f5..146fd35e 100644
--- a/lib/isc/win32/file.c
+++ b/lib/isc/win32/file.c
@@ -45,10 +45,14 @@
*
*/
static int
-gettemp(char *path, int *doopen) {
+gettemp(char *path, isc_boolean_t binary, int *doopen) {
char *start, *trv;
struct stat sbuf;
int pid;
+ int flags = O_CREAT|O_EXCL|O_RDWR;
+
+ if (binary)
+ flags |= _O_BINARY;
trv = strrchr(path, 'X');
trv++;
@@ -81,8 +85,7 @@ gettemp(char *path, int *doopen) {
for (;;) {
if (doopen) {
if ((*doopen =
- open(path, O_CREAT|O_EXCL|O_RDWR,
- _S_IREAD | _S_IWRITE)) >= 0)
+ open(path, flags, _S_IREAD | _S_IWRITE)) >= 0)
return (1);
if (errno != EEXIST)
return (0);
@@ -108,10 +111,10 @@ gettemp(char *path, int *doopen) {
}
static int
-mkstemp(char *path) {
+mkstemp(char *path, isc_boolean_t binary) {
int fd;
- return (gettemp(path, &fd) ? fd : -1);
+ return (gettemp(path, binary, &fd) ? fd : -1);
}
/*
@@ -165,7 +168,7 @@ isc_file_safemovefile(const char *oldname, const char *newname) {
exists = TRUE;
strcpy(buf, newname);
strcat(buf, ".XXXXX");
- tmpfd = mkstemp(buf);
+ tmpfd = mkstemp(buf, ISC_TRUE);
if (tmpfd > 0)
_close(tmpfd);
DeleteFile(buf);
@@ -300,7 +303,7 @@ isc_file_renameunique(const char *file, char *templet) {
REQUIRE(file != NULL);
REQUIRE(templet != NULL);
- fd = mkstemp(templet);
+ fd = mkstemp(templet, ISC_TRUE);
if (fd == -1)
result = isc__errno2result(errno);
else
@@ -316,20 +319,8 @@ isc_file_renameunique(const char *file, char *templet) {
return (result);
}
-isc_result_t
-isc_file_openuniqueprivate(char *templet, FILE **fp) {
- int mode = _S_IREAD | _S_IWRITE;
- return (isc_file_openuniquemode(templet, mode, fp));
-}
-
-isc_result_t
-isc_file_openunique(char *templet, FILE **fp) {
- int mode = _S_IREAD | _S_IWRITE;
- return (isc_file_openuniquemode(templet, mode, fp));
-}
-
-isc_result_t
-isc_file_openuniquemode(char *templet, int mode, FILE **fp) {
+static isc_result_t
+openuniquemode(char *templet, int mode, isc_boolean_t binary, FILE **fp) {
int fd;
FILE *f;
isc_result_t result = ISC_R_SUCCESS;
@@ -340,7 +331,7 @@ isc_file_openuniquemode(char *templet, int mode, FILE **fp) {
/*
* Win32 does not have mkstemp. Using emulation above.
*/
- fd = mkstemp(templet);
+ fd = mkstemp(templet, binary);
if (fd == -1)
result = isc__errno2result(errno);
@@ -350,7 +341,7 @@ isc_file_openuniquemode(char *templet, int mode, FILE **fp) {
#else
(void)fchmod(fd, mode);
#endif
- f = fdopen(fd, "w+");
+ f = fdopen(fd, binary ? "wb+" : "w+");
if (f == NULL) {
result = isc__errno2result(errno);
(void)remove(templet);
@@ -363,6 +354,40 @@ isc_file_openuniquemode(char *templet, int mode, FILE **fp) {
}
isc_result_t
+isc_file_openuniqueprivate(char *templet, FILE **fp) {
+ int mode = _S_IREAD | _S_IWRITE;
+ return (openuniquemode(templet, mode, ISC_FALSE, fp));
+}
+
+isc_result_t
+isc_file_openunique(char *templet, FILE **fp) {
+ int mode = _S_IREAD | _S_IWRITE;
+ return (openuniquemode(templet, mode, ISC_FALSE, fp));
+}
+
+isc_result_t
+isc_file_openuniquemode(char *templet, int mode, FILE **fp) {
+ return (openuniquemode(templet, mode, ISC_FALSE, fp));
+}
+
+isc_result_t
+isc_file_bopenuniqueprivate(char *templet, FILE **fp) {
+ int mode = _S_IREAD | _S_IWRITE;
+ return (openuniquemode(templet, mode, ISC_TRUE, fp));
+}
+
+isc_result_t
+isc_file_bopenunique(char *templet, FILE **fp) {
+ int mode = _S_IREAD | _S_IWRITE;
+ return (openuniquemode(templet, mode, ISC_TRUE, fp));
+}
+
+isc_result_t
+isc_file_bopenuniquemode(char *templet, int mode, FILE **fp) {
+ return (openuniquemode(templet, mode, ISC_TRUE, fp));
+}
+
+isc_result_t
isc_file_remove(const char *filename) {
int r;
@@ -617,3 +642,16 @@ isc_file_splitpath(isc_mem_t *mctx, char *path, char **dirname, char **basename)
return (ISC_R_SUCCESS);
}
+
+isc_result_t
+isc_file_mode(const char *file, mode_t *modep) {
+ isc_result_t result;
+ struct stat stats;
+
+ REQUIRE(modep != NULL);
+
+ result = file_stats(file, &stats);
+ if (result == ISC_R_SUCCESS)
+ *modep = (stats.st_mode & 07777);
+ return (result);
+}
diff --git a/lib/isc/win32/include/Makefile.in b/lib/isc/win32/include/Makefile.in
index c74b52d2..60435f9e 100644
--- a/lib/isc/win32/include/Makefile.in
+++ b/lib/isc/win32/include/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2004, 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 1999-2001 Internet Software Consortium.
#
# Permission to use, copy, modify, and/or distribute this software for any
diff --git a/lib/isc/win32/include/isc/Makefile.in b/lib/isc/win32/include/isc/Makefile.in
index dcd85190..6b5bcea2 100644
--- a/lib/isc/win32/include/isc/Makefile.in
+++ b/lib/isc/win32/include/isc/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2004, 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 1999-2001 Internet Software Consortium.
#
# Permission to use, copy, modify, and/or distribute this software for any
diff --git a/lib/isc/win32/include/isc/stat.h b/lib/isc/win32/include/isc/stat.h
index 2c822b9e..6703e329 100644
--- a/lib/isc/win32/include/isc/stat.h
+++ b/lib/isc/win32/include/isc/stat.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2007, 2009, 2012 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000, 2001, 2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -22,6 +22,11 @@
#include <sys/stat.h>
+/*
+ * Windows doesn't typedef this.
+ */
+typedef unsigned short mode_t;
+
/* open() under unix allows setting of read/write permissions
* at the owner, group and other levels. These don't exist in NT
* We'll just map them all to the NT equivalent
diff --git a/lib/isc/win32/libisc.def b/lib/isc/win32/libisc.def
index fb084103..fe3f739b 100644
--- a/lib/isc/win32/libisc.def
+++ b/lib/isc/win32/libisc.def
@@ -140,7 +140,9 @@ isc__task_unsend
isc__task_unsendrange
isc__taskmgr_create
isc__taskmgr_destroy
+isc__taskmgr_excltask
isc__taskmgr_mode
+isc__taskmgr_setexcltask
isc__taskmgr_setmode
isc__timer_attach
isc__timer_create
@@ -218,6 +220,9 @@ isc_event_allocate
isc_event_free
isc_file_absolutepath
isc_file_basename
+isc_file_bopenunique
+isc_file_bopenuniquemode
+isc_file_bopenuniqueprivate
isc_file_exists
isc_file_getmodtime
isc_file_isabsolute
@@ -225,6 +230,7 @@ isc_file_ischdiridempotent
isc_file_iscurrentdir
isc_file_isplainfile
isc_file_mktemplate
+isc_file_mode
isc_file_openunique
isc_file_openuniquemode
isc_file_openuniqueprivate
diff --git a/lib/isc/x86_32/Makefile.in b/lib/isc/x86_32/Makefile.in
index 324db070..9c24cdf9 100644
--- a/lib/isc/x86_32/Makefile.in
+++ b/lib/isc/x86_32/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2007 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
diff --git a/lib/isc/x86_32/include/Makefile.in b/lib/isc/x86_32/include/Makefile.in
index f1d8bdd3..e3995599 100644
--- a/lib/isc/x86_32/include/Makefile.in
+++ b/lib/isc/x86_32/include/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2007 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
diff --git a/lib/isc/x86_32/include/isc/Makefile.in b/lib/isc/x86_32/include/isc/Makefile.in
index 5f116cac..4927e210 100644
--- a/lib/isc/x86_32/include/isc/Makefile.in
+++ b/lib/isc/x86_32/include/isc/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2007 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
diff --git a/lib/isc/x86_64/Makefile.in b/lib/isc/x86_64/Makefile.in
index 324db070..9c24cdf9 100644
--- a/lib/isc/x86_64/Makefile.in
+++ b/lib/isc/x86_64/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2007 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
diff --git a/lib/isc/x86_64/include/Makefile.in b/lib/isc/x86_64/include/Makefile.in
index f1d8bdd3..e3995599 100644
--- a/lib/isc/x86_64/include/Makefile.in
+++ b/lib/isc/x86_64/include/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2007 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
diff --git a/lib/isc/x86_64/include/isc/Makefile.in b/lib/isc/x86_64/include/isc/Makefile.in
index f33ae994..9a988bb7 100644
--- a/lib/isc/x86_64/include/isc/Makefile.in
+++ b/lib/isc/x86_64/include/isc/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2007 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above