os.c revision 577272cf7935770fa2ea817e656a572cdcd94ecc
/*
* Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2002 Internet Software Consortium.
*
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: os.c,v 1.26 2008/01/09 02:35:10 marka Exp $ */
#include <config.h>
#include <stdarg.h>
#include <ctype.h>
#include <errno.h>
#include <io.h>
#include <process.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <syslog.h>
#include <isc/strerror.h>
#include <named/ntservice.h>
static int devnullfd = -1;
static char *version_error =
"named requires Windows 2000 Service Pack 2 or later to run correctly";
void
ns_paths_init() {
if (!Initialized)
Initialized = TRUE;
}
/*
* Due to Knowledge base article Q263823 we need to make sure that
* Windows 2000 systems have Service Pack 2 or later installed and
* warn when it isn't.
*/
static void
version_check(const char *progname) {
if(isc_win32os_majorversion() < 5)
return; /* No problem with Version 4.0 */
if (ntservice_isservice())
else
}
static void
setup_syslog(const char *progname) {
int options;
#ifdef LOG_NDELAY
options |= LOG_NDELAY;
#endif
}
void
ns_os_init(const char *progname) {
/*
* XXXMPA. We may need to split ntservice_init() in two and
* just mark as running in ns_os_started(). If we do that
* this is where the first part of ntservice_init() should be
* called from.
*
* XXX970 Remove comment if no problems by 9.7.0.
*
* ntservice_init();
*/
}
void
ns_os_daemonize(void) {
/*
* on even if it fails.
*/
if (devnullfd != -1) {
}
}
}
}
}
void
ns_os_opendevnull(void) {
}
void
ns_os_closedevnull(void) {
devnullfd = -1;
}
}
void
ns_os_chroot(const char *root) {
}
void
ns_os_inituserinfo(const char *username) {
}
void
ns_os_changeuser(void) {
}
void
ns_os_minprivs(void) {
}
static int
int fd;
return (-1);
return (-1);
if (append)
else {
}
return (fd);
}
static void
cleanup_pidfile(void) {
}
}
void
int fd;
char strbuf[ISC_STRERRORSIZE];
void (*report)(const char *, ...);
/*
* The caller must ensure any required synchronization.
*/
return;
return;
}
/* This is safe. */
if (fd < 0) {
return;
}
(*report)("could not fdopen() pid file '%s': %s",
return;
}
return;
}
return;
}
}
void
ns_os_shutdown(void) {
closelog();
ntservice_shutdown(); /* This MUST be the last thing done */
}
int n;
return ((n == 0) ? ISC_R_SUCCESS : ISC_R_FAILURE);
}
void
}
void
ns_os_tzset(void) {
#ifdef HAVE_TZSET
tzset();
#endif
}
void
ns_os_started(void) {
}