Posted by
| Nick Gammon
Australia (22,980 posts) bio
Forum Administrator |
Message
| Right, your major problems are the following 3 things:
comm.c:47:48: execinfo.h: No such file or directory
comm.c: In function `lookup_address':
comm.c:1140: warning: implicit declaration of function `gethostbyaddr_r'
comm.c: In function `iBacktrace':
comm.c:1553: warning: implicit declaration of function `backtrace'
comm.c:1555: warning: implicit declaration of function `backtrace_symbols'
If we look in comm.c we see that execinfo.h is included near the start:
#include <execinfo.h> // internal backtraces.
This gives us a hint about the third error (the backtrace one) because without the header file it probably won't recognise things in it.
I commented that line out.
Next, I see there are problems in iBacktrace, however I notice that further up the call to iBacktrace is commented out:
/* signal(SIGSEGV, iBacktrace); */
If we are not calling it, we hardly need the function itself, so you could remove it or comment it out. Here is one way of doing that ...
#if 0
/*
* To do internal backtracs at crashes
*/
void iBacktrace(int iSignal)
{
... blah blah blah ...
}
#endif
The final problem is the gethostbyaddr_r one. I see from my Linux header file the following comments:
/* Reentrant versions of the functions above. The additional
arguments specify a buffer of BUFLEN starting at BUF. The last
argument is a pointer to a variable which gets the value which
would be stored in the global variable `herrno' by the
non-reentrant functions. */
extern int gethostent_r (struct hostent *__restrict __result_buf,
char *__restrict __buf, size_t __buflen,
struct hostent **__restrict __result,
int *__restrict __h_errnop) __THROW;
extern int gethostbyaddr_r (__const void *__restrict __addr, __socklen_t __len,
int __type,
struct hostent *__restrict __result_buf,
char *__restrict __buf, size_t __buflen,
struct hostent **__restrict __result,
int *__restrict __h_errnop) __THROW;
I'm not sure you really need the re-entrant call to gethostbyaddr so let's change it to the non-re-entrant one and try that ...
struct hostent *from = 0;
// struct hostent ent;
// char buf[16384]; // enough ??
// int err;
thread_count++;
// gethostbyaddr_r( darg->buf, sizeof(darg->buf), AF_INET, &ent, buf, 16384, &from, &err);
gethostbyaddr( darg->buf, sizeof(darg->buf), AF_INET);
That compiled OK - I didn't actually run it.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|