delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/07/09/19:30:58

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:date:message-id:subject:from:to
:content-type; q=dns; s=default; b=oBf4QjVcA5Bg3h1SiIOX3JHq4lkQs
9+NrlhV8EmsTTr4Xz/+4qcC0de1EGrpN7GwxVpatVZfPkHI42278qzEtvQN1TJtm
nk08yY+i10542memoIVAnKsLW84sqE3eYA8O0tqPLHS3Lfx7QtRvCejajJihAdxG
jqqy9N4FHOS50c=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:date:message-id:subject:from:to
:content-type; s=default; bh=1X8NgPZyTomlvuDHs5EXvi/363g=; b=RcJ
EkL7Am3B6D0boEOd9GYdXI7d+HQqzD5zDcTJqZQmvgQ6WYLNGKlhlN9D2D6UKC8I
ME8pjwJV7QASWTBxaXt/WtYyUo5sYN0GjgtFhWNVzICNsizFqW/paVRHku0JPr0U
TFXU+VKDGZrTdkIeUCQsYyz5+/Sq2CEELLogBSCc=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-0.0 required=5.0 tests=AWL,BAYES_40,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2
X-HELO: mail-yk0-f172.google.com
MIME-Version: 1.0
X-Received: by 10.170.204.130 with SMTP id v124mr19832045yke.72.1436484640603; Thu, 09 Jul 2015 16:30:40 -0700 (PDT)
Date: Thu, 9 Jul 2015 19:30:40 -0400
Message-ID: <CAMKht8gCOXF+nObhC69_LyU+TOsbWnnK8PCt-ghgWT=40hmMaw@mail.gmail.com>
Subject: Return codes over 1 byte
From: Michael DePaulo <mikedep333 AT gmail DOT com>
To: The Cygwin Mailing List <cygwin AT cygwin DOT com>
X-IsSubscribed: yes

mark06 mentioned this on IRC today and then left the channel about 1 hour later:

<mark06> has anyone ever discussed exit codes above one byte? they are
valid on modern windows, but cygwin's bash will mess them

I was curious, so I googled it (I could not find an answer) and then
tried it out. I can confirm the what he said.

Cygwin Bash:

mike AT executor ~
$ uname -a
CYGWIN_NT-10.0 executor 2.0.4(0.287/5/3) 2015-06-09 12:22 x86_64 Cygwin

mike AT executor ~
$ cat return.c
int main (){ return 512; }

mike AT executor ~
$ x86_64-w64-mingw32-gcc return.c -o return.exe

mike AT executor ~
$ ./return.exe

mike AT executor ~
$ echo $?
0

cmd.exe:

C:\cygwin64\home\mike>return.exe

C:\cygwin64\home\mike>echo %errorlevel%
512

-Mike

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019