summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--audio.c2
-rw-r--r--common.c8
-rw-r--r--configure.ac3
-rw-r--r--decode11.c5
-rw-r--r--fd.c18
-rw-r--r--scope.c7
-rw-r--r--scope.h6
-rw-r--r--server.c5
8 files changed, 17 insertions, 37 deletions
diff --git a/audio.c b/audio.c
index 4452a34..aaef19e 100644
--- a/audio.c
+++ b/audio.c
@@ -27,7 +27,7 @@
#include <sys/uio.h> /* for struct iovec, used by socket.h */
#include <sys/socket.h> /* for AF_INET, SOCK_STREAM, ... */
#include <sys/ioctl.h> /* for FIONCLEX, FIONBIO, ... */
-#ifdef SVR4
+#if !defined(FIOCLEX) && defined(HAVE_SYS_FILIO_H)
#include <sys/filio.h>
#endif
#include <fcntl.h>
diff --git a/common.c b/common.c
index 8229e5f..8f9b291 100644
--- a/common.c
+++ b/common.c
@@ -55,12 +55,6 @@
#include "scope.h"
#include <fcntl.h>
-
-#ifdef SYSV
-#define bzero(s,l) memset(s, 0, l)
-#define bcopy(s,d,l) memmove(d,s,l)
-#endif
-
#include <unistd.h>
/* ********************************************** */
@@ -209,7 +203,7 @@ static int ListenTransCount;
#include <sys/socket.h> /* for AF_INET, SOCK_STREAM, ... */
#include <sys/ioctl.h> /* for FIONCLEX, FIONBIO, ... */
#include <sys/fcntl.h> /* for FIONCLEX, FIONBIO, ... */
-#ifdef SVR4
+#if !defined(FIOCLEX) && defined(HAVE_SYS_FILIO_H)
#include <sys/filio.h>
#endif
diff --git a/configure.ac b/configure.ac
index f4739a9..8560d22 100644
--- a/configure.ac
+++ b/configure.ac
@@ -64,6 +64,9 @@ XSCOPE_CFLAGS="$XSCOPE_CFLAGS -DUSE_XTRANS"
AC_SUBST(XSCOPE_CFLAGS)
AC_SUBST(XSCOPE_LIBS)
+AC_CHECK_FUNCS([getdtablesize])
+AC_CHECK_HEADERS([sys/filio.h])
+
dnl Allow checking code with lint, sparse, etc.
XORG_WITH_LINT
diff --git a/decode11.c b/decode11.c
index 0c43108..5f24f34 100644
--- a/decode11.c
+++ b/decode11.c
@@ -58,11 +58,6 @@
#include "extensions.h"
#include "lbxscope.h"
-#ifdef SYSV
-#define bzero(s,l) memset(s, 0, l)
-#define bcopy(s,d,l) memmove(d,s,l)
-#endif
-
/*
There are 4 types of things in X11: requests, replies, errors, and events.
diff --git a/fd.c b/fd.c
index 69a00ee..3ed013b 100644
--- a/fd.c
+++ b/fd.c
@@ -58,17 +58,11 @@
#include "scope.h"
-#ifdef SYSV
#include <unistd.h>
-#define getdtablesize() sysconf(_SC_OPEN_MAX)
-#define bzero(s,l) memset(s, 0, l)
-#define bcopy(s,d,l) memmove(d,s,l)
-#endif
-
#include <sys/uio.h> /* for struct iovec, used by socket.h */
#include <sys/socket.h> /* for AF_INET, SOCK_STREAM, ... */
#include <sys/ioctl.h> /* for FIONCLEX, FIONBIO, ... */
-#ifdef SVR4
+#if !defined(FIOCLEX) && defined(HAVE_SYS_FILIO_H)
#include <sys/filio.h>
#endif
#include <fcntl.h>
@@ -100,14 +94,16 @@ InitializeFD(void)
enterprocedure("InitializeFD");
/* get the number of file descriptors the system will let us use */
-#if defined(hpux) || defined(SVR4)
- MaxFD = _NFILE - 1;
-#else
+#ifdef _SC_OPEN_MAX
+ MaxFD = sysconf(_SC_OPEN_MAX);
+#elif defined(HAVE_GETDTABLESIZE)
MaxFD = getdtablesize();
+#else
+ MaxFD = _NFILE - 1;
+#endif
if (MaxFD > FD_SETSIZE) {
MaxFD = FD_SETSIZE;
}
-#endif
if (MaxFD > StaticMaxFD)
{
fprintf(stderr, "Recompile with larger StaticMaxFD value %d\n", MaxFD);
diff --git a/scope.c b/scope.c
index 4a46ff4..dd7b717 100644
--- a/scope.c
+++ b/scope.c
@@ -59,16 +59,11 @@
#include <ctype.h>
#include <unistd.h>
-#ifdef SYSV
-#define bzero(s,l) memset(s, 0, l)
-#define bcopy(s,d,l) memmove(d,s,l)
-#endif
-
#include <sys/types.h> /* needed by sys/socket.h and netinet/in.h */
#include <sys/uio.h> /* for struct iovec, used by socket.h */
#include <sys/socket.h> /* for AF_INET, SOCK_STREAM, ... */
#include <sys/ioctl.h> /* for FIONCLEX, FIONBIO, ... */
-#ifdef SVR4
+#if !defined(FIOCLEX) && defined(HAVE_SYS_FILIO_H)
#include <sys/filio.h>
#endif
#include <fcntl.h>
diff --git a/scope.h b/scope.h
index 3fa3dd0..8954b68 100644
--- a/scope.h
+++ b/scope.h
@@ -56,6 +56,8 @@
#ifndef XSCOPE_SCOPE_H
#define XSCOPE_SCOPE_H
+#include "config.h"
+
#include <X11/Xos.h>
#include <X11/Xfuncs.h>
#include <stdio.h>
@@ -63,9 +65,9 @@
#include <string.h>
#include <netdb.h>
#include <sys/param.h>
-#ifdef SVR4
+#if !defined(FIOCLEX) && defined(HAVE_SYS_FILIO_H)
#include <sys/filio.h>
-#endif /* SVR4 */
+#endif
#define Boolean short
#define true 1
diff --git a/server.c b/server.c
index 629ade2..610a0b3 100644
--- a/server.c
+++ b/server.c
@@ -56,11 +56,6 @@
#include "scope.h"
#include "x11.h"
-#ifdef SYSV
-#define bzero(s,l) memset(s, 0, l)
-#define bcopy(s,d,l) memmove(d,s,l)
-#endif
-
struct TypeDef TD[MaxTypes];
unsigned char RBf[2];
unsigned char SBf[4];