Print this page
12159 truss psflags printing is broken


1613                 outstring(pri, "0x0");
1614                 return;
1615         }
1616 
1617         *str = '\0';
1618         if (secflag_isset(val, PROC_SEC_ASLR)) {
1619                 (void) strlcat(str, "|PROC_SEC_ASLR", sizeof (str));
1620                 secflag_clear(&val, PROC_SEC_ASLR);
1621         }
1622         if (secflag_isset(val, PROC_SEC_FORBIDNULLMAP)) {
1623                 (void) strlcat(str, "|PROC_SEC_FORBIDNULLMAP",
1624                     sizeof (str));
1625                 secflag_clear(&val, PROC_SEC_FORBIDNULLMAP);
1626         }
1627         if (secflag_isset(val, PROC_SEC_NOEXECSTACK)) {
1628                 (void) strlcat(str, "|PROC_SEC_NOEXECSTACK",
1629                     sizeof (str));
1630                 secflag_clear(&val, PROC_SEC_NOEXECSTACK);
1631         }
1632 

1633         len = strlen(str);
1634         ptr = str + len;
1635         (void) snprintf(ptr, sizeof (str) - len, "|%#x", val);


1636         outstring(pri, str + 1);
1637 }
1638 
1639 /*
1640  * Print a psecflags(2) delta
1641  */
1642 void
1643 prt_psdelta(private_t *pri, int raw, long value)
1644 {
1645         secflagdelta_t psd;
1646 
1647         if ((raw != 0) ||
1648             (Pread(Proc, &psd, sizeof (psd), value) != sizeof (psd))) {
1649                 prt_hex(pri, 0, value);
1650                 return;
1651         }
1652         outstring(pri, "{ ");
1653         prt_psflags(pri, psd.psd_add);
1654         outstring(pri, ", ");
1655         prt_psflags(pri, psd.psd_rem);




1613                 outstring(pri, "0x0");
1614                 return;
1615         }
1616 
1617         *str = '\0';
1618         if (secflag_isset(val, PROC_SEC_ASLR)) {
1619                 (void) strlcat(str, "|PROC_SEC_ASLR", sizeof (str));
1620                 secflag_clear(&val, PROC_SEC_ASLR);
1621         }
1622         if (secflag_isset(val, PROC_SEC_FORBIDNULLMAP)) {
1623                 (void) strlcat(str, "|PROC_SEC_FORBIDNULLMAP",
1624                     sizeof (str));
1625                 secflag_clear(&val, PROC_SEC_FORBIDNULLMAP);
1626         }
1627         if (secflag_isset(val, PROC_SEC_NOEXECSTACK)) {
1628                 (void) strlcat(str, "|PROC_SEC_NOEXECSTACK",
1629                     sizeof (str));
1630                 secflag_clear(&val, PROC_SEC_NOEXECSTACK);
1631         }
1632 
1633         if (val != 0) {
1634                 len = strlen(str);
1635                 ptr = str + len;
1636                 (void) snprintf(ptr, sizeof (str) - len, "|%#x", val);
1637         }
1638 
1639         outstring(pri, str + 1);
1640 }
1641 
1642 /*
1643  * Print a psecflags(2) delta
1644  */
1645 void
1646 prt_psdelta(private_t *pri, int raw, long value)
1647 {
1648         secflagdelta_t psd;
1649 
1650         if ((raw != 0) ||
1651             (Pread(Proc, &psd, sizeof (psd), value) != sizeof (psd))) {
1652                 prt_hex(pri, 0, value);
1653                 return;
1654         }
1655         outstring(pri, "{ ");
1656         prt_psflags(pri, psd.psd_add);
1657         outstring(pri, ", ");
1658         prt_psflags(pri, psd.psd_rem);