Services and Modeling for Embedded Software Development
Embecosm divider strip
Prev  Next

5.3.8.  Get the Current Process ID, getpid

For a namespace clean function, implement _getpid, otherwise implement getpid. The implementation of this functionality will be tightly bound to any operating infrastructure for handling multiple processes.

For a minimal implementation, with no processes, this can just return a constant. It is perhaps safer to return one rather than zero, to avoid issue with software that believes process zero is something special.

_getpid ()
  return  1;                            /* Success */

}       /* _getpid () */
Embecosm divider strip