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


Manual Reference Pages  -  PROC::WAITSTAT (3)

.ds Aq ’

NAME

Proc::WaitStat - Interpret and act on wait() status values

CONTENTS

SYNOPSIS



    $description = waitstat $?;
    exit waitstat_reuse $?;
    waitstat_die $?, program-name;
    close_die COMMAND, program-name;



DESCRIPTION

This module contains functions for interpreting and acting on wait status values.

Nothing is exported by default.
<B>waitstatB> wait-status Returns a string representation of wait() status value wait-status. Values returned are like "0" and "64" and "killed (SIGHUP)".

This function is prototyped to take a single scalar argument.

<B>waitstat_reuseB> wait-status Turn wait-status into a value which can be passed to <B>exitB>, converted in the same manner the shell uses. If wait-status indicates a normal exit, return the exit value. If wait-status instead indicates death by signal, return 128 plus the signal number.

This function is prototyped to take a single scalar argument.

<B>waitstat_dieB> wait-status program-name die() if wait-status is non-zero (mentioning program-name as the source of the error).

This function is prototyped to take two scalar arguments.

<B>close_dieB> filehandle name Close filehandle, if that fails die() with an appropriate message which refers to name. This handles failed closings of both programs and files properly.

This function is prototyped to take a filehandle (actually, a glob ref) and a scalar.

EXAMPLES



    close SENDMAIL;
    exit if $? == 0;
    log "sendmail failure: ", waitstat $?;
    exit EX_TEMPFAIL;

    $pid == waitpid $pid, 0 or croak "Failed to reap $pid: $!";
    exit waitstat_reuse $?;

    $output = `some-program -with args`;
    waitstat_die $?, some-program;
    print "Output from some-process:\n", $output;

    open PROGRAM, | post-processor or die "Cant fork: $!";
    while (<IN>) {
        print PROGRAM pre_process $_
            or die "Error writing to post-processor: $!";
    }
    # This handles both flush failures at close time and a non-zero exit
    # from the subprocess.
    close_die PROGRAM, post-processor;



AUTHOR

Roderick Schertler <roderick@argon.org>

SEE ALSO

perl(1), IPC::Signal(3pm).
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 WAITSTAT (3) 1999-10-21

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