Print this page
8158 Want named threads API
9857 proc manpages should have LIBRARY section

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/svc/startd/wait.c
          +++ new/usr/src/cmd/svc/startd/wait.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  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      - * Copyright 2012, Joyent, Inc.  All rights reserved.
       24 + *
       25 + * Copyright 2018 Joyent, Inc.
  25   26   */
  26   27  
  27   28  /*
  28   29   * wait.c - asynchronous monitoring of "wait registered" start methods
  29   30   *
  30   31   * Use event ports to poll on the set of fds representing the /proc/[pid]/psinfo
  31   32   * files.  If one of these fds returns an event, then we inform the restarter
  32   33   * that it has stopped.
  33   34   *
  34   35   * The wait_info_list holds the series of processes currently being monitored
↓ open down ↓ 210 lines elided ↑ open up ↑
 245  246          log_framework(LOG_DEBUG, "monitoring PID %ld on fd %d (%s)\n", pid, fd,
 246  247              inst_fmri);
 247  248  
 248  249          return (0);
 249  250  }
 250  251  
 251  252  /*ARGSUSED*/
 252  253  void *
 253  254  wait_thread(void *args)
 254  255  {
      256 +        (void) pthread_setname_np(pthread_self(), "wait");
      257 +
 255  258          for (;;) {
 256  259                  port_event_t pe;
 257  260                  int fd;
 258  261                  wait_info_t *wi;
 259  262  
 260  263                  if (port_get(port_fd, &pe, NULL) != 0) {
 261  264                          if (errno == EINTR)
 262  265                                  continue;
 263  266                          else {
 264  267                                  log_error(LOG_WARNING,
↓ open down ↓ 116 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX