diff options
Diffstat (limited to 'contrib/bind9/lib/isc')
45 files changed, 182 insertions, 46 deletions
diff --git a/contrib/bind9/lib/isc/alpha/Makefile.in b/contrib/bind9/lib/isc/alpha/Makefile.in index 324db07..9c24cdf 100644 --- a/contrib/bind9/lib/isc/alpha/Makefile.in +++ b/contrib/bind9/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/contrib/bind9/lib/isc/alpha/include/Makefile.in b/contrib/bind9/lib/isc/alpha/include/Makefile.in index f1d8bdd..e399559 100644 --- a/contrib/bind9/lib/isc/alpha/include/Makefile.in +++ b/contrib/bind9/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/contrib/bind9/lib/isc/alpha/include/isc/Makefile.in b/contrib/bind9/lib/isc/alpha/include/isc/Makefile.in index 5f116ca..4927e21 100644 --- a/contrib/bind9/lib/isc/alpha/include/isc/Makefile.in +++ b/contrib/bind9/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/contrib/bind9/lib/isc/api b/contrib/bind9/lib/isc/api index 3b91551..18de29c 100644 --- a/contrib/bind9/lib/isc/api +++ b/contrib/bind9/lib/isc/api @@ -3,6 +3,6 @@ # 9.7: 60-79 # 9.8: 80-89 # 9.9: 90-109 -LIBINTERFACE = 83 -LIBREVISION = 5 -LIBAGE = 0 +LIBINTERFACE = 85 +LIBREVISION = 0 +LIBAGE = 1 diff --git a/contrib/bind9/lib/isc/ia64/Makefile.in b/contrib/bind9/lib/isc/ia64/Makefile.in index 324db07..9c24cdf 100644 --- a/contrib/bind9/lib/isc/ia64/Makefile.in +++ b/contrib/bind9/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/contrib/bind9/lib/isc/ia64/include/Makefile.in b/contrib/bind9/lib/isc/ia64/include/Makefile.in index f1d8bdd..e399559 100644 --- a/contrib/bind9/lib/isc/ia64/include/Makefile.in +++ b/contrib/bind9/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/contrib/bind9/lib/isc/ia64/include/isc/Makefile.in b/contrib/bind9/lib/isc/ia64/include/isc/Makefile.in index 5f116ca..4927e21 100644 --- a/contrib/bind9/lib/isc/ia64/include/isc/Makefile.in +++ b/contrib/bind9/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/contrib/bind9/lib/isc/ia64/include/isc/atomic.h b/contrib/bind9/lib/isc/ia64/include/isc/atomic.h index 74df4c5..557941d 100644 --- a/contrib/bind9/lib/isc/ia64/include/isc/atomic.h +++ b/contrib/bind9/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 diff --git a/contrib/bind9/lib/isc/include/Makefile.in b/contrib/bind9/lib/isc/include/Makefile.in index 04778d7..70c165e 100644 --- a/contrib/bind9/lib/isc/include/Makefile.in +++ b/contrib/bind9/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/contrib/bind9/lib/isc/include/isc/file.h b/contrib/bind9/lib/isc/include/isc/file.h index 8794065..38f78b7 100644 --- a/contrib/bind9/lib/isc/include/isc/file.h +++ b/contrib/bind9/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/contrib/bind9/lib/isc/include/isc/namespace.h b/contrib/bind9/lib/isc/include/isc/namespace.h index 158cfe5..ae1801d 100644 --- a/contrib/bind9/lib/isc/include/isc/namespace.h +++ b/contrib/bind9/lib/isc/include/isc/namespace.h @@ -146,6 +146,8 @@ #define isc_task_getcurrenttime isc__task_getcurrenttime #define isc_taskmgr_create isc__taskmgr_create #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 diff --git a/contrib/bind9/lib/isc/include/isc/task.h b/contrib/bind9/lib/isc/include/isc/task.h index 36fca36..19d4783 100644 --- a/contrib/bind9/lib/isc/include/isc/task.h +++ b/contrib/bind9/lib/isc/include/isc/task.h @@ -106,6 +106,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 { @@ -697,6 +699,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/contrib/bind9/lib/isc/mem.c b/contrib/bind9/lib/isc/mem.c index 5b4b16c..1964b7a 100644 --- a/contrib/bind9/lib/isc/mem.c +++ b/contrib/bind9/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/contrib/bind9/lib/isc/mips/Makefile.in b/contrib/bind9/lib/isc/mips/Makefile.in index 324db07..9c24cdf 100644 --- a/contrib/bind9/lib/isc/mips/Makefile.in +++ b/contrib/bind9/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/contrib/bind9/lib/isc/mips/include/Makefile.in b/contrib/bind9/lib/isc/mips/include/Makefile.in index f1d8bdd..e399559 100644 --- a/contrib/bind9/lib/isc/mips/include/Makefile.in +++ b/contrib/bind9/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/contrib/bind9/lib/isc/mips/include/isc/Makefile.in b/contrib/bind9/lib/isc/mips/include/isc/Makefile.in index 5f116ca..4927e21 100644 --- a/contrib/bind9/lib/isc/mips/include/isc/Makefile.in +++ b/contrib/bind9/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/contrib/bind9/lib/isc/nls/Makefile.in b/contrib/bind9/lib/isc/nls/Makefile.in index aca4a27..7bacf1c 100644 --- a/contrib/bind9/lib/isc/nls/Makefile.in +++ b/contrib/bind9/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/contrib/bind9/lib/isc/noatomic/Makefile.in b/contrib/bind9/lib/isc/noatomic/Makefile.in index 324db07..9c24cdf 100644 --- a/contrib/bind9/lib/isc/noatomic/Makefile.in +++ b/contrib/bind9/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/contrib/bind9/lib/isc/noatomic/include/Makefile.in b/contrib/bind9/lib/isc/noatomic/include/Makefile.in index f1d8bdd..e399559 100644 --- a/contrib/bind9/lib/isc/noatomic/include/Makefile.in +++ b/contrib/bind9/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/contrib/bind9/lib/isc/noatomic/include/isc/Makefile.in b/contrib/bind9/lib/isc/noatomic/include/isc/Makefile.in index 5f116ca..4927e21 100644 --- a/contrib/bind9/lib/isc/noatomic/include/isc/Makefile.in +++ b/contrib/bind9/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/contrib/bind9/lib/isc/nothreads/Makefile.in b/contrib/bind9/lib/isc/nothreads/Makefile.in index 7e7abd6..540b243 100644 --- a/contrib/bind9/lib/isc/nothreads/Makefile.in +++ b/contrib/bind9/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/contrib/bind9/lib/isc/nothreads/include/Makefile.in b/contrib/bind9/lib/isc/nothreads/include/Makefile.in index a52310a..662a72d 100644 --- a/contrib/bind9/lib/isc/nothreads/include/Makefile.in +++ b/contrib/bind9/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/contrib/bind9/lib/isc/nothreads/include/isc/Makefile.in b/contrib/bind9/lib/isc/nothreads/include/isc/Makefile.in index 3c9eab0..a2c347e 100644 --- a/contrib/bind9/lib/isc/nothreads/include/isc/Makefile.in +++ b/contrib/bind9/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/contrib/bind9/lib/isc/powerpc/Makefile.in b/contrib/bind9/lib/isc/powerpc/Makefile.in index 324db07..9c24cdf 100644 --- a/contrib/bind9/lib/isc/powerpc/Makefile.in +++ b/contrib/bind9/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/contrib/bind9/lib/isc/powerpc/include/Makefile.in b/contrib/bind9/lib/isc/powerpc/include/Makefile.in index f1d8bdd..e399559 100644 --- a/contrib/bind9/lib/isc/powerpc/include/Makefile.in +++ b/contrib/bind9/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/contrib/bind9/lib/isc/powerpc/include/isc/Makefile.in b/contrib/bind9/lib/isc/powerpc/include/isc/Makefile.in index 5f116ca..4927e21 100644 --- a/contrib/bind9/lib/isc/powerpc/include/isc/Makefile.in +++ b/contrib/bind9/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/contrib/bind9/lib/isc/pthreads/Makefile.in b/contrib/bind9/lib/isc/pthreads/Makefile.in index d6e7c76..9f66ef3 100644 --- a/contrib/bind9/lib/isc/pthreads/Makefile.in +++ b/contrib/bind9/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/contrib/bind9/lib/isc/pthreads/condition.c b/contrib/bind9/lib/isc/pthreads/condition.c index 50281a2..9053cf0 100644 --- a/contrib/bind9/lib/isc/pthreads/condition.c +++ b/contrib/bind9/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/contrib/bind9/lib/isc/pthreads/include/Makefile.in b/contrib/bind9/lib/isc/pthreads/include/Makefile.in index 0303ab1..46c243e 100644 --- a/contrib/bind9/lib/isc/pthreads/include/Makefile.in +++ b/contrib/bind9/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/contrib/bind9/lib/isc/pthreads/include/isc/Makefile.in b/contrib/bind9/lib/isc/pthreads/include/isc/Makefile.in index 11675ec..7cadcf4 100644 --- a/contrib/bind9/lib/isc/pthreads/include/isc/Makefile.in +++ b/contrib/bind9/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/contrib/bind9/lib/isc/sparc64/Makefile.in b/contrib/bind9/lib/isc/sparc64/Makefile.in index 324db07..9c24cdf 100644 --- a/contrib/bind9/lib/isc/sparc64/Makefile.in +++ b/contrib/bind9/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/contrib/bind9/lib/isc/sparc64/include/Makefile.in b/contrib/bind9/lib/isc/sparc64/include/Makefile.in index f1d8bdd..e399559 100644 --- a/contrib/bind9/lib/isc/sparc64/include/Makefile.in +++ b/contrib/bind9/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/contrib/bind9/lib/isc/sparc64/include/isc/Makefile.in b/contrib/bind9/lib/isc/sparc64/include/isc/Makefile.in index 5f116ca..4927e21 100644 --- a/contrib/bind9/lib/isc/sparc64/include/isc/Makefile.in +++ b/contrib/bind9/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/contrib/bind9/lib/isc/task.c b/contrib/bind9/lib/isc/task.c index f4e1265..a5f6ef9 100644 --- a/contrib/bind9/lib/isc/task.c +++ b/contrib/bind9/lib/isc/task.c @@ -152,6 +152,7 @@ struct isc__taskmgr { unsigned int tasks_running; isc_boolean_t exclusive_requested; isc_boolean_t exiting; + isc__task_t *excl; #ifdef USE_SHARED_MANAGER unsigned int refs; #endif /* ISC_PLATFORM_USETHREADS */ @@ -221,6 +222,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 @@ -261,7 +266,9 @@ static struct isc__taskmethods { static isc_taskmgrmethods_t taskmgrmethods = { isc__taskmgr_destroy, - isc__task_create + isc__task_create, + isc__taskmgr_setexcltask, + isc__taskmgr_excltask }; /*** @@ -1262,6 +1269,7 @@ isc__taskmgr_create(isc_mem_t *mctx, unsigned int workers, manager->tasks_running = 0; manager->exclusive_requested = ISC_FALSE; manager->exiting = ISC_FALSE; + manager->excl = NULL; isc_mem_attach(mctx, &manager->mctx); @@ -1344,6 +1352,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. @@ -1440,12 +1454,41 @@ isc__taskmgr_dispatch(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/contrib/bind9/lib/isc/task_api.c b/contrib/bind9/lib/isc/task_api.c index 551d0d37..06a8d24 100644 --- a/contrib/bind9/lib/isc/task_api.c +++ b/contrib/bind9/lib/isc/task_api.c @@ -187,6 +187,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/contrib/bind9/lib/isc/unix/Makefile.in b/contrib/bind9/lib/isc/unix/Makefile.in index 9884ca9..c1411cb 100644 --- a/contrib/bind9/lib/isc/unix/Makefile.in +++ b/contrib/bind9/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/contrib/bind9/lib/isc/unix/file.c b/contrib/bind9/lib/isc/unix/file.c index 0538761..99c02ec 100644 --- a/contrib/bind9/lib/isc/unix/file.c +++ b/contrib/bind9/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/contrib/bind9/lib/isc/unix/include/Makefile.in b/contrib/bind9/lib/isc/unix/include/Makefile.in index 0303ab1..46c243e 100644 --- a/contrib/bind9/lib/isc/unix/include/Makefile.in +++ b/contrib/bind9/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/contrib/bind9/lib/isc/unix/include/isc/Makefile.in b/contrib/bind9/lib/isc/unix/include/isc/Makefile.in index 2f4d216..d3b5084 100644 --- a/contrib/bind9/lib/isc/unix/include/isc/Makefile.in +++ b/contrib/bind9/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/contrib/bind9/lib/isc/x86_32/Makefile.in b/contrib/bind9/lib/isc/x86_32/Makefile.in index 324db07..9c24cdf 100644 --- a/contrib/bind9/lib/isc/x86_32/Makefile.in +++ b/contrib/bind9/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/contrib/bind9/lib/isc/x86_32/include/Makefile.in b/contrib/bind9/lib/isc/x86_32/include/Makefile.in index f1d8bdd..e399559 100644 --- a/contrib/bind9/lib/isc/x86_32/include/Makefile.in +++ b/contrib/bind9/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/contrib/bind9/lib/isc/x86_32/include/isc/Makefile.in b/contrib/bind9/lib/isc/x86_32/include/isc/Makefile.in index 5f116ca..4927e21 100644 --- a/contrib/bind9/lib/isc/x86_32/include/isc/Makefile.in +++ b/contrib/bind9/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/contrib/bind9/lib/isc/x86_64/Makefile.in b/contrib/bind9/lib/isc/x86_64/Makefile.in index 324db07..9c24cdf 100644 --- a/contrib/bind9/lib/isc/x86_64/Makefile.in +++ b/contrib/bind9/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/contrib/bind9/lib/isc/x86_64/include/Makefile.in b/contrib/bind9/lib/isc/x86_64/include/Makefile.in index f1d8bdd..e399559 100644 --- a/contrib/bind9/lib/isc/x86_64/include/Makefile.in +++ b/contrib/bind9/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/contrib/bind9/lib/isc/x86_64/include/isc/Makefile.in b/contrib/bind9/lib/isc/x86_64/include/isc/Makefile.in index f33ae99..9a988bb 100644 --- a/contrib/bind9/lib/isc/x86_64/include/isc/Makefile.in +++ b/contrib/bind9/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 |