The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 06-29-2009
mgessner mgessner is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 50
Because pid's differ widely across systems, the only thing you can really do (aside from changing printf() and adding a new class of object) is to cast intelligently:


Code:
printf ("pid = %lu\n", (unsigned long) getpid());

It's a reasonable assumption that a PID is an unsigned integer type.

HTH. YMMV.