mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-23 10:39:16 +00:00
129 lines
4.4 KiB
Plaintext
129 lines
4.4 KiB
Plaintext
|
Windows NT Portability Notes
|
||
|
|
||
|
OVERVIEW
|
||
|
|
||
|
A primary goal in the overall design of BIND9 was to isolate functions
|
||
|
that were specific to operating systems from those that are available
|
||
|
with ANSI C. Even though development was being done on Unix-like
|
||
|
machines, the main intention was that a Windows NT port could be done
|
||
|
with far less hassle if the incompatible bits were encapsulated into
|
||
|
their own dedicated modules. A libisc API was designed for each
|
||
|
operating system feature that was needed, and initial implementations
|
||
|
of those APIs were done for the various Unix operating systems. Some
|
||
|
of the APIs have been implemented in Win32, but not yet all.
|
||
|
|
||
|
The target Windows NT build environment was specified as having nmake
|
||
|
and the Microsoft Visual C++ 6.0 compiler, but explicitly _not_ having
|
||
|
Cygwin or any other external portability package, because we wanted to
|
||
|
keep the prerequisites as minimal as possible.
|
||
|
|
||
|
In the source tree, the Unix implementations for the OS APIs are in a
|
||
|
"unix" subdirectory of lib/isc, while the thread APIs based on POSIX
|
||
|
threads are in lib/isc/pthreads. The Windows versions of the APIs are
|
||
|
in lib/isc/win32.
|
||
|
|
||
|
COMPILING
|
||
|
|
||
|
XXX expand this section
|
||
|
|
||
|
To build a kit for Windows NT, run util/nt-kit while in the top level
|
||
|
directory of the BIND9 sources. Its usage is:
|
||
|
util/nt-kit [-zip|-nozip] [remotedest [localdest]]
|
||
|
where "remotedest" is the path under which the sources will be
|
||
|
compiled on the NT machine, and "localdest" is where the munged
|
||
|
source tree will be placed on the local machine in preparation for
|
||
|
mounting/zipping/whatever to get it to the remote machine.
|
||
|
|
||
|
The default remotedest is g:/proj/bind9-nt, because that suits my
|
||
|
environment and I'm the one working on this. Use forward slashes when
|
||
|
specifying the remote path.
|
||
|
|
||
|
The default localdest is ../bind9-nt.
|
||
|
|
||
|
A zip archive named "bind9-nt.zip" can be created in the parent
|
||
|
directory of "localdest" if the -zip flag is specified; otherwise,
|
||
|
none is made by default.
|
||
|
|
||
|
...XXX describe what nt-kit does
|
||
|
|
||
|
...XXX config.status.win32, config.h.win32
|
||
|
|
||
|
MODULES
|
||
|
|
||
|
App
|
||
|
|
||
|
This module defines several functions that are useful for writing an
|
||
|
application that uses the ISC library. Bob Halley originally said,
|
||
|
"The main reason I wrote it was to help with the sometimes difficult
|
||
|
problems that occur when you try to do a controlled shutdown of a
|
||
|
multithreaded application. This scheme [using isc_app_start/
|
||
|
isc_app_run/isc_app_finish] will allow an application to use the
|
||
|
as-yet-unwritten single-threaded version of the ISC library without
|
||
|
any source code changes." XXX It has not yet been implemented for
|
||
|
Win32.
|
||
|
|
||
|
Condition
|
||
|
|
||
|
This module provides compatibility with the pthread_cond_* functions
|
||
|
of POSIX, which can be used to synchronize threads based on a
|
||
|
condition variable.
|
||
|
|
||
|
Dir
|
||
|
|
||
|
This module implements the directory scanning routines isc_dir_open,
|
||
|
isc_dir_read and isc_dir_close, used to iterate over the filenames in
|
||
|
a directory. XXX It also implements isc_dir_chdir to set the current
|
||
|
directory, but this function has not yet been written for Win32.
|
||
|
|
||
|
Filelock
|
||
|
|
||
|
This module implements the pthreads functions flockfile, funlockfile
|
||
|
and getc_unlocked, which synchronize stdio calls from multiple
|
||
|
threads. XXX It has not yet been written for Win32.
|
||
|
|
||
|
Interfaceiter
|
||
|
|
||
|
This module implements the isc_interfaceiter_first, _next, _current
|
||
|
and _destroy functions to list all of the network interfaces on a
|
||
|
machine. XXX It has not yet been written for Win32.
|
||
|
|
||
|
Ipv6
|
||
|
|
||
|
XXX It has not yet been written for Win32.
|
||
|
|
||
|
Net
|
||
|
|
||
|
XXX It has not yet been written for Win32.
|
||
|
|
||
|
Once
|
||
|
|
||
|
This module ensures that a particular function, such as an
|
||
|
initialization routine, is only executed once, ensuring that any other
|
||
|
threads that need to have the target function executed before they can
|
||
|
work are blocked until the target function has completely finished.
|
||
|
|
||
|
Socket
|
||
|
|
||
|
XXX It has not yet been written for Win32.
|
||
|
|
||
|
Stdtime
|
||
|
|
||
|
This module defines isc_stdtime_get, which stores the number of
|
||
|
seconds since 1 Jan 1970 00:00:00 UTC in an isc_stdtime_t variable.
|
||
|
|
||
|
Thread
|
||
|
|
||
|
This module provides the isc_thread_create and isc_thread_join
|
||
|
functions, which behave like the POSIX Thread routines pthread_create
|
||
|
and pthread_join. XXX It also defines isc_thread_self to return the id of
|
||
|
the calling thread.
|
||
|
|
||
|
Time
|
||
|
|
||
|
This module defines several time management routines, such getting the
|
||
|
current time, adding or subtracting an interval, finding the
|
||
|
difference between two times, or simply determining whether one time
|
||
|
is earlier than another.
|
||
|
|
||
|
|