Table of Contents

 

Introduction ...................................................................................................................................

3

Terminology...................................................................................................................................

3

Administrator Notes ........................................................................................................................

4

Kernel Tunable Parameters............................................................................................................

4

Cautions....................................................................................................................................

5

Programmer Notes..........................................................................................................................

5

Correct Handling of PID and Number of Processes............................................................................

5

Use pid_t for PID, PGID, SID Values ............................................................................................

6

Use 32-bit int for Process Counters..............................................................................................

6

Comparision Checks on PIDs .....................................................................................................

6

Use Data Structures Other Than Arrays for Tracking.......................................................................

6

Print/Display Formats for Ten Decimal Digits ................................................................................

6

Incorrect Handling.......................................................................................................................

6

Using 16-Bit short or unsigned short for PIDs.................................................................................

6

Using 16-Bit Data Types for Process (or Thread) Counts..................................................................

7

Checking Against MAXPID, PID_MAX, or 30,000 .........................................................................

7

Using Arrays to Track Processes .................................................................................................

7

Five Decimal Digits ..................................................................................................................

7

Temporary File Name Parsing....................................................................................................

8

Special PIDs ...........................................................................................................................

8

Additional Issues.........................................................................................................................

8

pstat_getfile() ..........................................................................................................................

8

shmctl() ..................................................................................................................................

8

_CLASSIC_TYPES.....................................................................................................................

8

Performance of Programs Using pstat_getproc() ............................................................................

8

nproc ....................................................................................................................................

9

Algorithm Scaling ....................................................................................................................

9

Detecting Program Sources That Make Incorrect Assumptions..............................................................

9

Testing ....................................................................................................................................

10

Testing Large PIDs..................................................................................................................

10

Testing Large Numbers of Processes..........................................................................................

10

For more information.....................................................................................................................

11