Subject: RE: setting errno
From: [email-masked] (Bernard Dautrevaux)

21 Jan 1999 00:36:46 -0800
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
To: "'Tim Taylor'" <[email-masked]>, [email-masked]

> -----Message d'origine-----
> De:	Tim Taylor [SMTP:[email-masked]]
> Date:	mardi 19 janvier 1999 18:24
> À:	[email-masked]
> Objet:	setting errno
> 
> I'm porting a program that sets errno if an operation fails.  However,
> in
> the B20.1 errno is a macro that dereferences the pointer returned by a
> function #define errno (*__errno())
> 
> What is the proper way to set errno in cygwin?
> 
Do you mean that "errno = Exxx;" fails? Iwould have expected it to work
without any problem; the only problem this causse is that its not
possible to declare a static (or global) variable and initialize it by
"static perrno = &errno;" (but I'm not sure if ANSI C requires this to
work...).

> Based on comments I've read in the headers, it appears that the
> following
> will work:
> 
> _REENT->_errno = xxx
> 
What's "_REENT"? I don't know, but this seems utterly non-portable...

> Is this correct, or is there a more compatible or preferred way of
> doing this?
> 
I would just simply use "errno = xxx;" I'm sure I do this all the time
and I never get any error...

------------------------------------------------------------------------
------
Bernard Dautrevaux
Microprocess Ingéniérie
97 bis, rue de Colombes
92400 COURBEVOIE
FRANCE
Tel:	+33 (0) 1 47 68 80 80
Fax:	+33 (0) 1 47 88 97 85
e-mail:	[email-masked]
		[email-masked]
------------------------------------------------------------------------
------

>  
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".