Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Fri, 9 Jul 2004 11:10:07 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: negative error status: gcc vs. cl Message-ID: <20040709151007.GD3525@trixie.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i On Fri, Jul 09, 2004 at 11:24:04AM +0200, Daniel Lungu wrote: >> -----wrong-nil(!)-exit-status----- >> % nerr-cl.exe; echo $? >> 0 >> >> $? cannot distinguish exit(0) from exit(-2) ... this is >> logical anarchy! > >:) Ah, but those aren't just two different values passed to exit, they are >:) in fact two entirely different versions of the exit function: gcc links in >:) the version from newlib, whereas msvc links in the version from msvcrt. > >What I meant was calling same msvcrt exit() with status = {0,-2} (in >nerr-cl.exe). > >:) So the problem really is that the Windoze version of the exit function >:) isn't POSIX compliant. Still, we already knew that windoze != unix. >:) That's why cygwin exists, after all! > >Right. Still, Cygwin could do better. See below. Please read up on how the wait() function works. This is what cygwin emulates on Windows. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/