Lines Matching +full:sco +full:- +full:routing

2  * ntpd.c - main program for the fixed point NTP daemon
28 #include "ntpd-opts.h"
31 * [Bug 2954] enable the threading warm-up only for Linux.
179 #define NTPD_PRIO (-12)
181 int priority_done = 2; /* 0 - Set priority */
182 /* 1 - priority is OK where it is */
183 /* 2 - Don't set priority */
189 * No-fork flag. If set, we do not become a background daemon.
220 int daemon_pipe[2] = { -1, -1 };
234 * We put this here, since the argument profile is syscall-specific
288 * and uses a function that comes from GCC (--> libgcc_s.so) to do
307 * machinery is pre-heated and all the runtime stuff should be in place
315 * with all OS is wrong -- at least FreeBSD bombs heavily.
332 /* pre-heat threading: create a thread and cancel it, just to exercise
353 "my_pthread_warmup: pthread_attr_setstacksize() -> %s",
362 "my_pthread_warmup: pthread_create() -> %s",
397 *pargc -= optct;
454 * value, use ulimit -a.
518 if ( sched_setscheduler(0, SCHED_FIFO, &sched) == -1 )
530 srtp.prio = 0; /* 0 (hi) -> RTP_PRIO_MAX (31,lo) */
550 if (-1 == nice (NTPD_PRIO) && errno != 0)
558 if (-1 == setpriority(PRIO_PROCESS, 0, NTPD_PRIO))
595 if (-1 == cpid) {
600 pipes[1] = -1;
604 /* probe daemon exit code -- wait for
627 pipes[0] = -1;
645 if (setsid() == (pid_t)-1)
648 if (setpgid(0, 0) == -1)
661 /* Don't get killed by low-on-memory signal. */
689 user = estrdup(pw->pw_name);
690 sw_gid = pw->pw_gid;
701 sw_uid = pw->pw_uid;
702 sw_gid = pw->pw_gid;
730 sw_gid = gr->gr_gid;
763 if (0 != initgroups(pw->pw_name, pw->pw_gid)) {
764 msyslog(LOG_ERR, "initgroups(<%s>, %d) filed: %m", pw->pw_name, pw->pw_gid);
794 exit (-1);
799 exit (-1);
870 /* honor -l/--logfile option to log to a file */
894 snprintf(cp, sizeof(buf) - (cp - buf),
901 msyslog(LOG_NOTICE, "----------------------------------------------------");
902 msyslog(LOG_NOTICE, "ntp-4 is maintained by Network Time Foundation,");
903 msyslog(LOG_NOTICE, "Inc. (NTF), a non-profit 501(c)(3) public-benefit");
904 msyslog(LOG_NOTICE, "corporation. Support and training for ntp-4 are");
906 msyslog(LOG_NOTICE, "----------------------------------------------------");
908 msyslog(LOG_NOTICE, "DEBUG behavior is enabled - a violation of any"
928 /* We can run as non-root if the mac_ntpd policy is enabled. */
940 * Enable the Multi-Media Timer for Windows?
960 * --interface, listen on specified interfaces
967 while (ifacect-- > 0) {
972 *ifaces, -1, ACTION_LISTEN);
992 * overide any '-n' (nofork) or '-d' (debug) option presented on
1004 "Pipe creation failed for --wait-sync/daemon: %m");
1040 * SCO OpenServer's system clock offers much more precise timekeeping
1057 # if defined(RLIMIT_MEMLOCK) && defined(DFLT_RLIMIT_MEMLOCK) && DFLT_RLIMIT_MEMLOCK != -1
1075 if (ulimit(SET_STACKLIM, (get_aix_stack() - 8 * 4096)) < 0)
1116 * Exactly what command-line options are we expecting here?
1143 if (-1 == cur_memlock) {
1150 && -1 != DFLT_RLIMIT_MEMLOCK
1170 msyslog(LOG_ERR, "plock() - don't know what to lock!");
1191 exit(-1);
1209 /* Drop super-user privileges and chroot now if the OS supports this */
1213 if (prctl( PR_SET_KEEPCAPS, 1L, 0L, 0L, 0L ) == -1) {
1215 exit(-1);
1222 msyslog(LOG_ERR, "Need user name to drop root privileges (see -u flag!)" );
1223 exit(-1);
1229 exit (-1);
1233 exit (-1);
1240 exit (-1);
1244 exit (-1);
1248 exit (-1);
1254 exit(-1);
1258 exit(-1);
1262 if (setppriv(PRIV_SET, PRIV_PERMITTED, lowprivs) == -1) {
1264 exit(-1);
1268 exit(-1);
1272 * To manipulate system time and (re-)bind to NTP_PORT as needed
1278 exit (-1);
1283 * is associated with running with uid 0 - should be refined on
1286 scan_addrs_once |= (sw_uid != 0); /* used by routing socket code */
1290 msyslog(LOG_INFO, "running as non-root disables dynamic interface tracking");
1296 * We may be running under non-root uid now, but we still hold full root privileges!
1311 exit(-1);
1313 if (-1 == cap_set_proc(caps)) {
1316 exit(-1);
1322 if (priv_delset(lowprivs, "proc_setid") == -1) {
1324 exit(-1);
1326 if (setppriv(PRIV_SET, PRIV_PERMITTED, lowprivs) == -1) {
1328 exit(-1);
1444 if (daemon_pipe[1] != -1 && 0 == wait_sync) {
1449 daemon_pipe[1] = -1;
1532 if (rbuf->receiver != NULL) {
1536 L_SUB(&dts, &rbuf->recv_time);
1541 (*rbuf->receiver)(rbuf);
1566 if (mdnsreg && (current_time - mdnsreg ) > 60 && mdnstries && sys_leap != LEAP_NOTINSYNC) {
1571 if (!--mdnstries) {
1592 * finish - exit gracefully
1632 * wait_child_sync_if - implements parent side of -w/--wait-sync
1662 ? (wait_end_time - cur_time)
1670 if (-1 == rc) {
1695 /* DPRINTF is useless here as -d/-D disable forking */
1697 return -1; /* unexpected EOF, check daemon */
1712 fprintf(stderr, "%s: -w/--wait-sync %ld timed out.\n",
1714 msyslog(LOG_ERR, "-w/--wait-sync %ld timed out.", wait_sync);
1759 * assertion_failed - Redirect assertion failures to msyslog().
1785 * library_fatal_error - Handle fatal errors from our libraries.
1814 * library_unexpected_error - Handle non fatal errors from our libraries.
1845 * moredebug - increase debugging verbosity
1864 * lessdebug - decrease debugging verbosity
1875 debug--;
1885 * no_debug - We don't do the debug here.