* [Bug 1142] nodebug builds shed no light on -d, -D option failure.
* [Bug 1179] point out the problem with -i/--jaildir and -u/--user when
they are disabled by configure.
+* [Bug 1308] support systems that lack fork().
* [Bug 1343] sntp doesn't link on Solaris 7, needs -lresolv.
(4.2.5p246-RC) 2009/11/17 Released by Harlan Stenn <stenn@ntp.org>
* Upgrade to autogen-5.10
#ifndef NTP_CONFIG_H
#define NTP_CONFIG_H
+#include "ntp_machine.h"
#include "ntp_data_structures.h"
#include "ntpsim.h"
*/
#define CONF_QOS_LOWDELAY 1
#define CONF_QOS_THROUGHPUT 2
-#define CONF_QOS_RELIABILITY 3
+#define CONF_QOS_RELIABILITY 3
#define CONF_QOS_MINCOST 4
#ifdef IPTOS_PREC_INTERNETCONTROL
#define FREE_CFG_T
#endif
+/*
+ * Some systems do not support fork() and don't have an alternate
+ * threads implementation of ntp_intres. Such systems are limited
+ * to using numeric IP addresses.
+ */
+#if defined(VMS) || defined (SYS_VXWORKS) || \
+ (!defined(HAVE_FORK) && !defined(SYS_WINNT))
+#define NO_INTRES
+#endif
+
/* Limits */
#define MAXLINE 1024
{
extern int cache_type; /* authkeys.c */
#ifdef OPENSSL
+#ifndef NO_INTRES
u_char digest[EVP_MAX_MD_SIZE];
u_int digest_len;
EVP_MD_CTX ctx;
+#endif
struct attr_val *my_val;
int item;
#endif
sys_revoke = ptree->auth.revoke;
#endif /* OPENSSL */
-#if !defined(VMS) && !defined(SYS_VXWORKS)
+#ifndef NO_INTRES
/* find a keyid */
if (info_auth_keyid == 0)
req_keyid = 65535;
/* save keyid so we will accept config requests with it */
info_auth_keyid = req_keyid;
-#endif /* !defined(VMS) && !defined(SYS_VXWORKS) */
+#endif /* !NO_INTRES */
}
/*
* do_resolve_internal - start up the resolver function (not program)
- */
-/*
- * On VMS, this routine will simply refuse to resolve anything.
+ *
+ * On VMS, VxWorks, and Unix-like systems lacking fork(), this routine
+ * will simply refuse to resolve anything.
*
* Possible implementation: keep `res_file' in memory, do async
* name resolution via QIO, update from within completion AST.
(void) fclose(res_fp);
res_fp = NULL;
-#if !defined(VMS) && !defined (SYS_VXWORKS)
+#ifndef NO_INTRES
req_file = res_file; /* set up pointer to res file */
#ifndef SYS_WINNT
(void) signal_no_reset(SIGCHLD, catchchild);
-#ifndef SYS_VXWORKS
/* the parent process will write to the pipe
* in order to wake up to child process
* which may be waiting in a select() call
(void) signal_no_reset(SIGCHLD, SIG_DFL);
-#ifdef DEBUG
- if (0)
- debug = 2;
-#endif
-
init_logging("ntpd_intres", 0);
setup_logfile();
/*
abort_resolve();
exit(1);
}
-#else
- /* vxWorks spawns a thread... -casey */
- i = sp (ntp_intres);
- /*i = taskSpawn("ntp_intres",100,VX_FP_TASK,20000,ntp_intres);*/
-#endif
if (i == -1) {
msyslog(LOG_ERR, "fork() failed, can't start ntp_intres: %m");
(void) signal_no_reset(SIGCHLD, SIG_DFL);
abort_resolve();
- }
- else {
+ } else
/* This is the parent process who will write to the pipe,
* so we close the read fd */
close(resolver_pipe_fd[0]);
- }
#else /* SYS_WINNT */
{
/* NT's equivalent of fork() is _spawn(), but the start point
}
}
#endif /* SYS_WINNT */
-#else /* VMS VX_WORKS */
+#else /* NO_INTRES follows */
msyslog(LOG_ERR,
- "Name resolution not implemented for VMS - use numeric addresses");
+ "Deferred DNS not implemented - use numeric addresses");
abort_resolve();
-#endif /* VMS VX_WORKS */
+#endif
}