∙Poor aesthetics in output because of misalignment of columns when PIDs use more than the expected five character positions.
∙Poor aesthetics in output because of wrapping around on the standard 80 columns, where it did not previously do so, due to PIDs taking more than five character positions.
∙Running together of adjacent fields making output unreadable. For example, In sprintf("%6d%6d%6d", x, pid, y) the values of the variables x and pid will run together if the PID exceeds five digits.
Temporary File Name Parsing
Programs should never attempt to parse the temporary file names that are generated by functions such as mktemp(3). The traditional decimal encoding of the caller’s PID value is not used when PID values exceed five decimal digits.
Special PIDs
Process ID values should not be compared with any literal or symbolic constant. With one exception, there are no documented special PID values.
The exception, as described in “Comparison Checks on PIDs” is for the system initialization process.
Additional Issues
pstat_getfile()
The pstat_getfile() function encodes only a
shmctl()
Prior to
It is unlikely for any application to have more than that number of processes sharing a memory object.4 Still, it is good practice to recompile any application that uses shmctl() on 11i v1 or later.
_CLASSIC_TYPES
The use of the _CLASSIC_TYPES
Performance of Programs Using pstat_getproc()
Programs that use the pstat_getproc() function do so to obtain information about processes in the system. If that information is stored, the data structures used should be evaluated for performance and scaling. Also, consider increasing the buffer passed to this function, so that information for more processes can be retrieved in each call (thereby decreasing the number of calls that are needed).
4Because the 11i v3 documented maximum processes in the system (limit specified by the nproc kernel tunable parameter) is 60,000, indeed, very unlikely.
8