From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26562 invoked by alias); 31 Mar 2016 18:58:32 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 26538 invoked by uid 89); 31 Mar 2016 18:58:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=headed, Hx-languages-length:1677, states, WILL X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 31 Mar 2016 18:58:19 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EACAA73034 for ; Thu, 31 Mar 2016 18:58:17 +0000 (UTC) Received: from [10.3.113.124] (ovpn-113-124.phx2.redhat.com [10.3.113.124]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2VIwHaE032092 for ; Thu, 31 Mar 2016 14:58:17 -0400 Subject: Re: windows exit codes truncated to 1 Byte To: cygwin@cygwin.com References: <1233154500.205789.1459429282664.JavaMail.yahoo.ref@mail.yahoo.com> <1233154500.205789.1459429282664.JavaMail.yahoo@mail.yahoo.com> <56FD268D.4060904@gmx.de> <56FD413A.9050502@redhat.com> <20160331185002.GA3353@calimero.vinschen.de> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Message-ID: <56FD7349.70003@redhat.com> Date: Thu, 31 Mar 2016 18:58:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <20160331185002.GA3353@calimero.vinschen.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6m4wq9jXSwBIfM9o9nohrrEHdc4J1BVRM" X-IsSubscribed: yes X-SW-Source: 2016-03/txt/msg00585.txt.bz2 --6m4wq9jXSwBIfM9o9nohrrEHdc4J1BVRM Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-length: 1660 On 03/31/2016 12:50 PM, Corinna Vinschen wrote: > On Mar 31 09:24, Eric Blake wrote: >> On 03/31/2016 07:30 AM, Bj=C3=B6rn Stabel wrote: >>> Am 31.03.2016 um 15:01 schrieb Cristian: >>>> I noted that exit codes returned by CMD and other apps (msiexec) are t= runcated to 1 byte (0 .. 255). >> >> This matches Linux, but not POSIX. >=20 > Why? Does bash use waitid? Not yet, but with the link I referred to below, the thought is that eventually bash WILL use waitid(), based on the direction POSIX is headed in. > But... >=20 >>> POSIX specifies that the lower 8 bits of the exit status be made >>> available to the caller of wait/waitpid: >>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/wait.html >> >> Correct: wait() and waitpid() can only return 8 bits; but POSIX states >> that waitid() MUST be able to access all 32-bits untruncated; this is >> where Linux gets it wrong (Linux truncates during exit(), so waitid() >> can only return 8 bits; other operating systems do NOT truncate during >> exit, but preserve all 32 bits; if you use wait() or waitpid() you only >> get 8 bits, but if you use waitid() you can see the full 32 bits). >=20 > ...that only makes sense if we implement waitid at all. SHTDI and all > that... Right - without waitid(), it's fairly obvious that cygwin isn't quite up to POSIX compliance yet :) And indeed, patches are welcome, if someone who cares enough about more than 8 bits wants to step up and write it (personally, I don't care enough as long as Linux is still truncating early during exit()). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --6m4wq9jXSwBIfM9o9nohrrEHdc4J1BVRM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" Content-length: 604 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJW/XNJAAoJEKeha0olJ0Nq2skH/25do+nIwHmRtAoIgw/c9Noy vIGKbG19zczuiekDRHlFbg8Dy05eufE9Ptp8XlsEPgzkrSbRst9RDfPHrawJWh9y SQs6VTOWICwz+f0kai1C5ar29VR3XUvptT5oqigmr87wn6U2pYVWqtF4RV6rVWxX MiCLsbqyU16rSReSdn8BOdKQ80w4eC23ribicPQKS1lqgefzF9BSUxoJ2x0hJX1M 2Hh5wOG3ihGvhr8ohKjzWp7yaXHwcC0HNANL3Tqxqn8IgYb6HiHAPLxVZkKx6c+0 e09jUlomvZyFPxrXk+hF61MQ199pDp8LRyaIMz41tTqFjqY4+DkEULE7QPDRR74= =lKRX -----END PGP SIGNATURE----- --6m4wq9jXSwBIfM9o9nohrrEHdc4J1BVRM--