delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/10/17/06:53:13

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Message-ID: <3DAE96A4.5090403@yahoo.com>
Date: Thu, 17 Oct 2002 06:53:24 -0400
From: Earnie Boyd <earnie_boyd AT yahoo DOT com>
Reply-To: cygwin AT cygwin DOT com
User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.1) Gecko/20020826
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: Anurag Sharma <anurag AT proximity DOT com DOT au>
CC: newlib AT sources DOT redhat DOT com, cygwin AT cygwin DOT com
Subject: Re: errno issue with cross gcc using newlib
References: <1034826684 DOT 10988 DOT ezmlm AT sources DOT redhat DOT com> <20021017140738 DOT 689df29c DOT anurag AT proximity DOT com DOT au>

Wrong list, redirected.  Please remove newlib AT sources DOT redhat DOT com from 
the distribution in responses.

Earnie.

Anurag Sharma wrote:
> Hi All,
> 
> I have come across a strange behaviour using gcc cross compiler (host:
> linux, target: cygwin). I am using the cygwin header files and lib files
> while making the compiler. (Cygwin uses newlib instaed of libc). 
> 
> Consider this short code:
> 
>    int fd = ::open("/tmp/errnotest", O_RDONLY | O_BINARY);
>     
>     if (fd == -1) {
> 	std::cerr << "open failed, errno=" << errno << ", strerror=" <<
> strerror(errno) << std::endl;
> 	std::cerr << "open failed, errno=" << errno << ", strerror=" <<
> strerror(errno) << std::endl;
>     }
> 
> I have compiled this code using a cross gcc build on host linux using
> target cygwin.
> 
> If I build the cross compiler by providing --enable-threads=single option
> in the configure stage, following is the output :
> 
> open failed, errno=2, strerror=No such file or directory
> open failed, errno=2, strerror=No such file or directory
>  
> This is of course expected.
> 
> Hoewever if I build the cross compiler by providing --enable-threads=posix
> option in the configure stage, the output is as follows :
> 
> open failed, errno=2, strerror=No such file or directory
> open failed, errno=0, strerror=No error
> 
> That is , after the first call to errno, it is reset!!
> 
> Has anyone else experiened this before? Can anyone please help find out
> what exactly is going wrong?
> 
> Regards,
> 
> Anurag
> 
> 
> 
> 
> 


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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