delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/11/03/21:25:24

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
From: "Suhaib M. Siddiqi" <ssiddiqi AT ipass DOT net>
To: "Mumit Khan" <khan AT thor DOT xraylith DOT wisc DOT edu>,
"John Fralinger" <fralinjh AT ei DOT dupont DOT com>
Cc: <cygwin AT sourceware DOT cygnus DOT com>
Subject: RE: sys_errlist
Date: Wed, 3 Nov 1999 20:22:20 -0500
Message-ID: <LOBBLPGIHMIEGBEAFDMCCELCCBAA.ssiddiqi@ipass.net>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
In-Reply-To: <199911032200.QAA03357@mercury.xraylith.wisc.edu>
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Importance: Normal

On most of the Unices, including RedHat Linux it is sys_errlist,
in errno.h on Cygwin it is _sys_errlist.  That was the reason
I had to add #define sys_errlist _sys_errlist at 100 places when
I patched OpenDx code for Cygwin B20.1.  Off course I had to add
#ifdef __CYGWIN__
#include <errno.h>
#endif 
too, otherwise during linking _sys_errlist was not resolved.

Suhaib
 
> -----Original Message-----
> From: cygwin-owner AT sourceware DOT cygnus DOT com
> [mailto:cygwin-owner AT sourceware DOT cygnus DOT com]On Behalf Of Mumit Khan
> Sent: Wednesday, November 03, 1999 5:00 PM
> To: John Fralinger
> Cc: cygwin AT sourceware DOT cygnus DOT com
> Subject: Re: sys_errlist 
> 
> 
> John Fralinger <fralinjh AT ei DOT dupont DOT com> writes:
> > Mumit,
> >    Thanks for your quick response.
> >    Your test code below does indeed work.
> > 
> > I am still confused about when to use an "_" and when not to.
> > 
> > I do not have any problems implementing Mr. Siddiqi's suggestion
> > but I would like to understand what's going on.
> 
> sys_nerr, sys_errlist are not mandated by various standards, and the
> runtimes tend to expose these non-standard items with a leading
> underscore. This unfortunately causes trouble with lots of the existing 
> Unix code, and that's unfortunate. Perhaps Cygnus will consider exposing
> the non-underscored version as well via the export definition file?
> 
> Detecting the correct form of sys_nerr and sys_errlist turns out to
> be quite tricky. Consider the following tests that are normally used
> for detecting runtime library characteristics:
> 
>  try 1: create a dummy program with sys_nerr and see if it links. If 
>    found, done.
>  try 2: create a dummy program with _sys_nerr and see if it links. If 
>    found, done.
> 
> If neither tests succeed, the runtime library does not have sys_nerr.
> Now consider the case of Cygwin: you can't just create a dummy program,
> but also have to make sure you include <errno.h>, and then try both
> sys_nerr and _sys_nerr.
> 
> So, what's the right way to do this? Use POSIX mandated strerror ()
> and forget avoid non-standard stuff. Or, since I have code dating
> back many many years, write a port library that implements sys_nerr
> and sys_errlist for platforms that don't have it.
> 
> Regards,
> Mumit
> 
> 
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
> 

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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