Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Oct 1997 17:52:41 +0200
From:      lada@ws6303.gud.siemens.at (marino.ladavac@siemens.at)
To:        hackers@FreeBSD.ORG, jacques@wired.ctech.ac.za
Subject:   Re: values for exit()
Message-ID:  <199710151552.RAA27333@ws6423.gud.siemens.at>

next in thread | raw e-mail | index | archive | help
> From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 15 17:45:21 MET 1997
> Date: Wed, 15 Oct 1997 16:58:58 +0200
> From: Jacques Hugo <jacques@wired.ctech.ac.za>
> Mime-Version: 1.0
> To: questions@FreeBSD.ORG
> Subject: values for exit()
> Content-Transfer-Encoding: 7bit
> X-Loop: FreeBSD.org
> 
> Hi there ...
> 
> Where can I find the exit values for
> exit()?  Meaning, what is the difference
> between eg exit(1) and exit(2)?

Taken from hackers.

The lowest 8 bits of the exit argument can be picked up with wait(2).

exit(0) is defined as successful termination and treated as such by the
invoking shell.  All other exit(2) values are signals of failure and 
should be treated as such by the invoking programs (the shells do it
already.)  Please beware that exit(256) is the same as exit(0)!

You can use it for the programs that are usually invoked from some other
programs of yours in order to send some post-mortem signal to its invoker
i.e. where did it die, and why.

/Marino
> 
> Thanks
> -Jacques
> 
> -----------------------------------------------------
> The box said "Requires Windows 3.1 or better"
> 			... so I got BSD
> 
> System Administrator      | Jacques Hugo
> UNIX Systems              | jacques@wired.ctech.ac.za
> Cape Technikon            | +27-21-4603584
> ------------------------------------------------------
> 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199710151552.RAA27333>