Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ getpid(DOS) — OpenDesktop Software Development System 1.0.0d

Media Vault

Software Library

Restoration Projects

Artifacts Sought

     Name
          getpid - Returns a process identification number.

     Syntax
          #include <process.h>

          int getpid(void)

     Description
          The getpid function returns an integer (the process ID) that
          uniquely identifies the calling process.

     Return Value
          The getpid function returns the process ID. There is no
          error return.

     See Also
          mktemp(S)

     Example
          #include <process.h> #include <string.h> #include <stdio.h>

          char filename[9], pid[5];

          main()
           {
                  strcpy(filename, "FILE");
                  strcat(filename, itoa(getpid(), pid,10));

                  /* Prints "FILExxxxx", where xxxxx */
                  /* is the process ID:              */
                  printf("Filename is %s\n", filename);
           }

          This program uses getpid to obtain the process ID, then
          converts the process ID to a string for output.

                                                (printed 6/18/89)



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026