windows-nt revision dafcb997e390efa4423883dafd100c975c4095d6
b493dfe8bce94b05efc0f161238d32f1234c5670Brian WellingtonCopyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
3523e19da21545ade45394cb64d7462f20b77347Tinderbox UserCopyright (C) 1999-2001 Internet Software Consortium.
b493dfe8bce94b05efc0f161238d32f1234c5670Brian WellingtonSee COPYRIGHT in the source root or http://isc.org/copyright.html for terms.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews$Id: windows-nt,v 1.8 2004/03/05 05:04:47 marka Exp $
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellington Windows NT Portability Notes
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellington
ab023a65562e62b85a824509d829b6fad87e00b1Rob AusteinOVERVIEW
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellington
b493dfe8bce94b05efc0f161238d32f1234c5670Brian WellingtonA primary goal in the overall design of BIND9 was to isolate functions
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellingtonthat were specific to operating systems from those that are available
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellingtonwith ANSI C. Even though development was being done on Unix-like
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellingtonmachines, the main intention was that a Windows NT port could be done
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellingtonwith far less hassle if the incompatible bits were encapsulated into
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellingtontheir own dedicated modules. A libisc API was designed for each
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉operating system feature that was needed, and initial implementations
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellingtonof those APIs were done for the various Unix operating systems. Some
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellingtonof the APIs have been implemented in Win32, but not yet all.
7cd594b8427fe742d44295790ba367e1de22a47dEvan Hunt
b493dfe8bce94b05efc0f161238d32f1234c5670Brian WellingtonThe target Windows NT build environment was specified as having nmake
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellingtonand the Microsoft Visual C++ 6.0 compiler, but explicitly _not_ having
b493dfe8bce94b05efc0f161238d32f1234c5670Brian WellingtonCygwin or any other external portability package, because we wanted to
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellingtonkeep the prerequisites as minimal as possible.
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellington
b493dfe8bce94b05efc0f161238d32f1234c5670Brian WellingtonIn the source tree, the Unix implementations for the OS APIs are in a
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellington"unix" subdirectory of lib/isc, while the thread APIs based on POSIX
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellingtonthreads are in lib/isc/pthreads. The Windows versions of the APIs are
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellingtonin lib/isc/win32.
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellington
b493dfe8bce94b05efc0f161238d32f1234c5670Brian WellingtonCOMPILING
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellington
b493dfe8bce94b05efc0f161238d32f1234c5670Brian WellingtonXXX expand this section
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellington
b493dfe8bce94b05efc0f161238d32f1234c5670Brian WellingtonTo build a kit for Windows NT, run util/nt-kit while in the top level
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellingtondirectory of the BIND9 sources. Its usage is:
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellington util/nt-kit [-zip|-nozip] [remotedest [localdest]]
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellingtonwhere "remotedest" is the path under which the sources will be
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellingtoncompiled on the NT machine, and "localdest" is where the munged
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellingtonsource tree will be placed on the local machine in preparation for
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellingtonmounting/zipping/whatever to get it to the remote machine.
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellington
b493dfe8bce94b05efc0f161238d32f1234c5670Brian WellingtonThe default remotedest is g:/proj/bind9-nt, because that suits my
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellingtonenvironment and I'm the one working on this. Use forward slashes when
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellingtonspecifying the remote path.
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellington
b493dfe8bce94b05efc0f161238d32f1234c5670Brian WellingtonThe default localdest is ../bind9-nt.
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellington
b493dfe8bce94b05efc0f161238d32f1234c5670Brian WellingtonA zip archive named "bind9-nt.zip" can be created in the parent
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellingtondirectory of "localdest" if the -zip flag is specified; otherwise,
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellingtonnone is made by default.
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellington
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellington...XXX describe what nt-kit does
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellington
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellington...XXX config.status.win32, config.h.win32
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellington
b493dfe8bce94b05efc0f161238d32f1234c5670Brian WellingtonMODULES
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellington
b493dfe8bce94b05efc0f161238d32f1234c5670Brian WellingtonApp
216030f2849b0812910fbc1817ca17208a112663Mark Andrews
216030f2849b0812910fbc1817ca17208a112663Mark AndrewsThis module defines several functions that are useful for writing an
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellingtonapplication that uses the ISC library. Bob Halley originally said,
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉"The main reason I wrote it was to help with the sometimes difficult
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉problems that occur when you try to do a controlled shutdown of a
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉multithreaded application. This scheme [using isc_app_start/
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉isc_app_run/isc_app_finish] will allow an application to use the
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉as-yet-unwritten single-threaded version of the ISC library without
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉any source code changes." XXX It has not yet been implemented for
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉Win32.
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉Condition
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉
b493dfe8bce94b05efc0f161238d32f1234c5670Brian WellingtonThis module provides compatibility with the pthread_cond_* functions
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellingtonof POSIX, which can be used to synchronize threads based on a
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellingtoncondition variable.
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellington
b493dfe8bce94b05efc0f161238d32f1234c5670Brian WellingtonDir
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellington
ffcbf9ea917725d49be6b006efa02613de5ef242Mark AndrewsThis module implements the directory scanning routines isc_dir_open,
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉isc_dir_read and isc_dir_close, used to iterate over the filenames in
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉a directory. XXX It also implements isc_dir_chdir to set the current
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉directory, but this function has not yet been written for Win32.
7cd594b8427fe742d44295790ba367e1de22a47dEvan Hunt
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉File
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉The File module is for functions that access and/or modify operating
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉system information about files. XXX It has not yet been written for Win32.
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉Filelock
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉This module implements the pthreads functions flockfile, funlockfile
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉and getc_unlocked, which synchronize stdio calls from multiple
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉threads. XXX It has not yet been written for Win32. Or for Unix
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉for that matter. Merge into File?
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉
11463c0ac24692e229ec87f307f5e7df3c0a7e10Evan HuntInterfaceiter
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉
11463c0ac24692e229ec87f307f5e7df3c0a7e10Evan HuntThis module implements the isc_interfaceiter_first, _next, _current
11463c0ac24692e229ec87f307f5e7df3c0a7e10Evan Huntand _destroy functions to list all of the network interfaces on a
1124950b35ae05a12e804e670607fe5ba775cb4aTinderbox Usermachine. XXX It has not yet been written for Win32.
11463c0ac24692e229ec87f307f5e7df3c0a7e10Evan Hunt
11463c0ac24692e229ec87f307f5e7df3c0a7e10Evan HuntIpv6
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉XXX It has not yet been written for Win32.
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉Net
11463c0ac24692e229ec87f307f5e7df3c0a7e10Evan Hunt
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉XXX It has not yet been written for Win32.
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉Once
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉This module ensures that a particular function, such as an
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉initialization routine, is only executed once, ensuring that any other
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉threads that need to have the target function executed before they can
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉work are blocked until the target function has completely finished.
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉Socket
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉XXX It has not yet been written for Win32.
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉Stdtime
ec3f1d35170225c74d11c27bb184e250d150b209Tatuya JINMEI 神明達哉
b493dfe8bce94b05efc0f161238d32f1234c5670Brian WellingtonThis module defines isc_stdtime_get, which stores the number of
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellingtonseconds since 1 Jan 1970 00:00:00 UTC in an isc_stdtime_t variable.
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellington
b493dfe8bce94b05efc0f161238d32f1234c5670Brian WellingtonThread
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellington
b493dfe8bce94b05efc0f161238d32f1234c5670Brian WellingtonThis module provides the isc_thread_create and isc_thread_join
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellingtonfunctions, which behave like the POSIX Thread routines pthread_create
c3184b4e2a1f238f4615d36fee79df82b1711344Mark Andrewsand pthread_join. XXX It also defines isc_thread_self to return the id of
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellingtonthe calling thread.
38ded52dbb4328a8b563449c81070039549e073fMark Andrews
c3184b4e2a1f238f4615d36fee79df82b1711344Mark AndrewsTime
38ded52dbb4328a8b563449c81070039549e073fMark Andrews
c3184b4e2a1f238f4615d36fee79df82b1711344Mark AndrewsThis module defines several time management routines, such getting the
0f1938c98281e79faeaffa3c481731e3f8b67c08Brian Wellingtoncurrent time, adding or subtracting an interval, finding the
d457997b3b3ab1b79059707db89ae1dfb1d3c195Mark Andrewsdifference between two times, or simply determining whether one time
d457997b3b3ab1b79059707db89ae1dfb1d3c195Mark Andrewsis earlier than another.
d457997b3b3ab1b79059707db89ae1dfb1d3c195Mark Andrews
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellington
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellington