Does ps(1) also truncate at the same points? The kernel might only store so many characters or the regular API for retrieving process information only return a fixed-width field.

While looking up CPAN docs for Proc::ProcessTable, I found P9Y::ProcessTable, which seems to be a pure-Perl attempt at a similar module. Reading its code suggests that Solaris puts the command line and the filename in fixed-width fields in a "psinfo" file. I suspect that ps(1) will have the same problem and that you have encountered kernel limitations on Solaris and HP-UX.

Further digging into the Proc::ProcessTable source shows that the HP-UX and Solaris ports more-or-less directly return information from the kernel. Unless there are other ways to get the command line and filename, I think that you are stuck.

Look around in /proc/<PID>. On Linux, for example, the overall process status file contains only a command name, but the entire argv array is in cmdline.


In reply to Re: Proc::ProcessTable truncating cmndline and fname by jcb
in thread Proc::ProcessTable truncating cmndline and fname by rgren925

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.