delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/01/19/19:01:52

From: DJ Delorie <dj AT delorie DOT com>
Subject: Re: setting errno
19 Jan 1999 19:01:52 -0500 :
Message-ID: <36A51CF0.93AC983D@delorie.com>
References: <3 DOT 0 DOT 5 DOT 32 DOT 19990119122347 DOT 0a413ec0 DOT cygnus DOT gnu-win32 AT linus DOT mitre DOT org>
Mime-Version: 1.0
X-Mailer: Mozilla 4.5 [en] (X11; I; Linux 2.1.126 i586)
X-Accept-Language: en

Tim Taylor wrote:
> 
> 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?

The correct way is, always was, and always will be, like thus:

	#include <errno.h>

	errno = N;

The ANSI spec requires it to be so.

- Raw text -


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