logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Proc::Background::Unix - Unix-specific implementation of process create/wait/kill

Authors

       •   Blair Zajac <blair@orcaware.com>

       •   Michael Conrad <mike@nrdvana.net>

Description

       This module does not have a public interface.  Use Proc::Background.

Implementation

Commandvs.Exec
       Unix systems start a new process by creating a mirror of the current process ("fork") and then having it
       alter its own state to prepare for the new program, and then calling "exec" to replace the running code
       with code loaded from a new file.  However, there is a second common method where the user wants to
       specify a command line string as they would type it in their shell.  In this case, the actual program
       being executed is the shell, and the command line is given as one element of its argument list.

       Perl already supports both methods, such that if you pass one string to "exec" containing shell
       characters, it calls the shell, and if you pass multiple arguments, it directly invokes "exec".

       This module mostly just lets Perl's "exec" do its job, but also checks for the existence of the
       executable first, to make errors easier to catch.  This check is skipped if there is a single-string
       command line.

       Unix lets you run a different executable than what is listed in the first argument.  (this feature lets
       one Unix executable behave as multiple different programs depending on what name it sees in the first
       argument) You can use that feature by passing separate options of "exe" and "command" to this module's
       constructor instead of a simple argument list.  But, you can't mix a "exe" option with a shell-
       interpreted command line string.

   ErrorsduringExec
       If the "autodie" option is enabled, and the system supports "FD_CLOEXEC", this module uses a trick where
       the forked child relays any errors through a pipe so that the parent can throw and handle the exception
       directly instead of creating a child process that is dead-on-arrival with the error on STDERR.

Name

       Proc::Background::Unix - Unix-specific implementation of process create/wait/kill

Version

       version 1.32

See Also