Print this page
11238 librtld_db demos should work with gcc 7

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/sgs/librtld_db/demo/common/ps.c
          +++ new/usr/src/cmd/sgs/librtld_db/demo/common/ps.c
↓ open down ↓ 322 lines elided ↑ open up ↑
 323  323  
 324  324          (void) snprintf(procname, MAXPATHLEN - 1,
 325  325              "/proc/%d/lwp/%d/lwpstatus", EC_SWORD(ph->pp_pid), EC_SWORD(lid));
 326  326  
 327  327          if ((lwpfd = open(procname, O_RDONLY)) == -1)
 328  328                  return (PS_ERR);
 329  329  
 330  330          if (read(lwpfd, &lwpstatus, sizeof (lwpstatus)) == -1)
 331  331                  return (PS_ERR);
 332  332  
 333      -        gregset = lwpstatus.pr_reg;
      333 +        memcpy(gregset, lwpstatus.pr_reg, sizeof (*gregset));
 334  334  
 335  335          (void) close(lwpfd);
 336  336          return (PS_OK);
 337  337  }
 338  338  
 339  339  void
 340  340  ps_plog(const char *fmt, ...)
 341  341  {
 342  342          va_list         args;
 343  343          static FILE     *log_fp = NULL;
↓ open down ↓ 27 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX