delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/03/27/09:30:50

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: <3AC09B3E.DA198728@certum.pl>
Date: Tue, 27 Mar 2001 15:53:02 +0200
From: Jacek Trzcinski <jacek AT certum DOT pl>
Reply-To: jacek AT certum DOT pl
X-Mailer: Mozilla 4.7 [en] (WinNT; U)
X-Accept-Language: en,pdf
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: tcp_wrappers

Hi !
I decided to create tcp_wrappers module (which contains very usefull
tcpd daemon) getting sources from Read Hat 6.2. I did it and it work
but...
Creation required doing changes in one module which reports some errors
changing numbers for strings.
To do this it utilizes system constants-variables "extern int sys_nerr"
and 
"extern char *sys_errlist[]". Unfortunately, I was not able to create
library
libwrap.a and further tcpd.exe beacuse it could not see mentioned
variables during compilation and consolidation. When I did following
changes:


<<

this was:

#ifndef SYS_ERRLIST_DEFINED
extern char *sys_errlist[];
extern int  sys_nerr;
#endif


I changed it to :

//#ifndef SYS_ERRLIST_DEFINED
extern __IMPORT char *sys_errlist[];
extern __IMPORT int _sys_nerr;
//#endif


Relation to this variables in module I had to change of course too:


this was:

if (errno < sys_nerr && errno > 0) 
{
strcpy(bp, sys_errlist[errno]);
} else 
{ 
sprintf(bp, "Unknown error %d", errno);
}


I had to change to:

if (errno < _sys_nerr && errno > 0) 
{
strcpy(bp, _sys_errlist[errno]);
} else 
{ 
sprintf(bp, "Unknown error %d", errno);
}

In makefile I had to add library libcygwin.a to consolidation process.

>>

everything went OK.


Does anybody know it can be made simpler ( with minimal changes). It
seems to be typical names problem. This changes I made looking at
libcygwin.a
and watching what are correct names of needed variables.

Jacek

--
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