Print this page
3946 ::gcore
Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libproc/common/Pzone.c
          +++ new/usr/src/lib/libproc/common/Pzone.c
↓ open down ↓ 17 lines elided ↑ open up ↑
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   */
  26   26  /*
  27   27   * Copyright (c) 2013, Joyent, Inc. All rights reserved.
       28 + * Copyright (c) 2013 by Delphix. All rights reserved.
  28   29   */
  29   30  
  30   31  #include <assert.h>
  31   32  #include <dlfcn.h>
  32   33  #include <errno.h>
  33   34  #include <libzonecfg.h>
  34   35  #include <link.h>
  35   36  #include <string.h>
  36   37  #include <strings.h>
  37   38  #include <sys/list.h>
↓ open down ↓ 186 lines elided ↑ open up ↑
 224  225          return (buf);
 225  226  }
 226  227  
 227  228  /*
 228  229   * Get the zone name from the core file if we have it; look up the
 229  230   * name based on the zone id if this is a live process.
 230  231   */
 231  232  char *
 232  233  Pzonename(struct ps_prochandle *P, char *s, size_t n)
 233  234  {
 234      -        if (P->state == PS_IDLE) {
 235      -                errno = ENODATA;
 236      -                return (NULL);
 237      -        }
 238      -
 239      -        if (P->state == PS_DEAD) {
 240      -                if (P->core->core_zonename == NULL) {
 241      -                        errno = ENODATA;
 242      -                        return (NULL);
 243      -                }
 244      -                (void) strlcpy(s, P->core->core_zonename, n);
 245      -        } else {
 246      -                if (getzonenamebyid(P->status.pr_zoneid, s, n) < 0)
 247      -                        return (NULL);
 248      -                s[n - 1] = '\0';
 249      -        }
 250      -        return (s);
      235 +        return (P->ops.pop_zonename(P, s, n, P->data));
 251  236  }
 252  237  
 253  238  char *
 254  239  Pzoneroot(struct ps_prochandle *P, char *s, size_t n)
 255  240  {
 256  241          char zname[ZONENAME_MAX], zpath[PATH_MAX], tmp[PATH_MAX];
 257  242          int rv;
 258  243  
 259  244          if (P->zoneroot != NULL) {
 260  245                  (void) strlcpy(s, P->zoneroot, n);
↓ open down ↓ 570 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX