diff options
-rw-r--r-- | audio.c | 2 | ||||
-rw-r--r-- | common.c | 8 | ||||
-rw-r--r-- | configure.ac | 3 | ||||
-rw-r--r-- | decode11.c | 5 | ||||
-rw-r--r-- | fd.c | 18 | ||||
-rw-r--r-- | scope.c | 7 | ||||
-rw-r--r-- | scope.h | 6 | ||||
-rw-r--r-- | server.c | 5 |
8 files changed, 17 insertions, 37 deletions
@@ -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> @@ -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 @@ -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. @@ -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); @@ -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> @@ -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 @@ -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]; |