windows-nt revision dafcb997e390efa4423883dafd100c975c4095d6
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric LuceCopyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric LuceCopyright (C) 1999-2001 Internet Software Consortium.
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric LuceSee COPYRIGHT in the source root or http://isc.org/copyright.html for terms.
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce$Id: windows-nt,v 1.8 2004/03/05 05:04:47 marka Exp $
841179549b6433e782c164a562eb3422f603533dAndreas Gustafsson Windows NT Portability Notes
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric LuceA primary goal in the overall design of BIND9 was to isolate functions
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Lucethat were specific to operating systems from those that are available
727f5b8846457a33d06f515a10a7e1aa849ddf18Andreas Gustafssonwith ANSI C. Even though development was being done on Unix-like
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Lucemachines, the main intention was that a Windows NT port could be done
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Lucewith far less hassle if the incompatible bits were encapsulated into
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Lucetheir own dedicated modules. A libisc API was designed for each
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luceoperating system feature that was needed, and initial implementations
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luceof those APIs were done for the various Unix operating systems. Some
fcc9f7f86c2fa2ceb8a5c16dc934fea7fa6887f2Andreas Gustafssonof the APIs have been implemented in Win32, but not yet all.
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric LuceThe target Windows NT build environment was specified as having nmake
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luceand the Microsoft Visual C++ 6.0 compiler, but explicitly _not_ having
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric LuceCygwin or any other external portability package, because we wanted to
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Lucekeep the prerequisites as minimal as possible.
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric LuceIn the source tree, the Unix implementations for the OS APIs are in a
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce"unix" subdirectory of lib/isc, while the thread APIs based on POSIX
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Lucethreads are in lib/isc/pthreads. The Windows versions of the APIs are
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric LuceXXX expand this section
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric LuceTo build a kit for Windows NT, run util/nt-kit while in the top level
fcc9f7f86c2fa2ceb8a5c16dc934fea7fa6887f2Andreas Gustafssondirectory of the BIND9 sources. Its usage is:
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce util/nt-kit [-zip|-nozip] [remotedest [localdest]]
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Lucewhere "remotedest" is the path under which the sources will be
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Lucecompiled on the NT machine, and "localdest" is where the munged
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Lucesource tree will be placed on the local machine in preparation for
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Lucemounting/zipping/whatever to get it to the remote machine.
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric LuceThe default remotedest is g:/proj/bind9-nt, because that suits my
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luceenvironment and I'm the one working on this. Use forward slashes when
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Lucespecifying the remote path.
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric LuceThe default localdest is ../bind9-nt.
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric LuceA zip archive named "bind9-nt.zip" can be created in the parent
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Lucedirectory of "localdest" if the -zip flag is specified; otherwise,
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Lucenone is made by default.
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce...XXX describe what nt-kit does
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric LuceThis module defines several functions that are useful for writing an
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luceapplication that uses the ISC library. Bob Halley originally said,
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce"The main reason I wrote it was to help with the sometimes difficult
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luceproblems that occur when you try to do a controlled shutdown of a
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Lucemultithreaded application. This scheme [using isc_app_start/
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luceisc_app_run/isc_app_finish] will allow an application to use the
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luceas-yet-unwritten single-threaded version of the ISC library without
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luceany source code changes." XXX It has not yet been implemented for
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric LuceThis module provides compatibility with the pthread_cond_* functions
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luceof POSIX, which can be used to synchronize threads based on a
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Lucecondition variable.
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric LuceThis module implements the directory scanning routines isc_dir_open,
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luceisc_dir_read and isc_dir_close, used to iterate over the filenames in
727f5b8846457a33d06f515a10a7e1aa849ddf18Andreas Gustafssona directory. XXX It also implements isc_dir_chdir to set the current
727f5b8846457a33d06f515a10a7e1aa849ddf18Andreas Gustafssondirectory, but this function has not yet been written for Win32.
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric LuceThe File module is for functions that access and/or modify operating
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Lucesystem information about files. XXX It has not yet been written for Win32.
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric LuceThis module implements the pthreads functions flockfile, funlockfile
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luceand getc_unlocked, which synchronize stdio calls from multiple
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Lucethreads. XXX It has not yet been written for Win32. Or for Unix
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Lucefor that matter. Merge into File?
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric LuceThis module implements the isc_interfaceiter_first, _next, _current
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luceand _destroy functions to list all of the network interfaces on a
727f5b8846457a33d06f515a10a7e1aa849ddf18Andreas Gustafssonmachine. XXX It has not yet been written for Win32.
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric LuceXXX It has not yet been written for Win32.
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric LuceXXX It has not yet been written for Win32.
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric LuceThis module ensures that a particular function, such as an
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luceinitialization routine, is only executed once, ensuring that any other
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Lucethreads that need to have the target function executed before they can
727f5b8846457a33d06f515a10a7e1aa849ddf18Andreas Gustafssonwork are blocked until the target function has completely finished.
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric LuceXXX It has not yet been written for Win32.
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric LuceThis module defines isc_stdtime_get, which stores the number of
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luceseconds since 1 Jan 1970 00:00:00 UTC in an isc_stdtime_t variable.
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric LuceThis module provides the isc_thread_create and isc_thread_join
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Lucefunctions, which behave like the POSIX Thread routines pthread_create
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luceand pthread_join. XXX It also defines isc_thread_self to return the id of
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Lucethe calling thread.
727f5b8846457a33d06f515a10a7e1aa849ddf18Andreas GustafssonThis module defines several time management routines, such getting the
727f5b8846457a33d06f515a10a7e1aa849ddf18Andreas Gustafssoncurrent time, adding or subtracting an interval, finding the
727f5b8846457a33d06f515a10a7e1aa849ddf18Andreas Gustafssondifference between two times, or simply determining whether one time
727f5b8846457a33d06f515a10a7e1aa849ddf18Andreas Gustafssonis earlier than another.