0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark AndrewsCopyright (C) 1999-2001, 2004, 2016 Internet Systems Consortium, Inc. ("ISC")
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark AndrewsThis Source Code Form is subject to the terms of the Mozilla Public
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark AndrewsLicense, v. 2.0. If a copy of the MPL was not distributed with this
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrewsfile, You can obtain one at http://mozilla.org/MPL/2.0/.
9bff67898d55cddfcec9ce30cc2b1bb6211ec691David Lawrence
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews$Id: windows-nt,v 1.8 2004/03/05 05:04:47 marka Exp $
9c3531d72aeaad6c5f01efe6a1c82023e1379e4dDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence Windows NT Portability Notes
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceOVERVIEW
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceA primary goal in the overall design of BIND9 was to isolate functions
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrencethat were specific to operating systems from those that are available
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrencewith ANSI C. Even though development was being done on Unix-like
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrencemachines, the main intention was that a Windows NT port could be done
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrencewith far less hassle if the incompatible bits were encapsulated into
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrencetheir own dedicated modules. A libisc API was designed for each
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrenceoperating system feature that was needed, and initial implementations
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrenceof those APIs were done for the various Unix operating systems. Some
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrenceof the APIs have been implemented in Win32, but not yet all.
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceThe target Windows NT build environment was specified as having nmake
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrenceand the Microsoft Visual C++ 6.0 compiler, but explicitly _not_ having
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceCygwin or any other external portability package, because we wanted to
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrencekeep the prerequisites as minimal as possible.
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceIn the source tree, the Unix implementations for the OS APIs are in a
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence"unix" subdirectory of lib/isc, while the thread APIs based on POSIX
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrencethreads are in lib/isc/pthreads. The Windows versions of the APIs are
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrencein lib/isc/win32.
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceCOMPILING
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceXXX expand this section
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceTo build a kit for Windows NT, run util/nt-kit while in the top level
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrencedirectory of the BIND9 sources. Its usage is:
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence util/nt-kit [-zip|-nozip] [remotedest [localdest]]
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrencewhere "remotedest" is the path under which the sources will be
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrencecompiled on the NT machine, and "localdest" is where the munged
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrencesource tree will be placed on the local machine in preparation for
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrencemounting/zipping/whatever to get it to the remote machine.
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceThe default remotedest is g:/proj/bind9-nt, because that suits my
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrenceenvironment and I'm the one working on this. Use forward slashes when
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrencespecifying the remote path.
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceThe default localdest is ../bind9-nt.
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceA zip archive named "bind9-nt.zip" can be created in the parent
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrencedirectory of "localdest" if the -zip flag is specified; otherwise,
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrencenone is made by default.
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence...XXX describe what nt-kit does
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence...XXX config.status.win32, config.h.win32
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceMODULES
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceApp
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceThis module defines several functions that are useful for writing an
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrenceapplication that uses the ISC library. Bob Halley originally said,
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence"The main reason I wrote it was to help with the sometimes difficult
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrenceproblems that occur when you try to do a controlled shutdown of a
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrencemultithreaded application. This scheme [using isc_app_start/
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrenceisc_app_run/isc_app_finish] will allow an application to use the
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrenceas-yet-unwritten single-threaded version of the ISC library without
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrenceany source code changes." XXX It has not yet been implemented for
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceWin32.
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceCondition
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceThis module provides compatibility with the pthread_cond_* functions
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrenceof POSIX, which can be used to synchronize threads based on a
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrencecondition variable.
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceDir
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceThis module implements the directory scanning routines isc_dir_open,
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrenceisc_dir_read and isc_dir_close, used to iterate over the filenames in
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrencea directory. XXX It also implements isc_dir_chdir to set the current
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrencedirectory, but this function has not yet been written for Win32.
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
f8a95eb9127a97e81ad4f1295a9d1abce993ef63David LawrenceFile
f8a95eb9127a97e81ad4f1295a9d1abce993ef63David Lawrence
f8a95eb9127a97e81ad4f1295a9d1abce993ef63David LawrenceThe File module is for functions that access and/or modify operating
f8a95eb9127a97e81ad4f1295a9d1abce993ef63David Lawrencesystem information about files. XXX It has not yet been written for Win32.
f8a95eb9127a97e81ad4f1295a9d1abce993ef63David Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceFilelock
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceThis module implements the pthreads functions flockfile, funlockfile
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrenceand getc_unlocked, which synchronize stdio calls from multiple
f8a95eb9127a97e81ad4f1295a9d1abce993ef63David Lawrencethreads. XXX It has not yet been written for Win32. Or for Unix
f8a95eb9127a97e81ad4f1295a9d1abce993ef63David Lawrencefor that matter. Merge into File?
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceInterfaceiter
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceThis module implements the isc_interfaceiter_first, _next, _current
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrenceand _destroy functions to list all of the network interfaces on a
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrencemachine. XXX It has not yet been written for Win32.
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceIpv6
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceXXX It has not yet been written for Win32.
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceNet
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceXXX It has not yet been written for Win32.
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceOnce
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceThis module ensures that a particular function, such as an
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrenceinitialization routine, is only executed once, ensuring that any other
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrencethreads that need to have the target function executed before they can
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrencework are blocked until the target function has completely finished.
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceSocket
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceXXX It has not yet been written for Win32.
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceStdtime
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceThis module defines isc_stdtime_get, which stores the number of
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrenceseconds since 1 Jan 1970 00:00:00 UTC in an isc_stdtime_t variable.
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceThread
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceThis module provides the isc_thread_create and isc_thread_join
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrencefunctions, which behave like the POSIX Thread routines pthread_create
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrenceand pthread_join. XXX It also defines isc_thread_self to return the id of
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrencethe calling thread.
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceTime
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid LawrenceThis module defines several time management routines, such getting the
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrencecurrent time, adding or subtracting an interval, finding the
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrencedifference between two times, or simply determining whether one time
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrenceis earlier than another.
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence
487e6abc16c1b2958d371b0d4e808953646b520aDavid Lawrence