Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
Message-ID: <3AC09B3E.DA198728@certum.pl>
Date: Tue, 27 Mar 2001 15:53:02 +0200
From: Jacek Trzcinski <jacek@certum.pl>
Reply-To: jacek@certum.pl
X-Mailer: Mozilla 4.7 [en] (WinNT; U)
X-Accept-Language: en,pdf
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: tcp_wrappers
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

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

