Remove legacy support for AIX
This commit is contained in:
@@ -47,7 +47,7 @@
|
||||
#define LOG_BUFFER_SIZE (8 * 1024)
|
||||
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 1024 /* AIX and others don't define this. */
|
||||
#define PATH_MAX 1024 /* WIN32 and others don't define this. */
|
||||
#endif
|
||||
|
||||
/*!
|
||||
|
||||
@@ -38,63 +38,7 @@
|
||||
* case.
|
||||
*/
|
||||
|
||||
#if defined(_AIX)
|
||||
|
||||
#include <sys/atomic_op.h>
|
||||
|
||||
#define isc_atomic_store(p, v) _clear_lock(p, v)
|
||||
|
||||
#ifdef __GNUC__
|
||||
static inline int32_t
|
||||
#else
|
||||
static int32_t
|
||||
#endif
|
||||
isc_atomic_xadd(int32_t *p, int32_t val) {
|
||||
int ret;
|
||||
|
||||
#ifdef __GNUC__
|
||||
asm("ics");
|
||||
#else
|
||||
__isync();
|
||||
#endif
|
||||
|
||||
ret = fetch_and_add((atomic_p)p, (int)val);
|
||||
|
||||
#ifdef __GNUC__
|
||||
asm("ics");
|
||||
#else
|
||||
__isync();
|
||||
#endif
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
||||
#ifdef __GNUC__
|
||||
static inline int
|
||||
#else
|
||||
static int
|
||||
#endif
|
||||
isc_atomic_cmpxchg(atomic_p p, int old, int replacement) {
|
||||
int orig = old;
|
||||
|
||||
#ifdef __GNUC__
|
||||
asm("ics");
|
||||
#else
|
||||
__isync();
|
||||
#endif
|
||||
if (compare_and_swap(p, &orig, replacement))
|
||||
orig = old;
|
||||
|
||||
#ifdef __GNUC__
|
||||
asm("ics");
|
||||
#else
|
||||
__isync();
|
||||
#endif
|
||||
|
||||
return (orig);
|
||||
}
|
||||
|
||||
#elif defined(ISC_PLATFORM_USEGCCASM) || defined(ISC_PLATFORM_USEMACASM)
|
||||
#if defined(ISC_PLATFORM_USEGCCASM) || defined(ISC_PLATFORM_USEMACASM)
|
||||
static inline int32_t
|
||||
isc_atomic_xadd(int32_t *p, int32_t val) {
|
||||
int32_t orig;
|
||||
|
||||
@@ -20,29 +20,24 @@
|
||||
#include <isc/lang.h>
|
||||
#include <isc/result.h>
|
||||
|
||||
#define ISC_DIR_NAMEMAX 256
|
||||
#define ISC_DIR_PATHMAX 1024
|
||||
#ifndef NAME_MAX
|
||||
#define NAME_MAX 256
|
||||
#endif
|
||||
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 1024
|
||||
#endif
|
||||
|
||||
/*% Directory Entry */
|
||||
typedef struct isc_direntry {
|
||||
/*!
|
||||
* Ideally, this should be NAME_MAX, but AIX does not define it by
|
||||
* default and dynamically allocating the space based on pathconf()
|
||||
* complicates things undesirably, as does adding special conditionals
|
||||
* just for AIX. So a comfortably sized buffer is chosen instead.
|
||||
*/
|
||||
char name[ISC_DIR_NAMEMAX];
|
||||
char name[NAME_MAX];
|
||||
unsigned int length;
|
||||
} isc_direntry_t;
|
||||
|
||||
/*% Directory */
|
||||
typedef struct isc_dir {
|
||||
unsigned int magic;
|
||||
/*!
|
||||
* As with isc_direntry_t->name, making this "right" for all systems
|
||||
* is slightly problematic because AIX does not define PATH_MAX.
|
||||
*/
|
||||
char dirname[ISC_DIR_PATHMAX];
|
||||
char dirname[PATH_MAX];
|
||||
isc_direntry_t entry;
|
||||
DIR * handle;
|
||||
} isc_dir_t;
|
||||
|
||||
@@ -823,39 +823,6 @@ socket_log(isc__socket_t *sock, const isc_sockaddr_t *address,
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(_AIX) && defined(ISC_NET_BSD44MSGHDR) && \
|
||||
defined(USE_CMSG) && defined(IPV6_RECVPKTINFO)
|
||||
/*
|
||||
* AIX has a kernel bug where IPV6_RECVPKTINFO gets cleared by
|
||||
* setting IPV6_V6ONLY.
|
||||
*/
|
||||
static void
|
||||
FIX_IPV6_RECVPKTINFO(isc__socket_t *sock)
|
||||
{
|
||||
char strbuf[ISC_STRERRORSIZE];
|
||||
int on = 1;
|
||||
|
||||
if (sock->pf != AF_INET6 || sock->type != isc_sockettype_udp)
|
||||
return;
|
||||
|
||||
if (setsockopt(sock->fd, IPPROTO_IPV6, IPV6_RECVPKTINFO,
|
||||
(void *)&on, sizeof(on)) < 0) {
|
||||
|
||||
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||
UNEXPECTED_ERROR(__FILE__, __LINE__,
|
||||
"setsockopt(%d, IPV6_RECVPKTINFO) "
|
||||
"%s: %s", sock->fd,
|
||||
isc_msgcat_get(isc_msgcat,
|
||||
ISC_MSGSET_GENERAL,
|
||||
ISC_MSG_FAILED,
|
||||
"failed"),
|
||||
strbuf);
|
||||
}
|
||||
}
|
||||
#else
|
||||
#define FIX_IPV6_RECVPKTINFO(sock) (void)0
|
||||
#endif
|
||||
|
||||
/*%
|
||||
* Increment socket-related statistics counters.
|
||||
*/
|
||||
@@ -6168,7 +6135,6 @@ isc__socket_ipv6only(isc_socket_t *sock0, bool yes) {
|
||||
strbuf);
|
||||
}
|
||||
}
|
||||
FIX_IPV6_RECVPKTINFO(sock); /* AIX */
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -19,18 +19,23 @@
|
||||
#include <isc/lang.h>
|
||||
#include <isc/result.h>
|
||||
|
||||
#define ISC_DIR_NAMEMAX _MAX_FNAME
|
||||
#define ISC_DIR_PATHMAX _MAX_PATH
|
||||
#ifndef NAME_MAX
|
||||
#define NAME_MAX _MAX_FNAME
|
||||
#endif
|
||||
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX _MAX_PATH
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
char name[ISC_DIR_NAMEMAX];
|
||||
char name[NAME_MAX];
|
||||
unsigned int length;
|
||||
WIN32_FIND_DATA find_data;
|
||||
} isc_direntry_t;
|
||||
|
||||
typedef struct {
|
||||
unsigned int magic;
|
||||
char dirname[ISC_DIR_PATHMAX];
|
||||
char dirname[PATH_MAX];
|
||||
isc_direntry_t entry;
|
||||
bool entry_filled;
|
||||
HANDLE search_handle;
|
||||
|
||||
Reference in New Issue
Block a user