Print this page
4211 Some syslog facility names and symbols are missing
1762 Syslogd man page: missing reference.

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/syslogd/syslogd.c
          +++ new/usr/src/cmd/syslogd/syslogd.c
↓ open down ↓ 14 lines elided ↑ open up ↑
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   * Copyright 2012 Milan Jurik. All rights reserved.
       25 + * Copyright (c) 2013 Gary Mills
  25   26   */
  26   27  
  27   28  /*
  28   29   *      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
  29   30   *      All Rights Reserved
  30   31   */
  31   32  
  32   33  /*
  33   34   * University Copyright- Copyright (c) 1982, 1986, 1988
  34   35   * The Regents of the University of California
↓ open down ↓ 113 lines elided ↑ open up ↑
 148  149          "user",         LOG_USER,
 149  150          "mail",         LOG_MAIL,
 150  151          "daemon",       LOG_DAEMON,
 151  152          "auth",         LOG_AUTH,
 152  153          "security",     LOG_AUTH,
 153  154          "mark",         LOG_MARK,
 154  155          "syslog",       LOG_SYSLOG,
 155  156          "lpr",          LOG_LPR,
 156  157          "news",         LOG_NEWS,
 157  158          "uucp",         LOG_UUCP,
      159 +        "altcron",      LOG_ALTCRON,
      160 +        "authpriv",     LOG_AUTHPRIV,
      161 +        "ftp",          LOG_FTP,
      162 +        "ntp",          LOG_NTP,
 158  163          "audit",        LOG_AUDIT,
      164 +        "console",      LOG_CONSOLE,
 159  165          "cron",         LOG_CRON,
 160  166          "local0",       LOG_LOCAL0,
 161  167          "local1",       LOG_LOCAL1,
 162  168          "local2",       LOG_LOCAL2,
 163  169          "local3",       LOG_LOCAL3,
 164  170          "local4",       LOG_LOCAL4,
 165  171          "local5",       LOG_LOCAL5,
 166  172          "local6",       LOG_LOCAL6,
 167  173          "local7",       LOG_LOCAL7,
 168  174          NULL,           -1
↓ open down ↓ 441 lines elided ↑ open up ↑
 610  616          static int klogerrs = 0;
 611  617          pthread_t mythreadno;
 612  618  
 613  619          if (Debug) {
 614  620                  mythreadno = pthread_self();
 615  621          }
 616  622  
 617  623          DPRINT1(1, "sys_poll(%u): sys_thread started\n", mythreadno);
 618  624  
 619  625          /*
 620      -         * Try to process as many messages as we can without blocking on poll.
 621      -         * We count such "initial" messages with sys_init_msg_count and
 622      -         * enqueue them without the SYNC_FILE flag.  When no more data is
 623      -         * waiting on the local log device, we set timeout to INFTIM,
 624      -         * clear sys_init_msg_count, and generate a flush message to sync
 625      -         * the previously counted initial messages out to disk.
      626 +         * Process messages, blocking on poll because timeout is set
      627 +         * to INFTIM.  When poll returns with a message, call getkmsg
      628 +         * to pull up one message from the log driver and enqueue it
      629 +         * with the sync flag set.
 626  630           */
 627  631  
 628  632          sys_init_msg_count = 0;
 629  633  
 630  634          for (;;) {
 631  635                  errno = 0;
 632  636                  t_errno = 0;
 633  637  
 634  638                  nfds = poll(&Pfd, 1, INFTIM);
 635  639  
↓ open down ↓ 52 lines elided ↑ open up ↑
 688  692  
 689  693          dat.maxlen = MAXLINE;
 690  694          dat.buf = buf;
 691  695          ctl.maxlen = sizeof (struct log_ctl);
 692  696          ctl.buf = (caddr_t)&hdr;
 693  697  
 694  698          while ((i = getmsg(Pfd.fd, &ctl, &dat, &flags)) == MOREDATA) {
 695  699                  lastline = &dat.buf[dat.len];
 696  700                  *lastline = '\0';
 697  701  
 698      -                DPRINT2(5, "sys_poll:(%u): getmsg: dat.len = %d\n",
      702 +                DPRINT2(5, "getkmsg:(%u): getmsg: dat.len = %d\n",
 699  703                      mythreadno, dat.len);
 700  704                  buflen = strlen(buf);
 701  705                  len = findnl_bkwd(buf, buflen);
 702  706  
 703  707                  (void) memcpy(tmpbuf, buf, len);
 704  708                  tmpbuf[len] = '\0';
 705  709  
 706  710                  /*
 707  711                   * Format sys will enqueue the log message.
 708  712                   * Set the sync flag if timeout != 0, which
↓ open down ↓ 4885 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX