--- vnc_unixsrc/Xvnc/config/cf/ibm.cf.aix	2004-06-08 16:42:22.000000000 -0500
+++ vnc_unixsrc/Xvnc/config/cf/ibm.cf	2004-06-08 16:42:42.000000000 -0500
@@ -104,8 +104,8 @@
 #define Malloc0ReturnsNull	YES
 #define CppCmd			/usr/ccs/lib/cpp
 #define ExpandManNames		YES
-#define ExtensionOSDefines	-DXTESTEXT1
-#define XibmServer		YES
+#define ExtensionOSDefines	# -DXTESTEXT1
+#define XibmServer		NO
 #define ibmIncludeSKYWAY	YES
 
 /* IBM cpp has slightly non-standard line directives, but supports -P */
--- vnc_unixsrc/Xvnc/programs/Xserver/os/connection.c.aix	2004-06-08 16:38:05.000000000 -0500
+++ vnc_unixsrc/Xvnc/programs/Xserver/os/connection.c	2004-06-08 16:38:39.000000000 -0500
@@ -1257,62 +1257,3 @@
 	CallCallbacks(&ServerGrabCallback, &grabinfo);
     }
 }
-
-#ifdef AIXV3
-
-static fd_set pendingActiveClients;
-static BOOL reallyGrabbed;
-
-/****************
-* DontListenToAnybody:
-*   Don't listen to requests from any clients. Continue to handle new
-*   connections, but don't take any protocol requests from anybody.
-*   We have to take care if there is already a grab in progress, though.
-*   Undone by PayAttentionToClientsAgain. We also have to be careful
-*   not to accept any more input from the currently dispatched client.
-*   we do this be telling dispatch it is time to yield.
-
-*   We call this when the server loses access to the glass
-*   (user hot-keys away).  This looks like a grab by the 
-*   server itself, but gets a little tricky if there is already
-*   a grab in progress.
-******************/
-
-void
-DontListenToAnybody()
-{
-    if (!GrabInProgress)
-    {
-	XFD_COPYSET(&ClientsWithInput, &SavedClientsWithInput);
-	XFD_COPYSET(&AllSockets, &SavedAllSockets);
-	XFD_COPYSET(&AllClients, &SavedAllClients);
-	GrabInProgress = TRUE;
-	reallyGrabbed = FALSE;
-    }
-    else
-    {
-	XFD_COPYSET(&AllClients, &pendingActiveClients);
-	reallyGrabbed = TRUE;
-    }
-    FD_ZERO(&ClientsWithInput);
-    XFD_UNSET(&AllSockets, &AllClients);
-    FD_ZERO(&AllClients);
-    isItTimeToYield = TRUE;
-}
-
-void
-PayAttentionToClientsAgain()
-{
-    if (reallyGrabbed)
-    {
-	XFD_ORSET(&AllSockets, &AllSockets, &pendingActiveClients);
-	XFD_ORSET(&AllClients, &AllClients, &pendingActiveClients);
-    }
-    else
-    {
-	ListenToAllClients();
-    }
-    reallyGrabbed = FALSE;
-}
-
-#endif
--- vnc_unixsrc/Xvnc/programs/Xserver/os/osinit.c.aix	2004-06-08 16:38:54.000000000 -0500
+++ vnc_unixsrc/Xvnc/programs/Xserver/os/osinit.c	2004-06-08 16:39:21.000000000 -0500
@@ -62,7 +62,7 @@
 #endif
 #endif
 
-#if !defined(SYSV) && !defined(AMOEBA) && !defined(_MINIX) && !defined(WIN32) && !defined(Lynx)
+#if !defined(SYSV) && !defined(AMOEBA) && !defined(_MINIX) && !defined(WIN32) && !defined(Lynx) || defined(hpux) || defined(AIXV4)
 #include <sys/resource.h>
 #endif
 
--- vnc_unixsrc/Xvnc/programs/Xserver/os/utils.c.aix	2004-06-08 16:39:34.000000000 -0500
+++ vnc_unixsrc/Xvnc/programs/Xserver/os/utils.c	2004-06-08 16:41:33.000000000 -0500
@@ -75,7 +75,7 @@
 #undef _POSIX_SOURCE
 #endif
 #endif
-#if !defined(SYSV) && !defined(AMOEBA) && !defined(_MINIX) && !defined(WIN32) && !defined(Lynx)
+#if !defined(SYSV) && !defined(AMOEBA) && !defined(_MINIX) && !defined(WIN32) && !defined(Lynx) || defined(hpux) || defined(AIXV4)
 #include <sys/resource.h>
 #endif
 #include <time.h>
@@ -145,12 +145,6 @@
 void VErrorF(char*, va_list);
 #endif
 
-#ifdef AIXV3
-FILE *aixfd;
-int SyncOn  = 0;
-extern int SelectWaitTime;
-#endif
-
 #ifdef DEBUG
 #ifndef SPECIAL_MALLOC
 #define MEMBUG
@@ -624,9 +618,6 @@
 	PartialNetwork = TRUE;
 #endif
 
-#ifdef AIXV3
-    OpenDebug();
-#endif
     for ( i = 1; i < argc; i++ )
     {
 	/* call ddx first, so it can peek/override if it wants */
@@ -934,19 +925,6 @@
 	    i = skip - 1;
 	}
 #endif
-#ifdef AIXV3
-        else if ( strcmp( argv[i], "-timeout") == 0)
-        {
-            if(++i < argc)
-                SelectWaitTime = atoi(argv[i]);
-            else
-                UseMsg();
-        }
-        else if ( strcmp( argv[i], "-sync") == 0)
-        {
-            SyncOn++;
-        }
-#endif
  	else
  	{
 	    ErrorF("Unrecognized option: %s\n", argv[i]);
@@ -1370,14 +1348,7 @@
     char *f;
     va_list args;
 {
-#ifdef AIXV3
-    vfprintf(aixfd, f, args);
-    fflush (aixfd);
-    if (SyncOn)
-        sync();
-#else
     vfprintf(stderr, f, args);
-#endif /* AIXV3 */
 }
 #endif
 
@@ -1398,12 +1369,6 @@
     VErrorF(f, args);
     va_end(args);
 #else
-#ifdef AIXV3
-    fprintf(aixfd, f, s0, s1, s2, s3, s4, s5, s6, s7, s8, s9);
-    fflush (aixfd);
-    if (SyncOn)
-        sync();
-#else /* not AIXV3 */
 #ifdef AMOEBA
     mu_lock(&print_lock);
 #endif
@@ -1411,33 +1376,9 @@
 #ifdef AMOEBA
     mu_unlock(&print_lock);
 #endif
-#endif /* AIXV3 */
 #endif
 }
 
-#ifdef AIXV3
-OpenDebug()
-{
-    char aixlogfile[100];
-    struct stat aixfilebuf;
-
-        sprintf(aixlogfile,"/tmp/xlogfile%d",getpid());
-
-        /* if the logfile already exists & is a symlink, fopen() overwrites
-         * it without unlinking the file. It is necessary to unlink the
-         * logfile to avoid a security breach & possible exploitation.
-         */
-        if (stat((const char *)aixlogfile,&aixfilebuf) == 0)
-                unlink(aixlogfile);
-        if((aixfd = fopen(aixlogfile,"w")) == NULL )
-        {
-                fprintf(stderr,"open %s failed\n",aixlogfile);
-                exit(-1);
-        }
-        chmod(aixlogfile,00644);
-}
-#endif
-
 #if !defined(WIN32) && !defined(__EMX__)
 /*
  * "safer" versions of system(3), popen(3) and pclose(3) which give up
