This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: oldhand cygwinner needed: RE: __errno_location() like functionality in Cygwin


> From: Dmitry Timoshkov [mailto:dmitry@sloboda.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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]