This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]