[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: should man pages mention exit values even if run of the mill?



On Wed, 01 Dec 2004, Dan Jacobson wrote:
> Should man pages mention exit codes, even if standard? There perhaps

They can.  But a "returns status zero if everything works fine and nonzero
otherwise is the standard", which ain't helpful at all.

So, please just assume that if something isn't documented differently, it is
zero = ok, nonzero=bad and go with that.  Don't bother people with such a
pointless request, please, we have better things to do.  If you *do* have a
reason to need more detailed status codes for a particular tool, file a
wishlist bug with the full rationale (which DOES include just why you need
more detailed status codes).

> And even more important is saying the definition of success. E.g.,
> 0: connection is guaranteed to now be terminated
> 0: signal sent, connection usually terminates soon
> 1: unable to even send signal
> 1: unable to send signal or sent signal but unable to terminate connection

In practice, that won't happen. So just learn your tools better, to know how
they will behave.  99% of the time, such level of detail ain't important
anyway outside of debug logs, which are NOT done through exit status...

BTW, you cannot be sure a TCP/IP connection has been fully terminated EVEN
if you shutdown(2) the socket then close() it.  Let alone if you don't
shutdown(2) it (and I don't think most apps do that).  All you know is that
it WILL be terminated sometime in the future.  You cannot even be sure the
other size of the connection will notice the connection teardown (if network
is down for long enough between the peers at the time you close one side of
the connection, the other side will not notice until it tries to transmit
something).

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh



Reply to: