mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
Compatibility improvements for QNX.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35451 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
868d8a6922
commit
ee4052bf6d
13 changed files with 3066 additions and 2272 deletions
21
ChangeLog
21
ChangeLog
|
@ -1,3 +1,24 @@
|
||||||
|
2012-08-26 Niels Grewe <niels.grewe@halbordnung.de>
|
||||||
|
|
||||||
|
* configure.ac: Check for sys/filio.h and whether we need to
|
||||||
|
link libsocket (as on QNX).
|
||||||
|
* configure
|
||||||
|
* SSL/configure
|
||||||
|
* Headers/GNUstepBase/config.h.in:
|
||||||
|
Regenerate.
|
||||||
|
* Source/common.h
|
||||||
|
* Source/GSFileHandle.m
|
||||||
|
* Source/NSMessagePort.m
|
||||||
|
* Source/NSSocketPort.m
|
||||||
|
* Source/NSThread.m
|
||||||
|
* SSL/GSSSLHandle.m:
|
||||||
|
QNX compatibility tweaks.
|
||||||
|
* Tools/gdnc.m
|
||||||
|
* Tools/gdomap.c:
|
||||||
|
Use slog facility for logging on QNX.
|
||||||
|
|
||||||
|
Compatibility improvements for building for QNX.
|
||||||
|
|
||||||
2012-08-26 Niels Grewe <niels.grewe@halbordnung.de>
|
2012-08-26 Niels Grewe <niels.grewe@halbordnung.de>
|
||||||
|
|
||||||
* configure.ac: Check for QNX slog facilities.
|
* configure.ac: Check for QNX slog facilities.
|
||||||
|
|
|
@ -247,6 +247,9 @@
|
||||||
/* Define to 1 if you have the `gethostbyaddr_r' function. */
|
/* Define to 1 if you have the `gethostbyaddr_r' function. */
|
||||||
#undef HAVE_GETHOSTBYADDR_R
|
#undef HAVE_GETHOSTBYADDR_R
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `gethostbyname' function. */
|
||||||
|
#undef HAVE_GETHOSTBYNAME
|
||||||
|
|
||||||
/* Define to 1 if you have the `getlogin' function. */
|
/* Define to 1 if you have the `getlogin' function. */
|
||||||
#undef HAVE_GETLOGIN
|
#undef HAVE_GETLOGIN
|
||||||
|
|
||||||
|
@ -337,6 +340,9 @@
|
||||||
/* Define to 1 if you have the `rt' library (-lrt). */
|
/* Define to 1 if you have the `rt' library (-lrt). */
|
||||||
#undef HAVE_LIBRT
|
#undef HAVE_LIBRT
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `socket' library (-lsocket). */
|
||||||
|
#undef HAVE_LIBSOCKET
|
||||||
|
|
||||||
/* Define if libxml available */
|
/* Define if libxml available */
|
||||||
#undef HAVE_LIBXML
|
#undef HAVE_LIBXML
|
||||||
|
|
||||||
|
@ -539,6 +545,9 @@
|
||||||
/* Define to 1 if you have the <sys/file.h> header file. */
|
/* Define to 1 if you have the <sys/file.h> header file. */
|
||||||
#undef HAVE_SYS_FILE_H
|
#undef HAVE_SYS_FILE_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/filio.h> header file. */
|
||||||
|
#undef HAVE_SYS_FILIO_H
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/inttypes.h> header file. */
|
/* Define to 1 if you have the <sys/inttypes.h> header file. */
|
||||||
#undef HAVE_SYS_INTTYPES_H
|
#undef HAVE_SYS_INTTYPES_H
|
||||||
|
|
||||||
|
|
|
@ -95,8 +95,10 @@
|
||||||
|
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#ifdef __svr4__
|
#ifdef __svr4__
|
||||||
|
#ifdef HAVE_SYS_FILIO_H
|
||||||
#include <sys/filio.h>
|
#include <sys/filio.h>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
@ -130,30 +132,30 @@ sslError(int err)
|
||||||
static NSLock **locks = 0;
|
static NSLock **locks = 0;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
locking_function(int mode, int n, const char *file, int line)
|
locking_function(int mode, int n, const char *file, int line)
|
||||||
{
|
{
|
||||||
if (mode & CRYPTO_LOCK)
|
if (mode & CRYPTO_LOCK)
|
||||||
{
|
{
|
||||||
[locks[n] lock];
|
[locks[n] lock];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
[locks[n] unlock];
|
[locks[n] unlock];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HAVE_CRYPTO_THREADID_SET_CALLBACK)
|
#if defined(HAVE_CRYPTO_THREADID_SET_CALLBACK)
|
||||||
static void
|
static void
|
||||||
threadid_function(CRYPTO_THREADID *ref)
|
threadid_function(CRYPTO_THREADID *ref)
|
||||||
{
|
{
|
||||||
CRYPTO_THREADID_set_pointer(ref, GSCurrentThread());
|
CRYPTO_THREADID_set_pointer(ref, GSCurrentThread());
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
static unsigned long
|
static unsigned long
|
||||||
threadid_function()
|
threadid_function()
|
||||||
{
|
{
|
||||||
return (unsigned long) GSCurrentThread();
|
return (unsigned long) GSCurrentThread();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -200,11 +202,11 @@ static NSString *cipherList = nil;
|
||||||
{
|
{
|
||||||
locks[count] = [NSLock new];
|
locks[count] = [NSLock new];
|
||||||
}
|
}
|
||||||
CRYPTO_set_locking_callback(locking_function);
|
CRYPTO_set_locking_callback(locking_function);
|
||||||
#if defined(HAVE_CRYPTO_THREADID_SET_CALLBACK)
|
#if defined(HAVE_CRYPTO_THREADID_SET_CALLBACK)
|
||||||
CRYPTO_THREADID_set_callback(threadid_function);
|
CRYPTO_THREADID_set_callback(threadid_function);
|
||||||
#else
|
#else
|
||||||
CRYPTO_set_id_callback(threadid_function);
|
CRYPTO_set_id_callback(threadid_function);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
4939
SSL/configure
vendored
4939
SSL/configure
vendored
File diff suppressed because it is too large
Load diff
|
@ -66,7 +66,9 @@
|
||||||
|
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#ifdef __svr4__
|
#ifdef __svr4__
|
||||||
#include <sys/filio.h>
|
# ifdef HAVE_SYS_FILIO_H
|
||||||
|
# include <sys/filio.h>
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
|
|
||||||
|
@ -75,7 +77,7 @@
|
||||||
/*
|
/*
|
||||||
* Stuff for setting the sockets into non-blocking mode.
|
* Stuff for setting the sockets into non-blocking mode.
|
||||||
*/
|
*/
|
||||||
#ifdef __POSIX_SOURCE
|
#if defined(__POSIX_SOURCE) || defined(__EXT_POSIX1_198808)
|
||||||
#define NBLK_OPT O_NONBLOCK
|
#define NBLK_OPT O_NONBLOCK
|
||||||
#else
|
#else
|
||||||
#define NBLK_OPT FNDELAY
|
#define NBLK_OPT FNDELAY
|
||||||
|
@ -773,7 +775,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
info = [[NSMutableDictionary alloc] initWithCapacity: 4];
|
info = [[NSMutableDictionary alloc] initWithCapacity: 4];
|
||||||
[info setObject: address forKey: NSFileHandleNotificationDataItem];
|
[info setObject: address forKey: NSFileHandleNotificationDataItem];
|
||||||
if (shost == nil)
|
if (shost == nil)
|
||||||
|
|
|
@ -77,7 +77,7 @@
|
||||||
/*
|
/*
|
||||||
* Stuff for setting the sockets into non-blocking mode.
|
* Stuff for setting the sockets into non-blocking mode.
|
||||||
*/
|
*/
|
||||||
#ifdef __POSIX_SOURCE
|
#if defined(__POSIX_SOURCE) || defined(__EXT_POSIX1_198808)
|
||||||
#define NBLK_OPT O_NONBLOCK
|
#define NBLK_OPT O_NONBLOCK
|
||||||
#else
|
#else
|
||||||
#define NBLK_OPT FNDELAY
|
#define NBLK_OPT FNDELAY
|
||||||
|
@ -93,7 +93,9 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__svr4__)
|
#if defined(__svr4__)
|
||||||
#include <sys/stropts.h>
|
# if defined(HAVE_SYS_STROPTS)
|
||||||
|
# include <sys/stropts.h>
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@interface NSProcessInfo (private)
|
@interface NSProcessInfo (private)
|
||||||
|
|
|
@ -84,7 +84,7 @@
|
||||||
/*
|
/*
|
||||||
* Stuff for setting the sockets into non-blocking mode.
|
* Stuff for setting the sockets into non-blocking mode.
|
||||||
*/
|
*/
|
||||||
#ifdef __POSIX_SOURCE
|
#if defined(__POSIX_SOURCE) || defined(__EXT_POSIX1_198808)
|
||||||
#define NBLK_OPT O_NONBLOCK
|
#define NBLK_OPT O_NONBLOCK
|
||||||
#else
|
#else
|
||||||
#define NBLK_OPT FNDELAY
|
#define NBLK_OPT FNDELAY
|
||||||
|
@ -100,7 +100,9 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__svr4__)
|
#if defined(__svr4__)
|
||||||
#include <sys/stropts.h>
|
# if defined(HAVE_SYS_STROPTS_H)
|
||||||
|
# include <sys/stropts.h>
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define SOCKET int
|
#define SOCKET int
|
||||||
|
@ -429,7 +431,7 @@ static Class runLoopClass;
|
||||||
}
|
}
|
||||||
rc = WSAEventSelect(handle->desc, ev, FD_ALL_EVENTS);
|
rc = WSAEventSelect(handle->desc, ev, FD_ALL_EVENTS);
|
||||||
NSAssert(rc == 0, @"WSAEventSelect failed!");
|
NSAssert(rc == 0, @"WSAEventSelect failed!");
|
||||||
|
|
||||||
handle->event = ev;
|
handle->event = ev;
|
||||||
handle->inReplyMode = NO;
|
handle->inReplyMode = NO;
|
||||||
handle->readyToSend = YES;
|
handle->readyToSend = YES;
|
||||||
|
@ -1131,7 +1133,7 @@ static Class runLoopClass;
|
||||||
int res;
|
int res;
|
||||||
unsigned l;
|
unsigned l;
|
||||||
const void *b;
|
const void *b;
|
||||||
|
|
||||||
if (wData == nil)
|
if (wData == nil)
|
||||||
{
|
{
|
||||||
if ([wMsgs count] > 0)
|
if ([wMsgs count] > 0)
|
||||||
|
@ -1310,7 +1312,7 @@ static Class runLoopClass;
|
||||||
if (ocurredEvents.lNetworkEvents)
|
if (ocurredEvents.lNetworkEvents)
|
||||||
{
|
{
|
||||||
NSLog(@"Event not get %d", ocurredEvents.lNetworkEvents);
|
NSLog(@"Event not get %d", ocurredEvents.lNetworkEvents);
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (type != ET_WDESC)
|
if (type != ET_WDESC)
|
||||||
|
@ -1388,7 +1390,7 @@ static Class runLoopClass;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
[l runMode: NSConnectionReplyMode beforeDate: when];
|
[l runMode: NSConnectionReplyMode beforeDate: when];
|
||||||
#endif
|
#endif
|
||||||
M_LOCK(myLock);
|
M_LOCK(myLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1660,7 +1662,7 @@ static Class tcpPortClass;
|
||||||
* we did the 'bind' call.
|
* we did the 'bind' call.
|
||||||
*/
|
*/
|
||||||
port->listener = desc;
|
port->listener = desc;
|
||||||
port->portNum = GSPrivateSockaddrPort(&sockaddr);
|
port->portNum = GSPrivateSockaddrPort(&sockaddr);
|
||||||
#if defined(__MINGW__)
|
#if defined(__MINGW__)
|
||||||
port->eventListener = (WSAEVENT)CreateEvent(NULL,NO,NO,NULL);
|
port->eventListener = (WSAEVENT)CreateEvent(NULL,NO,NO,NULL);
|
||||||
if (port->eventListener == WSA_INVALID_EVENT)
|
if (port->eventListener == WSA_INVALID_EVENT)
|
||||||
|
@ -1833,7 +1835,7 @@ static Class tcpPortClass;
|
||||||
recvSelf = GS_GC_HIDE(self);
|
recvSelf = GS_GC_HIDE(self);
|
||||||
me = NSEnumerateMapTable(events);
|
me = NSEnumerateMapTable(events);
|
||||||
while (NSNextMapEnumeratorPair(&me, &event, (void**)&fd))
|
while (NSNextMapEnumeratorPair(&me, &event, (void**)&fd))
|
||||||
{
|
{
|
||||||
handle = (GSTcpHandle*)NSMapGet(handles, (void*)(uintptr_t)fd);
|
handle = (GSTcpHandle*)NSMapGet(handles, (void*)(uintptr_t)fd);
|
||||||
if (handle->recvPort == recvSelf
|
if (handle->recvPort == recvSelf
|
||||||
&& handle->inReplyMode == NO
|
&& handle->inReplyMode == NO
|
||||||
|
@ -2053,7 +2055,7 @@ static Class tcpPortClass;
|
||||||
listener = -1;
|
listener = -1;
|
||||||
#if defined(__MINGW__)
|
#if defined(__MINGW__)
|
||||||
WSACloseEvent(eventListener);
|
WSACloseEvent(eventListener);
|
||||||
eventListener = WSA_INVALID_EVENT;
|
eventListener = WSA_INVALID_EVENT;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
# include <fcntl.h>
|
# include <fcntl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __POSIX_SOURCE
|
#if defined(__POSIX_SOURCE) || defined(__EXT_POSIX1_198808)
|
||||||
#define NBLK_OPT O_NONBLOCK
|
#define NBLK_OPT O_NONBLOCK
|
||||||
#else
|
#else
|
||||||
#define NBLK_OPT FNDELAY
|
#define NBLK_OPT FNDELAY
|
||||||
|
@ -462,7 +462,7 @@ unregisterActiveThread(NSThread *thread)
|
||||||
|
|
||||||
[(GSRunLoopThreadInfo*)thread->_runLoopInfo invalidate];
|
[(GSRunLoopThreadInfo*)thread->_runLoopInfo invalidate];
|
||||||
[thread release];
|
[thread release];
|
||||||
|
|
||||||
[[NSGarbageCollector defaultCollector] enableCollectorForPointer: thread];
|
[[NSGarbageCollector defaultCollector] enableCollectorForPointer: thread];
|
||||||
pthread_setspecific(thread_object_key, nil);
|
pthread_setspecific(thread_object_key, nil);
|
||||||
}
|
}
|
||||||
|
@ -574,7 +574,7 @@ unregisterActiveThread(NSThread *thread)
|
||||||
/**
|
/**
|
||||||
* Set the priority of the current thread. This is a value in the
|
* Set the priority of the current thread. This is a value in the
|
||||||
* range 0.0 (lowest) to 1.0 (highest) which is mapped to the underlying
|
* range 0.0 (lowest) to 1.0 (highest) which is mapped to the underlying
|
||||||
* system priorities.
|
* system priorities.
|
||||||
*/
|
*/
|
||||||
+ (void) setThreadPriority: (double)pri
|
+ (void) setThreadPriority: (double)pri
|
||||||
{
|
{
|
||||||
|
@ -980,7 +980,7 @@ static void *nsthreadLauncher(void* thread)
|
||||||
[NSException raise: NSInternalInconsistencyException
|
[NSException raise: NSInternalInconsistencyException
|
||||||
format: @"Failed to create pipe to handle perform in thread"];
|
format: @"Failed to create pipe to handle perform in thread"];
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
lock = [NSLock new];
|
lock = [NSLock new];
|
||||||
performers = [NSMutableArray new];
|
performers = [NSMutableArray new];
|
||||||
return self;
|
return self;
|
||||||
|
|
|
@ -17,15 +17,15 @@
|
||||||
*/
|
*/
|
||||||
/* This hack work around for glibc breaks FreeBSD and probably other platforms.
|
/* This hack work around for glibc breaks FreeBSD and probably other platforms.
|
||||||
*/
|
*/
|
||||||
#if defined(__linux__) &&!defined(__GNU__)
|
#if (defined(__linux__) &&!defined(__GNU__)) || defined(__QNXNTO__)
|
||||||
#if defined(_XOPEN_SOURCE)
|
# if defined(_XOPEN_SOURCE)
|
||||||
#if _XOPEN_SOURCE < 600
|
# if _XOPEN_SOURCE < 600
|
||||||
#undef _XOPEN_SOURCE
|
# undef _XOPEN_SOURCE
|
||||||
#define _XOPEN_SOURCE 600
|
# define _XOPEN_SOURCE 600
|
||||||
#endif
|
# endif
|
||||||
#else
|
# else
|
||||||
#define _XOPEN_SOURCE 600
|
# define _XOPEN_SOURCE 600
|
||||||
#endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#import "config.h"
|
#import "config.h"
|
||||||
|
|
21
Tools/gdnc.m
21
Tools/gdnc.m
|
@ -69,8 +69,17 @@ static BOOL debugging = NO;
|
||||||
static BOOL is_daemon = NO; /* Currently running as daemon. */
|
static BOOL is_daemon = NO; /* Currently running as daemon. */
|
||||||
static BOOL auto_stop = NO; /* Should we shut down when unused? */
|
static BOOL auto_stop = NO; /* Should we shut down when unused? */
|
||||||
|
|
||||||
#ifdef HAVE_SYSLOG
|
#if defined(HAVE_SYSLOG) || defined(HAVE_SLOGF)
|
||||||
|
# if defined(HAVE_SLOGF)
|
||||||
|
# include <sys/slogcodes.h>
|
||||||
|
# include <sys/slog.h>
|
||||||
|
# define LOG_CRIT _SLOG_CRITICAL
|
||||||
|
# define LOG_DEBUG _SLOG_DEBUG1
|
||||||
|
# define LOG_ERR _SLOG_ERROR
|
||||||
|
# define LOG_INFO _SLOG_INFO
|
||||||
|
# define LOG_WARNING _SLOG_WARNING
|
||||||
|
# define syslog(prio, msg,...) slogf(_SLOG_SETCODE(_SLOG_SYSLOG, 0), prio, msg, __VA_ARGS__)
|
||||||
|
# endif
|
||||||
static int log_priority = LOG_DEBUG;
|
static int log_priority = LOG_DEBUG;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -78,7 +87,12 @@ gdnc_log (int prio, const char *ebuf)
|
||||||
{
|
{
|
||||||
if (is_daemon)
|
if (is_daemon)
|
||||||
{
|
{
|
||||||
|
# if defined(HAVE_SLOGF)
|
||||||
|
// Let's not have 0 as the value for prio. It means "shutdown" on QNX
|
||||||
|
syslog (prio ? prio : log_priority, "%s", ebuf);
|
||||||
|
# else
|
||||||
syslog (log_priority | prio, "%s", ebuf);
|
syslog (log_priority | prio, "%s", ebuf);
|
||||||
|
# endif
|
||||||
}
|
}
|
||||||
else if (prio == LOG_INFO)
|
else if (prio == LOG_INFO)
|
||||||
{
|
{
|
||||||
|
@ -95,7 +109,7 @@ gdnc_log (int prio, const char *ebuf)
|
||||||
{
|
{
|
||||||
if (is_daemon)
|
if (is_daemon)
|
||||||
{
|
{
|
||||||
syslog (LOG_CRIT, "exiting.");
|
syslog (LOG_CRIT, "%s", "exiting.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -105,6 +119,7 @@ gdnc_log (int prio, const char *ebuf)
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#define LOG_CRIT 2
|
#define LOG_CRIT 2
|
||||||
|
|
|
@ -79,7 +79,7 @@
|
||||||
/*
|
/*
|
||||||
* Stuff for setting the sockets into non-blocking mode.
|
* Stuff for setting the sockets into non-blocking mode.
|
||||||
*/
|
*/
|
||||||
#if defined(__POSIX_SOURCE)
|
#if defined(__POSIX_SOURCE) || defined(__EXT_POSIX1_198808)
|
||||||
#define NBLK_OPT O_NONBLOCK
|
#define NBLK_OPT O_NONBLOCK
|
||||||
#else
|
#else
|
||||||
#define NBLK_OPT FNDELAY
|
#define NBLK_OPT FNDELAY
|
||||||
|
@ -95,13 +95,20 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__svr4__)
|
#if defined(__svr4__)
|
||||||
|
#if defined(HAVE_SYS_STROPTS_H)
|
||||||
#include <sys/stropts.h>
|
#include <sys/stropts.h>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
#endif /* !__MINGW__ */
|
#endif /* !__MINGW__ */
|
||||||
|
|
||||||
|
|
||||||
#if defined(HAVE_SYSLOG_H)
|
#if defined(HAVE_SYSLOG_H)
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
|
#elif defined(HAVE_SYS_SLOG_H)
|
||||||
|
# include <sys/slog.h>
|
||||||
|
# if defined(HAVE_SYS_SLOGCODES_H)
|
||||||
|
# include <sys/slogcodes.h>
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_STRERROR
|
#if HAVE_STRERROR
|
||||||
|
@ -277,7 +284,15 @@ getopt(int argc, char **argv, char *options)
|
||||||
static char ebuf[2048];
|
static char ebuf[2048];
|
||||||
|
|
||||||
|
|
||||||
#if defined(HAVE_SYSLOG)
|
#if defined(HAVE_SYSLOG) || defined(HAVE_SLOGF)
|
||||||
|
# if defined(HAVE_SLOGF)
|
||||||
|
# define LOG_CRIT _SLOG_CRITICAL
|
||||||
|
# define LOG_DEBUG _SLOG_DEBUG1
|
||||||
|
# define LOG_ERR _SLOG_ERROR
|
||||||
|
# define LOG_INFO _SLOG_INFO
|
||||||
|
# define LOG_WARNING _SLOG_WARNING
|
||||||
|
# define syslog(prio, msg,...) slogf(_SLOG_SETCODE(_SLOG_SYSLOG, 0), prio, msg, __VA_ARGS__)
|
||||||
|
# endif
|
||||||
|
|
||||||
static int log_priority;
|
static int log_priority;
|
||||||
|
|
||||||
|
@ -295,7 +310,12 @@ gdomap_log (int prio)
|
||||||
}
|
}
|
||||||
if (is_daemon)
|
if (is_daemon)
|
||||||
{
|
{
|
||||||
|
#if defined(HAVE_SLOGF)
|
||||||
|
// QNX doesn't like 0 as the prio. It means "shutdown" to them.
|
||||||
|
syslog (prio ? log_priority : prio, "%s", ebuf);
|
||||||
|
# else
|
||||||
syslog (log_priority | prio, "%s", ebuf);
|
syslog (log_priority | prio, "%s", ebuf);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else if (prio == LOG_INFO)
|
else if (prio == LOG_INFO)
|
||||||
{
|
{
|
||||||
|
@ -312,7 +332,7 @@ gdomap_log (int prio)
|
||||||
{
|
{
|
||||||
if (is_daemon)
|
if (is_daemon)
|
||||||
{
|
{
|
||||||
syslog (LOG_CRIT, "exiting.");
|
syslog (LOG_CRIT, "%s", "exiting.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1254,7 +1274,8 @@ init_iface()
|
||||||
perror("socket for init_iface");
|
perror("socket for init_iface");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
#if defined(__svr4__)
|
// QNX seems to disagree about what it means to be SysV r4.
|
||||||
|
#if defined(__svr4__) && !defined(__QNXNTO__)
|
||||||
{
|
{
|
||||||
struct strioctl ioc;
|
struct strioctl ioc;
|
||||||
|
|
||||||
|
@ -1320,7 +1341,7 @@ init_iface()
|
||||||
{
|
{
|
||||||
ifreq = *(struct ifreq*)ifr_ptr;
|
ifreq = *(struct ifreq*)ifr_ptr;
|
||||||
#if defined(HAVE_SA_LEN)
|
#if defined(HAVE_SA_LEN)
|
||||||
ifr_ptr += sizeof(ifreq) - sizeof(ifreq.ifr_addr)
|
ifr_ptr += sizeof(ifreq) - sizeof(ifreq.ifr_addr)
|
||||||
+ ROUND(ifreq.ifr_addr.sa_len, sizeof(struct ifreq*));
|
+ ROUND(ifreq.ifr_addr.sa_len, sizeof(struct ifreq*));
|
||||||
#else
|
#else
|
||||||
ifr_ptr += sizeof(ifreq);
|
ifr_ptr += sizeof(ifreq);
|
||||||
|
@ -3296,7 +3317,7 @@ handle_send()
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
r = sendto(udp_desc, (const char *)&entry->dat[entry->pos],
|
r = sendto(udp_desc, (const char *)&entry->dat[entry->pos],
|
||||||
entry->len - entry->pos, 0, (void*)&entry->addr, sizeof(entry->addr));
|
entry->len - entry->pos, 0, (void*)&entry->addr, sizeof(entry->addr));
|
||||||
/*
|
/*
|
||||||
* 'r' is the number of bytes sent. This should be the number
|
* 'r' is the number of bytes sent. This should be the number
|
||||||
|
@ -3956,7 +3977,7 @@ nameServer(const char* name, const char* host, int op, int ptype, struct sockadd
|
||||||
if (multi || host == 0 || *host == '\0')
|
if (multi || host == 0 || *host == '\0')
|
||||||
{
|
{
|
||||||
local_hostname = xgethostname();
|
local_hostname = xgethostname();
|
||||||
if (!local_hostname)
|
if (!local_hostname)
|
||||||
{
|
{
|
||||||
snprintf(ebuf, sizeof(ebuf),
|
snprintf(ebuf, sizeof(ebuf),
|
||||||
"gethostname() failed: %s", strerror(errno));
|
"gethostname() failed: %s", strerror(errno));
|
||||||
|
@ -4156,7 +4177,7 @@ donames(const char *host)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
local_hostname = xgethostname();
|
local_hostname = xgethostname();
|
||||||
if (!local_hostname)
|
if (!local_hostname)
|
||||||
{
|
{
|
||||||
snprintf(ebuf, sizeof(ebuf),
|
snprintf(ebuf, sizeof(ebuf),
|
||||||
"gethostname() failed: %s", strerror(errno));
|
"gethostname() failed: %s", strerror(errno));
|
||||||
|
@ -4291,7 +4312,7 @@ static void do_help(int argc, char **argv, char *options)
|
||||||
}
|
}
|
||||||
if (i == argc)
|
if (i == argc)
|
||||||
{
|
{
|
||||||
return; // --help not found ...
|
return; // --help not found ...
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf("%s -[%s]\n", argv[0], options);
|
printf("%s -[%s]\n", argv[0], options);
|
||||||
|
@ -4428,7 +4449,7 @@ main(int argc, char** argv)
|
||||||
#if defined(SYSLOG_4_2)
|
#if defined(SYSLOG_4_2)
|
||||||
openlog ("gdomap", LOG_NDELAY);
|
openlog ("gdomap", LOG_NDELAY);
|
||||||
log_priority = LOG_DAEMON;
|
log_priority = LOG_DAEMON;
|
||||||
#else
|
#elif !defined(HAVE_SLOGF)
|
||||||
openlog ("gdomap", LOG_NDELAY, LOG_DAEMON);
|
openlog ("gdomap", LOG_NDELAY, LOG_DAEMON);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -5082,7 +5103,7 @@ queue_probe(struct in_addr* to, struct in_addr* from, int l, struct in_addr* e,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Copyright (c) 2001 Neal H Walfield <neal@cs.uml.edu>.
|
/* Copyright (c) 2001 Neal H Walfield <neal@cs.uml.edu>.
|
||||||
|
|
||||||
This file is placed into the public domain. Its distribution
|
This file is placed into the public domain. Its distribution
|
||||||
is unlimited.
|
is unlimited.
|
||||||
|
|
||||||
|
@ -5165,7 +5186,7 @@ xgethostname (void)
|
||||||
errno = ENOMEM;
|
errno = ENOMEM;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = gethostname (buf, size);
|
err = gethostname (buf, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
204
configure
vendored
204
configure
vendored
|
@ -11968,6 +11968,207 @@ fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
for ac_func in gethostbyname
|
||||||
|
do
|
||||||
|
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
|
||||||
|
{ echo "$as_me:$LINENO: checking for $ac_func" >&5
|
||||||
|
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
|
||||||
|
if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
|
||||||
|
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||||
|
else
|
||||||
|
cat >conftest.$ac_ext <<_ACEOF
|
||||||
|
/* confdefs.h. */
|
||||||
|
_ACEOF
|
||||||
|
cat confdefs.h >>conftest.$ac_ext
|
||||||
|
cat >>conftest.$ac_ext <<_ACEOF
|
||||||
|
/* end confdefs.h. */
|
||||||
|
/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
|
||||||
|
For example, HP-UX 11i <limits.h> declares gettimeofday. */
|
||||||
|
#define $ac_func innocuous_$ac_func
|
||||||
|
|
||||||
|
/* System header to define __stub macros and hopefully few prototypes,
|
||||||
|
which can conflict with char $ac_func (); below.
|
||||||
|
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
|
||||||
|
<limits.h> exists even on freestanding compilers. */
|
||||||
|
|
||||||
|
#ifdef __STDC__
|
||||||
|
# include <limits.h>
|
||||||
|
#else
|
||||||
|
# include <assert.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#undef $ac_func
|
||||||
|
|
||||||
|
/* Override any GCC internal prototype to avoid an error.
|
||||||
|
Use char because int might match the return type of a GCC
|
||||||
|
builtin and then its argument prototype would still apply. */
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C"
|
||||||
|
#endif
|
||||||
|
char $ac_func ();
|
||||||
|
/* The GNU C library defines this for functions which it implements
|
||||||
|
to always fail with ENOSYS. Some functions are actually named
|
||||||
|
something starting with __ and the normal name is an alias. */
|
||||||
|
#if defined __stub_$ac_func || defined __stub___$ac_func
|
||||||
|
choke me
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
return $ac_func ();
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_ACEOF
|
||||||
|
rm -f conftest.$ac_objext conftest$ac_exeext
|
||||||
|
if { (ac_try="$ac_link"
|
||||||
|
case "(($ac_try" in
|
||||||
|
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||||
|
*) ac_try_echo=$ac_try;;
|
||||||
|
esac
|
||||||
|
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||||
|
(eval "$ac_link") 2>conftest.er1
|
||||||
|
ac_status=$?
|
||||||
|
grep -v '^ *+' conftest.er1 >conftest.err
|
||||||
|
rm -f conftest.er1
|
||||||
|
cat conftest.err >&5
|
||||||
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||||
|
(exit $ac_status); } &&
|
||||||
|
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
|
||||||
|
{ (case "(($ac_try" in
|
||||||
|
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||||
|
*) ac_try_echo=$ac_try;;
|
||||||
|
esac
|
||||||
|
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||||
|
(eval "$ac_try") 2>&5
|
||||||
|
ac_status=$?
|
||||||
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||||
|
(exit $ac_status); }; } &&
|
||||||
|
{ ac_try='test -s conftest$ac_exeext'
|
||||||
|
{ (case "(($ac_try" in
|
||||||
|
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||||
|
*) ac_try_echo=$ac_try;;
|
||||||
|
esac
|
||||||
|
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||||
|
(eval "$ac_try") 2>&5
|
||||||
|
ac_status=$?
|
||||||
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||||
|
(exit $ac_status); }; }; then
|
||||||
|
eval "$as_ac_var=yes"
|
||||||
|
else
|
||||||
|
echo "$as_me: failed program was:" >&5
|
||||||
|
sed 's/^/| /' conftest.$ac_ext >&5
|
||||||
|
|
||||||
|
eval "$as_ac_var=no"
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -f core conftest.err conftest.$ac_objext \
|
||||||
|
conftest$ac_exeext conftest.$ac_ext
|
||||||
|
fi
|
||||||
|
ac_res=`eval echo '${'$as_ac_var'}'`
|
||||||
|
{ echo "$as_me:$LINENO: result: $ac_res" >&5
|
||||||
|
echo "${ECHO_T}$ac_res" >&6; }
|
||||||
|
if test `eval echo '${'$as_ac_var'}'` = yes; then
|
||||||
|
cat >>confdefs.h <<_ACEOF
|
||||||
|
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if test "$ac_cv_func_gethostbyname" = "no"; then
|
||||||
|
# QNX has gethostbyname and friends in libsocket
|
||||||
|
|
||||||
|
{ echo "$as_me:$LINENO: checking for gethostbyname in -lsocket" >&5
|
||||||
|
echo $ECHO_N "checking for gethostbyname in -lsocket... $ECHO_C" >&6; }
|
||||||
|
if test "${ac_cv_lib_socket_gethostbyname+set}" = set; then
|
||||||
|
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||||
|
else
|
||||||
|
ac_check_lib_save_LIBS=$LIBS
|
||||||
|
LIBS="-lsocket $LIBS"
|
||||||
|
cat >conftest.$ac_ext <<_ACEOF
|
||||||
|
/* confdefs.h. */
|
||||||
|
_ACEOF
|
||||||
|
cat confdefs.h >>conftest.$ac_ext
|
||||||
|
cat >>conftest.$ac_ext <<_ACEOF
|
||||||
|
/* end confdefs.h. */
|
||||||
|
|
||||||
|
/* Override any GCC internal prototype to avoid an error.
|
||||||
|
Use char because int might match the return type of a GCC
|
||||||
|
builtin and then its argument prototype would still apply. */
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C"
|
||||||
|
#endif
|
||||||
|
char gethostbyname ();
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
return gethostbyname ();
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_ACEOF
|
||||||
|
rm -f conftest.$ac_objext conftest$ac_exeext
|
||||||
|
if { (ac_try="$ac_link"
|
||||||
|
case "(($ac_try" in
|
||||||
|
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||||
|
*) ac_try_echo=$ac_try;;
|
||||||
|
esac
|
||||||
|
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||||
|
(eval "$ac_link") 2>conftest.er1
|
||||||
|
ac_status=$?
|
||||||
|
grep -v '^ *+' conftest.er1 >conftest.err
|
||||||
|
rm -f conftest.er1
|
||||||
|
cat conftest.err >&5
|
||||||
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||||
|
(exit $ac_status); } &&
|
||||||
|
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
|
||||||
|
{ (case "(($ac_try" in
|
||||||
|
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||||
|
*) ac_try_echo=$ac_try;;
|
||||||
|
esac
|
||||||
|
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||||
|
(eval "$ac_try") 2>&5
|
||||||
|
ac_status=$?
|
||||||
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||||
|
(exit $ac_status); }; } &&
|
||||||
|
{ ac_try='test -s conftest$ac_exeext'
|
||||||
|
{ (case "(($ac_try" in
|
||||||
|
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||||
|
*) ac_try_echo=$ac_try;;
|
||||||
|
esac
|
||||||
|
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||||
|
(eval "$ac_try") 2>&5
|
||||||
|
ac_status=$?
|
||||||
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||||
|
(exit $ac_status); }; }; then
|
||||||
|
ac_cv_lib_socket_gethostbyname=yes
|
||||||
|
else
|
||||||
|
echo "$as_me: failed program was:" >&5
|
||||||
|
sed 's/^/| /' conftest.$ac_ext >&5
|
||||||
|
|
||||||
|
ac_cv_lib_socket_gethostbyname=no
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -f core conftest.err conftest.$ac_objext \
|
||||||
|
conftest$ac_exeext conftest.$ac_ext
|
||||||
|
LIBS=$ac_check_lib_save_LIBS
|
||||||
|
fi
|
||||||
|
{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_gethostbyname" >&5
|
||||||
|
echo "${ECHO_T}$ac_cv_lib_socket_gethostbyname" >&6; }
|
||||||
|
if test $ac_cv_lib_socket_gethostbyname = yes; then
|
||||||
|
cat >>confdefs.h <<_ACEOF
|
||||||
|
#define HAVE_LIBSOCKET 1
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
LIBS="-lsocket $LIBS"
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
# Check for pthread.h
|
# Check for pthread.h
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
|
@ -21506,7 +21707,8 @@ _ACEOF
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for ac_header in fcntl.h inttypes.h libc.h limits.h malloc.h memory.h signal.h stdint.h string.h sys/fcntl.h sys/file.h sys/inttypes.h sys/ioctl.h sys/signal.h sys/stropts.h sys/wait.h unistd.h utime.h stdlib.h
|
|
||||||
|
for ac_header in fcntl.h inttypes.h libc.h limits.h malloc.h memory.h signal.h stdint.h string.h sys/fcntl.h sys/file.h sys/filio.h sys/inttypes.h sys/ioctl.h sys/signal.h sys/stropts.h sys/wait.h unistd.h utime.h stdlib.h
|
||||||
do
|
do
|
||||||
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
|
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
|
||||||
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
|
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
|
||||||
|
|
|
@ -1625,6 +1625,12 @@ OBJC_SYS_DYNAMIC_LINKER()
|
||||||
# NOTE: libdl should be in LIBS now if it's available.
|
# NOTE: libdl should be in LIBS now if it's available.
|
||||||
AC_CHECK_FUNCS(dladdr)
|
AC_CHECK_FUNCS(dladdr)
|
||||||
|
|
||||||
|
AC_CHECK_FUNCS(gethostbyname)
|
||||||
|
if test "$ac_cv_func_gethostbyname" = "no"; then
|
||||||
|
# QNX has gethostbyname and friends in libsocket
|
||||||
|
AC_CHECK_LIB(socket, gethostbyname)
|
||||||
|
fi
|
||||||
|
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
# Check for pthread.h
|
# Check for pthread.h
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
|
@ -2239,6 +2245,7 @@ AC_CHECK_HEADERS(dnl
|
||||||
string.h dnl
|
string.h dnl
|
||||||
sys/fcntl.h dnl
|
sys/fcntl.h dnl
|
||||||
sys/file.h dnl
|
sys/file.h dnl
|
||||||
|
sys/filio.h dnl
|
||||||
sys/inttypes.h dnl
|
sys/inttypes.h dnl
|
||||||
sys/ioctl.h dnl
|
sys/ioctl.h dnl
|
||||||
sys/signal.h dnl
|
sys/signal.h dnl
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue