Re: C portability is a myth

From: Randy Howard (randyhoward_at_FOOverizonBAR.net)
Date: 02/26/05


Date: Sat, 26 Feb 2005 08:13:01 GMT

In article <422018FD.38FC99FF@btinternet.com>,
infobahn@btinternet.com says...
> RETURN VALUE
>
> The value returned is -1 on error (e.g. fork failed), and the return
> status of the command otherwise. This latter return status is in the
> format specified in wait(2). Thus, the exit code of the command will
> be WEXITSTATUS(status). In case /bin/sh could not be executed, the
> exit status will be that of a command that does exit(127).
>
> CONFORMING TO
> ANSI C, POSIX.2, BSD 4.3
> (etc)
>
> The implication of the man page is that /bin/sh -c, SIGCHLD, SIGQUIT,
> wait, WEXITSTATUS, and the semantics of the return status, are all
> defined by ANSI.

Not to mention fork(). I knew somebody would find a man page
showing the other side. What I am surprised by is the way the
role of the usual MS bashers and Linux bashers seem to be
reversed in this. :-)

-- 
Randy Howard (2reply remove FOOBAR)
"Making it hard to do stupid things often makes it hard
 to do smart ones too." -- Andrew Koenig


Relevant Pages

  • Re: How to set exit code of non-console app?
    ... NOT yet returned an exit code to Windows (even though it has returned ... control to the command prompt, ... behavior does NOT occur if executing within a command script."). ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: "FFIND" Exit Codes?
    ... || and to issue exit code `0' if it finds any, `1', if it does not. ... | IF ERRORLEVEL 1 GOTO NO-NEW-FILES ... | Could someone provide the syntax to check the FFIND exit codes as ... FFIND is an internal command. ...
    (comp.os.msdos.4dos)
  • Re: Deploy Adobe Acrobat 6.0 using sms 2003
    ... >I tried to install Adobe Acrobat 6.0 using sms 2003 without much luck. ... > "This is what I put in my sms package command line: ... A failure exit code of 1624 was returned. ...
    (microsoft.public.sms.swdist)
  • RE: office 2003 deployment - too general of a error message
    ... I have the transform in the same directory as the package. ... I have the command line as follows ... A failure exit code of 1624 was returned. ... Systems Management Server (SMS) determines status for each ...
    (microsoft.public.sms.swdist)
  • Re: scripting help
    ... prog> file ... The exit code is referenced from shell scripts via the variable $?. ... always contains the value of the exit code of the last command. ... Stranger things have .0. ...
    (Fedora)