Copyright © tutorialspoint.com

PERL waitpid Function


Syntax

waitpid PID, FLAGS


Definition and Usage

Waits for the child process with ID PID to terminate, returning the process ID of the deceased process. If PID does not exist, then it returns -1. The exit status of the process is contained in $?.

The flags can be set to various values which are equivalent to those used by the waitpid() UNIX system call. A value of 0 for FLAGS should work on all operating systems that support processes.

Return Value

  • -1 if process does not exist

  • Process ID of deceased process


Copyright © tutorialspoint.com