Documentation
¶
Overview ¶
Package timeout implements the POSIX timeout utility, with the GNU extensions --foreground, --verbose and the 'inf' durations.
This runtime has no way to signal a child process in the middle of an execution, so the time limit is enforced by canceling the context the execution runs with, which the real implementation turns into killing the child process. What the manuals call sending a signal maps to this cancellation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Prog ¶
Prog is the timeout core utility.
func (*Prog) Run ¶
Run executes the command operand under the time limit of the duration operand. When the limit elapses, the command is given up on and timeout exits with 124, or with the status of the command with --preserve-status. The 127, 126 and 125 statuses of a failed execution are passed along with a diagnostic. The context error is returned as-is when the caller's context is done.