GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Proc::Background::Unix(3) User Contributed Perl Documentation Proc::Background::Unix(3)

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

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

Proc::Background::Unix - Implementation of process management for Unix systems

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.

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.

  • Blair Zajac <blair@orcaware.com>
  • Michael Conrad <mike@nrdvana.net>

version 1.30

This software is copyright (c) 2021 by Michael Conrad, (C) 1998-2009 by Blair Zajac.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

2021-10-21 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.