delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/05/04/10:36:05

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <80575AFA5F0DD31197CE00805F650D7602CF04@wilber.adroit.com>
From: "Robinow, David" <drobinow AT dayton DOT adroit DOT com>
To: cygwin AT cygwin DOT com
Subject: RE: oldhand cygwinner needed: RE: __errno_location() like functio
nality in Cygwin
Date: Fri, 4 May 2001 10:35:15 -0400
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)

> From: Dmitry Timoshkov [mailto:dmitry AT sloboda DOT ru]
> > > How can I have *only* thread local errno variable? Under Linux that
> > 
> > #include <errno.h>
> 
> What then?
> > functionality is provided
> > > by overriding __errno_location() function. Under Cygwin 
> > > definition of my own
> > > __errno() function doesn't help.
> >  Why do you want your own __errno function?
> 
> Probably I wasn't clear enough in my previous postings, 
 I'm sure I wasn't clear enough.
> sorry. It's not me,
> it's an application that I want to port to Cygwin. Is it so 
> unusual to have
> *an application provided* errno variable (for every distinct thread)?
 I don't think it's necessary.
> 
> As I already mentioned, that approach works fine in Linux. As 
> far as I know,
> similar mechanisms are provided by FreeBSD (__error()), 
> Solaris (___errno()),
> UnixWare (__thr_errno()).
> 
> Is it true that Cygwin has no analogous functionality?
 I have not actually used threads under Cygwin so I may
be completely wrong here, but here's what I think.

/usr/include/sys/errno.h defines errno as a macro  (int * __errno)
 __errno is provided by the operating system.  You do not have
to create this yourself.
  You do not want to define errno yourself.
Delete any declarations of errno in your program.
You can use errno in your program and it will be thread safe.
  It just works.
 Somebody please tell me if I'm wrong.
  

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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