Print this page
OS-3280 need a way to specify the root of a native system in the lx brand
OS-3279 lx brand should allow delegated datasets
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
        
*** 35,44 ****
--- 35,45 ----
  #include <sys/mkdev.h>
  #include <sys/stat.h>
  #include <sys/types.h>
  
  #include "pmap_common.h"
+ #include "ptools_common.h"
  
  /*
   * We compare the high memory addresses since stacks are faulted in from
   * high memory addresses to low memory addresses, and our prmap_t
   * structures identify only the range of addresses that have been faulted
*** 86,105 ****
  
          if (Pstate(Pr) == PS_DEAD || *mapname == '\0')
                  return (NULL);
  
          /* first see if we can find a path via /proc */
!         (void) snprintf(path, sizeof (path), "/proc/%d/path/%s",
              (int)Psp->pr_pid, mapname);
          len = readlink(path, buf, bufsz - 1);
          if (len >= 0) {
                  buf[len] = '\0';
                  return (buf);
          }
  
          /* fall back to object information reported by /proc */
!         (void) snprintf(path, sizeof (path),
              "/proc/%d/object/%s", (int)Psp->pr_pid, mapname);
          if (stat(path, &statb) == 0) {
                  dev_t dev = statb.st_dev;
                  ino_t ino = statb.st_ino;
                  (void) snprintf(buf, bufsz, "dev:%lu,%lu ino:%lu",
--- 87,106 ----
  
          if (Pstate(Pr) == PS_DEAD || *mapname == '\0')
                  return (NULL);
  
          /* first see if we can find a path via /proc */
!         (void) proc_snprintf(path, sizeof (path), "/proc/%d/path/%s",
              (int)Psp->pr_pid, mapname);
          len = readlink(path, buf, bufsz - 1);
          if (len >= 0) {
                  buf[len] = '\0';
                  return (buf);
          }
  
          /* fall back to object information reported by /proc */
!         (void) proc_snprintf(path, sizeof (path),
              "/proc/%d/object/%s", (int)Psp->pr_pid, mapname);
          if (stat(path, &statb) == 0) {
                  dev_t dev = statb.st_dev;
                  ino_t ino = statb.st_ino;
                  (void) snprintf(buf, bufsz, "dev:%lu,%lu ino:%lu",