aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/os
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/programs/Xserver/os')
-rw-r--r--nx-X11/programs/Xserver/os/WaitFor.c48
-rw-r--r--nx-X11/programs/Xserver/os/access.c62
-rw-r--r--nx-X11/programs/Xserver/os/auth.c3
-rw-r--r--nx-X11/programs/Xserver/os/connection.c144
-rw-r--r--nx-X11/programs/Xserver/os/io.c37
-rw-r--r--nx-X11/programs/Xserver/os/log.c10
-rw-r--r--nx-X11/programs/Xserver/os/osdep.h18
-rw-r--r--nx-X11/programs/Xserver/os/osinit.c11
-rw-r--r--nx-X11/programs/Xserver/os/utils.c68
-rw-r--r--nx-X11/programs/Xserver/os/xdmcp.c12
10 files changed, 14 insertions, 399 deletions
diff --git a/nx-X11/programs/Xserver/os/WaitFor.c b/nx-X11/programs/Xserver/os/WaitFor.c
index 9db3faef1..3d53335b3 100644
--- a/nx-X11/programs/Xserver/os/WaitFor.c
+++ b/nx-X11/programs/Xserver/os/WaitFor.c
@@ -82,9 +82,6 @@ SOFTWARE.
#include <dix-config.h>
#endif
-#ifdef WIN32
-#include <nx-X11/Xwinsock.h>
-#endif
#include <nx-X11/Xos.h> /* for strings, fcntl, time */
#include <errno.h>
#include <stdio.h>
@@ -105,22 +102,9 @@ static unsigned long startTimeInMillis;
#endif
-#ifdef WIN32
-/* Error codes from windows sockets differ from fileio error codes */
-#undef EINTR
-#define EINTR WSAEINTR
-#undef EINVAL
-#define EINVAL WSAEINVAL
-#undef EBADF
-#define EBADF WSAENOTSOCK
-/* Windows select does not set errno. Use GetErrno as wrapper for
- WSAGetLastError */
-#define GetErrno WSAGetLastError
-#else
/* This is just a fallback to errno to hide the differences between unix and
Windows in the code */
#define GetErrno() errno
-#endif
/* modifications by raphael */
int
@@ -484,30 +468,12 @@ WaitForSomething(int *pClientsReady)
if (XFD_ANYSET (&clientsReadable))
break;
-#ifdef WIN32
- /* Windows keyboard and mouse events are added to the input queue
- in Block- and WakupHandlers. There is no device to check if
- data is ready. So check here if new input is available */
-#if defined(NX_TRANS_SOCKET)
- if (*checkForInput[0] != *checkForInput[1])
- {
-#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG)
- fprintf(stderr, "WaitForSomething: Returning 0 because of (*checkForInput[0] != *checkForInput[1]).\n");
-#endif
- return 0;
- }
-#else
- if (*checkForInput[0] != *checkForInput[1])
- return 0;
-#endif
-#endif
}
}
nready = 0;
if (XFD_ANYSET (&clientsReadable))
{
-#ifndef WIN32
for (i=0; i<howmany(XFD_SETSIZE, NFDBITS); i++)
{
while (clientsReadable.fds_bits[i])
@@ -517,23 +483,9 @@ WaitForSomething(int *pClientsReady)
curclient = ffs (clientsReadable.fds_bits[i]) - 1;
client_index = /* raphael: modified */
ConnectionTranslation[curclient + (i * (sizeof(fd_mask) * 8))];
-#else
- fd_set savedClientsReadable;
- XFD_COPYSET(&clientsReadable, &savedClientsReadable);
- for (i = 0; i < XFD_SETCOUNT(&savedClientsReadable); i++)
- {
- int client_priority, client_index;
-
- curclient = XFD_FD(&savedClientsReadable, i);
- client_index = GetConnectionTranslation(curclient);
-#endif
pClientsReady[nready++] = client_index;
-#ifndef WIN32
clientsReadable.fds_bits[i] &= ~(((fd_mask)1L) << curclient);
}
-#else
- FD_CLR(curclient, &clientsReadable);
-#endif
}
}
#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG)
diff --git a/nx-X11/programs/Xserver/os/access.c b/nx-X11/programs/Xserver/os/access.c
index df540e704..bea4b968a 100644
--- a/nx-X11/programs/Xserver/os/access.c
+++ b/nx-X11/programs/Xserver/os/access.c
@@ -58,9 +58,6 @@ SOFTWARE.
#include <dix-config.h>
#endif
-#ifdef WIN32
-#include <nx-X11/Xwinsock.h>
-#endif
#include <stdio.h>
#include <stdlib.h>
@@ -75,14 +72,13 @@ SOFTWARE.
#include "site.h"
#include <errno.h>
#include <sys/types.h>
-#ifndef WIN32
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <ctype.h>
-#if defined(TCPCONN) || defined(ISC) || defined(__SCO__)
+#if defined(TCPCONN)
#include <netinet/in.h>
-#endif /* TCPCONN || ISC || __SCO__ */
+#endif /* TCPCONN */
#ifdef HAS_GETPEERUCRED
# include <ucred.h>
@@ -91,15 +87,11 @@ SOFTWARE.
# endif
#endif
-#if defined(SVR4) || (defined(SYSV) && defined(i386)) || defined(__GNU__)
+#if defined(SVR4) || (defined(SYSV) && defined(__i386__)) || defined(__GNU__)
# include <sys/utsname.h>
#endif
-#if defined(SYSV) && defined(i386)
+#if defined(SYSV) && defined(__i386__)
# include <sys/stream.h>
-# ifdef ISC
-# include <sys/stropts.h>
-# include <sys/sioctl.h>
-# endif /* ISC */
#endif
#ifdef __GNU__
#undef SIOCGIFCONF
@@ -145,7 +137,6 @@ SOFTWARE.
/* #endif */
#endif
-#endif /* WIN32 */
#ifndef PATH_MAX
#include <sys/param.h>
@@ -158,10 +149,6 @@ SOFTWARE.
#endif
#endif
-#ifdef __SCO__
-/* The system defined value is wrong. MAXPATHLEN is set in sco5.cf. */
-#undef PATH_MAX
-#endif
#define X_INCLUDE_NETDB_H
#include <nx-X11/Xos_r.h>
@@ -282,7 +269,7 @@ AccessUsingXdmcp (void)
}
-#if ((defined(SVR4) && !defined(SCO325) && !defined(sun) && !defined(NCR)) || defined(ISC)) && defined(SIOCGIFCONF) && !defined(USE_SIOCGLIFCONF)
+#if ((defined(SVR4) && !defined(SCO325) && !defined(sun) && !defined(NCR))) && defined(SIOCGIFCONF) && !defined(USE_SIOCGLIFCONF)
/* Deal with different SIOCGIFCONF ioctl semantics on these OSs */
@@ -299,17 +286,6 @@ ifioctl (int fd, int cmd, char *arg)
{
ioc.ic_len = ((struct ifconf *) arg)->ifc_len;
ioc.ic_dp = ((struct ifconf *) arg)->ifc_buf;
-#ifdef ISC
- /* SIOCGIFCONF is somewhat brain damaged on ISC. The argument
- * buffer must contain the ifconf structure as header. Ifc_req
- * is also not a pointer but a one element array of ifreq
- * structures. On return this array is extended by enough
- * ifreq fields to hold all interfaces. The return buffer length
- * is placed in the buffer header.
- */
- ((struct ifconf *) ioc.ic_dp)->ifc_len =
- ioc.ic_len - sizeof(struct ifconf);
-#endif
}
else
{
@@ -321,19 +297,11 @@ ifioctl (int fd, int cmd, char *arg)
#ifdef SVR4
((struct ifconf *) arg)->ifc_len = ioc.ic_len;
#endif
-#ifdef ISC
- {
- ((struct ifconf *) arg)->ifc_len =
- ((struct ifconf *)ioc.ic_dp)->ifc_len;
- ((struct ifconf *) arg)->ifc_buf =
- (caddr_t)((struct ifconf *)ioc.ic_dp)->ifc_req;
- }
-#endif
return(ret);
}
#else /* Case sun, SCO325 NCR and others */
#define ifioctl ioctl
-#endif /* ((SVR4 && !sun !SCO325 !NCR) || ISC) && SIOCGIFCONF */
+#endif /* ((SVR4 && !sun !SCO325 !NCR)) && SIOCGIFCONF */
/*
* DefineSelf (fd):
@@ -501,13 +469,7 @@ DefineSelf (int fd)
int family;
register HOST *host;
-#ifndef WIN32
struct utsname name;
-#else
- struct {
- char nodename[512];
- } name;
-#endif
register struct hostent *hp;
@@ -531,11 +493,7 @@ DefineSelf (int fd)
* uname() lets me access to the whole string (it smashes release, you
* see), whereas gethostname() kindly truncates it for me.
*/
-#ifndef WIN32
uname(&name);
-#else
- gethostname(name.nodename, sizeof(name.nodename));
-#endif
hp = _XGethostbyname(name.nodename, hparams);
if (hp != NULL)
@@ -723,11 +681,7 @@ DefineSelf (int fd)
ifc.ifc_buf = bufptr;
#define IFC_IOCTL_REQ SIOCGIFCONF
-#ifdef ISC
-#define IFC_IFC_REQ (struct ifreq *) ifc.ifc_buf
-#else
#define IFC_IFC_REQ ifc.ifc_req
-#endif /* ISC */
#define IFC_IFC_LEN ifc.ifc_len
#define IFR_IFR_ADDR ifr->ifr_addr
#define IFR_IFR_NAME ifr->ifr_name
@@ -1723,10 +1677,6 @@ ConvertAddr (
return FamilyLocal;
#if defined(TCPCONN)
case AF_INET:
-#ifdef WIN32
- if (16777343 == *(long*)&((struct sockaddr_in *) saddr)->sin_addr)
- return FamilyLocal;
-#endif
*len = sizeof (struct in_addr);
*addr = (void *) &(((struct sockaddr_in *) saddr)->sin_addr);
return FamilyInternet;
diff --git a/nx-X11/programs/Xserver/os/auth.c b/nx-X11/programs/Xserver/os/auth.c
index 84bc5c3c6..491b8c427 100644
--- a/nx-X11/programs/Xserver/os/auth.c
+++ b/nx-X11/programs/Xserver/os/auth.c
@@ -71,9 +71,6 @@ from The Open Group.
#define _SECURITY_SERVER
# include <nx-X11/extensions/security.h>
#endif
-#ifdef WIN32
-#include <nx-X11/Xw32defs.h>
-#endif
struct protocol {
unsigned short name_length;
diff --git a/nx-X11/programs/Xserver/os/connection.c b/nx-X11/programs/Xserver/os/connection.c
index c5ebeea1e..7deeec428 100644
--- a/nx-X11/programs/Xserver/os/connection.c
+++ b/nx-X11/programs/Xserver/os/connection.c
@@ -65,9 +65,6 @@ SOFTWARE.
#include <dix-config.h>
#endif
-#ifdef WIN32
-#include <nx-X11/Xwinsock.h>
-#endif
#include <nx-X11/X.h>
#include <nx-X11/Xproto.h>
#define XSERV_t
@@ -81,7 +78,6 @@ SOFTWARE.
#include <stdlib.h>
#include <unistd.h>
-#ifndef WIN32
#include <sys/socket.h>
#if defined(TCPCONN)
@@ -104,7 +100,6 @@ SOFTWARE.
#endif
#include <sys/uio.h>
-#endif /* WIN32 */
#include "misc.h"
#include "osdep.h"
#include <nx-X11/Xpoll.h>
@@ -155,98 +150,7 @@ int GrabInProgress = 0;
static void
QueueNewConnections(int curconn, int ready, void *data);
-#if !defined(WIN32)
int *ConnectionTranslation = NULL;
-#else
-/*
- * On NT fds are not between 0 and MAXSOCKS, they are unrelated, and there is
- * not even a known maximum value, so use something quite arbitrary for now.
- * Do storage is a hash table of size 256. Collisions are handled in a linked
- * list.
- */
-
-#undef MAXSOCKS
-#define MAXSOCKS 500
-#undef MAXSELECT
-#define MAXSELECT 500
-#define MAXFD 500
-
-struct _ct_node {
- struct _ct_node *next;
- int key;
- int value;
-};
-
-struct _ct_node *ct_head[256];
-
-void InitConnectionTranslation(void)
-{
- bzero(ct_head, sizeof(ct_head));
-}
-
-int GetConnectionTranslation(int conn)
-{
- struct _ct_node *node = ct_head[conn & 0xff];
- while (node != NULL)
- {
- if (node->key == conn)
- return node->value;
- node = node->next;
- }
- return 0;
-}
-
-void SetConnectionTranslation(int conn, int client)
-{
- struct _ct_node **node = ct_head + (conn & 0xff);
- if (client == 0) /* remove entry */
- {
- while (*node != NULL)
- {
- if ((*node)->key == conn)
- {
- struct _ct_node *temp = *node;
- *node = (*node)->next;
- free(temp);
- return;
- }
- node = &((*node)->next);
- }
- return;
- } else
- {
- while (*node != NULL)
- {
- if ((*node)->key == conn)
- {
- (*node)->value = client;
- return;
- }
- node = &((*node)->next);
- }
- *node = (struct _ct_node*)malloc(sizeof(struct _ct_node));
- (*node)->next = NULL;
- (*node)->key = conn;
- (*node)->value = client;
- return;
- }
-}
-
-void ClearConnectionTranslation(void)
-{
- unsigned i;
- for (i = 0; i < 256; i++)
- {
- struct _ct_node *node = ct_head[i];
- while (node != NULL)
- {
- struct _ct_node *temp = node;
- node = node->next;
- free(temp);
- }
- }
-}
-#endif
XtransConnInfo *ListenTransConns = NULL;
int *ListenTransFds = NULL;
@@ -318,11 +222,7 @@ InitConnectionLimits(void)
ErrorF("InitConnectionLimits: MaxClients = %d\n", MaxClients);
#endif
-#if !defined(WIN32)
ConnectionTranslation = (int *)xnfalloc(sizeof(int)*(lastfdesc + 1));
-#else
- InitConnectionTranslation();
-#endif
}
/*
@@ -341,7 +241,6 @@ InitConnectionLimits(void)
static void
InitParentProcess(void)
{
-#if !defined(WIN32)
OsSigHandlerPtr handler;
handler = OsSignal (SIGUSR1, SIG_IGN);
if ( handler == SIG_IGN)
@@ -357,13 +256,11 @@ InitParentProcess(void)
*/
ParentProcess = GetPPID (ParentProcess);
#endif /* __UNIXOS2__ */
-#endif
}
void
NotifyParentProcess(void)
{
-#if !defined(WIN32)
if (displayfd >= 0) {
#ifdef NXAGENT_SERVER
if (displayfd == STDERR_FILENO)
@@ -385,7 +282,6 @@ NotifyParentProcess(void)
kill (ParentProcess, SIGUSR1);
}
}
-#endif
}
static Bool
@@ -416,11 +312,7 @@ CreateWellKnownSockets(void)
FD_ZERO(&LastSelectMask);
FD_ZERO(&ClientsWithInput);
-#if !defined(WIN32)
for (i=0; i<MaxClients; i++) ConnectionTranslation[i] = 0;
-#else
- ClearConnectionTranslation();
-#endif
/* display is initialized to "0" by main(). It is then set to the display
* number if specified on the command line. */
@@ -473,10 +365,8 @@ CreateWellKnownSockets(void)
if (ListenTransCount == 0 && !NoListenAll)
FatalError ("Cannot establish any listening sockets - Make sure an X server isn't already running");
-#if !defined(WIN32)
OsSignal (SIGPIPE, SIG_IGN);
OsSignal (SIGHUP, AutoResetServer);
-#endif
OsSignal (SIGINT, GiveUp);
OsSignal (SIGTERM, GiveUp);
ResetHosts(display);
@@ -802,11 +692,7 @@ AllocNewConnection (XtransConnInfo trans_conn, int fd, CARD32 conn_time)
ClientPtr client;
if (
-#ifndef WIN32
fd >= lastfdesc
-#else
- XFD_SETCOUNT(&AllClients) >= MaxClients
-#endif
)
return NullClient;
oc = (OsCommPtr)malloc(sizeof(OsCommRec));
@@ -825,11 +711,7 @@ AllocNewConnection (XtransConnInfo trans_conn, int fd, CARD32 conn_time)
}
client->local = ComputeLocalClient(client);
{
-#if !defined(WIN32)
ConnectionTranslation[fd] = client->index;
-#else
- SetConnectionTranslation(fd, client->index);
-#endif
if (GrabInProgress)
{
FD_SET(fd, &SavedAllClients);
@@ -893,11 +775,7 @@ EstablishNewConnections(ClientPtr clientUnused, void * closure)
if (newconn < lastfdesc) {
int clientid;
-#if !defined(WIN32)
clientid = ConnectionTranslation[newconn];
-#else
- clientid = GetConnectionTranslation(newconn);
-#endif
if (clientid && (client = clients[clientid]))
CloseDownClient(client);
}
@@ -990,11 +868,7 @@ CloseDownFileDescriptor(OsCommPtr oc)
}
FreeOsBuffers(oc);
free(oc);
-#ifndef WIN32
ConnectionTranslation[connection] = 0;
-#else
- SetConnectionTranslation(connection, 0);
-#endif
FD_CLR(connection, &AllSockets);
FD_CLR(connection, &AllClients);
FD_CLR(connection, &ClientsWithInput);
@@ -1023,22 +897,16 @@ CloseDownFileDescriptor(OsCommPtr oc)
void
CheckConnections(void)
{
-#ifndef WIN32
fd_mask mask;
-#endif
fd_set tmask;
int curclient, curoff;
int i;
struct timeval notime;
int r;
-#ifdef WIN32
- fd_set savedAllClients;
-#endif
notime.tv_sec = 0;
notime.tv_usec = 0;
-#ifndef WIN32
for (i=0; i<howmany(XFD_SETSIZE, NFDBITS); i++)
{
mask = AllClients.fds_bits[i];
@@ -1054,18 +922,6 @@ CheckConnections(void)
mask &= ~((fd_mask)1 << curoff);
}
}
-#else
- XFD_COPYSET(&AllClients, &savedAllClients);
- for (i = 0; i < XFD_SETCOUNT(&savedAllClients); i++)
- {
- curclient = XFD_FD(&savedAllClients, i);
- FD_ZERO(&tmask);
- FD_SET(curclient, &tmask);
- r = Select (curclient + 1, &tmask, NULL, NULL, &notime);
- if (r < 0)
- CloseDownClient(clients[GetConnectionTranslation(curclient)]);
- }
-#endif
}
diff --git a/nx-X11/programs/Xserver/os/io.c b/nx-X11/programs/Xserver/os/io.c
index 02a47f135..7f35a81f1 100644
--- a/nx-X11/programs/Xserver/os/io.c
+++ b/nx-X11/programs/Xserver/os/io.c
@@ -60,9 +60,6 @@ SOFTWARE.
#if 0
#define DEBUG_COMMUNICATION
#endif
-#ifdef WIN32
-#include <nx-X11/Xwinsock.h>
-#endif
#include <stdio.h>
#define XSERV_t
#define TRANS_SERVER
@@ -70,9 +67,7 @@ SOFTWARE.
#include <nx-X11/Xtrans/Xtrans.h>
#include <nx-X11/Xmd.h>
#include <errno.h>
-#if !defined(WIN32)
#include <sys/uio.h>
-#endif
#include <nx-X11/X.h>
#include <nx-X11/Xproto.h>
#include "os.h"
@@ -88,7 +83,6 @@ CallbackListPtr FlushCallback;
/* check for both EAGAIN and EWOULDBLOCK, because some supposedly POSIX
* systems are broken and return EWOULDBLOCK when they should return EAGAIN
*/
-#ifndef WIN32
#if defined(EAGAIN) && defined(EWOULDBLOCK)
#define ETEST(err) (err == EAGAIN || err == EWOULDBLOCK)
#else
@@ -98,9 +92,6 @@ CallbackListPtr FlushCallback;
#define ETEST(err) (err == EWOULDBLOCK)
#endif
#endif
-#else /* WIN32 The socket errorcodes differ from the normal errors*/
-#define ETEST(err) (err == EAGAIN || err == WSAEWOULDBLOCK)
-#endif
Bool CriticalOutputPending;
int timesThisConnection = 0;
@@ -358,7 +349,7 @@ ReadRequestFromClient(ClientPtr client)
{
if ((result < 0) && ETEST(errno))
{
-#if defined(SVR4) && defined(i386) && !defined(sun)
+#if defined(SVR4) && defined(__i386__) && !defined(sun)
if (0)
#endif
{
@@ -777,9 +768,6 @@ FlushAllOutput(void)
OsCommPtr oc;
register ClientPtr client;
Bool newoutput = NewOutputPending;
-#if defined(WIN32)
- fd_set newOutputPending;
-#endif
if (!newoutput)
return;
@@ -792,7 +780,6 @@ FlushAllOutput(void)
CriticalOutputPending = FALSE;
NewOutputPending = FALSE;
-#ifndef WIN32
for (base = 0; base < howmany(XFD_SETSIZE, NFDBITS); base++)
{
mask = OutputPending.fds_bits[ base ];
@@ -817,28 +804,6 @@ FlushAllOutput(void)
(void)FlushClient(client, oc, (char *)NULL, 0);
}
}
-#else /* WIN32 */
- FD_ZERO(&newOutputPending);
- for (base = 0; base < XFD_SETCOUNT(&OutputPending); base++)
- {
- index = XFD_FD(&OutputPending, base);
- if ((index = GetConnectionTranslation(index)) == 0)
- continue;
- client = clients[index];
- if (client->clientGone)
- continue;
- oc = (OsCommPtr)client->osPrivate;
- if (
- FD_ISSET(oc->fd, &ClientsWithInput))
- {
- FD_SET(oc->fd, &newOutputPending); /* set the bit again */
- NewOutputPending = TRUE;
- }
- else
- (void)FlushClient(client, oc, (char *)NULL, 0);
- }
- XFD_COPYSET(&newOutputPending, &OutputPending);
-#endif /* WIN32 */
}
void
diff --git a/nx-X11/programs/Xserver/os/log.c b/nx-X11/programs/Xserver/os/log.c
index 0ead6e9f0..3ec3a2779 100644
--- a/nx-X11/programs/Xserver/os/log.c
+++ b/nx-X11/programs/Xserver/os/log.c
@@ -117,10 +117,6 @@ OR PERFORMANCE OF THIS SOFTWARE.
#include "site.h"
#include "opaque.h"
-#ifdef WIN32
-#include <process.h>
-#define getpid(x) _getpid(x)
-#endif
#ifdef NX_TRANS_SOCKET
@@ -268,9 +264,7 @@ LogInit(const char *fname, const char *backup)
if (saveBuffer && bufferSize > 0) {
fwrite(saveBuffer, bufferPos, 1, logFile);
fflush(logFile);
-#ifndef WIN32
fsync(fileno(logFile));
-#endif
}
}
@@ -398,10 +392,8 @@ LogVWrite(int verb, const char *f, va_list args)
fwrite(tmpBuffer, len, 1, logFile);
if (logFlush) {
fflush(logFile);
-#ifndef WIN32
if (logSync)
fsync(fileno(logFile));
-#endif
}
} else if (needBuffer) {
/*
@@ -730,11 +722,9 @@ ErrorF(const char * f, ...)
#ifndef NEED_STRERROR
#ifdef SYSV
-#if !defined(ISC) || defined(ISC202) || defined(ISC22)
#define NEED_STRERROR
#endif
#endif
-#endif
#if defined(NEED_STRERROR) && !defined(strerror)
extern char *sys_errlist[];
diff --git a/nx-X11/programs/Xserver/os/osdep.h b/nx-X11/programs/Xserver/os/osdep.h
index 01ae7c3fb..5985cfef2 100644
--- a/nx-X11/programs/Xserver/os/osdep.h
+++ b/nx-X11/programs/Xserver/os/osdep.h
@@ -69,11 +69,6 @@ SOFTWARE.
#undef _POSIX_SOURCE
#endif
#else /* X_NOT_POSIX */
-#ifdef WIN32
-#define _POSIX_
-#include <limits.h>
-#undef _POSIX_
-#endif
#endif /* X_NOT_POSIX */
#ifndef OPEN_MAX
@@ -85,11 +80,7 @@ SOFTWARE.
#if defined(NOFILE) && !defined(NOFILES_MAX)
#define OPEN_MAX NOFILE
#else
-#if !defined(WIN32)
#define OPEN_MAX NOFILES_MAX
-#else
-#define OPEN_MAX 256
-#endif
#endif
#endif
#endif
@@ -213,13 +204,7 @@ extern fd_set ClientsWriteBlocked;
extern fd_set OutputPending;
extern fd_set IgnoredClientsWithInput;
-#ifndef WIN32
extern int *ConnectionTranslation;
-#else
-extern int GetConnectionTranslation(int conn);
-extern void SetConnectionTranslation(int conn, int client);
-extern void ClearConnectionTranslation();
-#endif
extern Bool NewOutputPending;
extern Bool AnyWritesPending;
@@ -234,9 +219,6 @@ extern OsCommPtr AvailableInput;
extern WorkQueuePtr workQueue;
/* added by raphael */
-#ifdef WIN32
-typedef long int fd_mask;
-#endif
#define ffs mffs
extern int mffs(fd_mask);
diff --git a/nx-X11/programs/Xserver/os/osinit.c b/nx-X11/programs/Xserver/os/osinit.c
index a660337ca..823656316 100644
--- a/nx-X11/programs/Xserver/os/osinit.c
+++ b/nx-X11/programs/Xserver/os/osinit.c
@@ -65,11 +65,8 @@ SOFTWARE.
#endif
#endif
-#if defined(__SCO__)
-#include <sys/wait.h>
-#endif
-#if !defined(SYSV) && !defined(WIN32)
+#if !defined(SYSV)
#include <sys/resource.h>
#endif
@@ -104,7 +101,7 @@ OsInit(void)
InitNotifyFds();
-#if !defined(__SCO__) && !defined(__CYGWIN__) && !defined(__UNIXWARE__)
+#if !defined(__CYGWIN__)
fclose(stdin);
fclose(stdout);
#endif
@@ -134,7 +131,7 @@ OsInit(void)
dup2 (fileno (err), 2);
fclose (err);
}
-#if defined(SYSV) || defined(SVR4) || defined(WIN32) || defined(__CYGWIN__)
+#if defined(SYSV) || defined(SVR4) || defined(__CYGWIN__)
{
static char buf[BUFSIZ];
setvbuf (stderr, buf, _IOLBF, BUFSIZ);
@@ -148,7 +145,7 @@ OsInit(void)
if (getpgrp () == 0)
setpgid (0, 0);
#else
-#if !defined(SYSV) && !defined(WIN32)
+#if !defined(SYSV)
if (getpgrp (0) == 0)
setpgrp (0, getpid ());
#endif
diff --git a/nx-X11/programs/Xserver/os/utils.c b/nx-X11/programs/Xserver/os/utils.c
index f9b06de2d..eed8cbf13 100644
--- a/nx-X11/programs/Xserver/os/utils.c
+++ b/nx-X11/programs/Xserver/os/utils.c
@@ -83,9 +83,6 @@ OR PERFORMANCE OF THIS SOFTWARE.
#include <signal.h>
#endif
-#if defined(WIN32) && !defined(__CYGWIN__)
-#include <nx-X11/Xwinsock.h>
-#endif
#include <nx-X11/Xos.h>
#include <stdio.h>
#include "misc.h"
@@ -115,10 +112,8 @@ OR PERFORMANCE OF THIS SOFTWARE.
#undef _POSIX_SOURCE
#endif
#endif
-#ifndef WIN32
#include <sys/wait.h>
-#endif
-#if !defined(SYSV) && !defined(WIN32)
+#if !defined(SYSV)
#include <sys/resource.h>
#endif
#include <time.h>
@@ -132,9 +127,7 @@ OR PERFORMANCE OF THIS SOFTWARE.
#include <stdlib.h> /* for malloc() */
#if defined(TCPCONN)
-# ifndef WIN32
# include <netdb.h>
-# endif
#endif
#include "opaque.h"
@@ -910,7 +903,7 @@ ProcessCommandLine(int argc, char *argv[])
#ifdef SERVER_LOCK
else if ( strcmp ( argv[i], "-nolock") == 0)
{
-#if !defined(WIN32) && !defined(__CYGWIN__)
+#if !defined(__CYGWIN__)
if (getuid() != 0)
ErrorF("Warning: the -nolock option can only be used by root\n");
else
@@ -1230,7 +1223,7 @@ ExpandCommandLine(int *pargc, char ***pargv)
{
int i;
-#if !defined(WIN32) && !defined(__CYGWIN__)
+#if !defined(__CYGWIN__)
if (getuid() != geteuid())
return;
#endif
@@ -1566,7 +1559,6 @@ OsReleaseSignals (void)
#endif
}
-#if !defined(WIN32)
/*
* "safer" versions of system(3), popen(3) and pclose(3) which give up
* all privs before running a command.
@@ -1948,7 +1940,6 @@ Fclose(void * iop)
#endif
}
-#endif /* !WIN32 */
/*
@@ -1981,11 +1972,7 @@ Fclose(void * iop)
/* Check args and env only if running setuid (euid == 0 && euid != uid) ? */
#ifndef CHECK_EUID
-#ifndef WIN32
#define CHECK_EUID 1
-#else
-#define CHECK_EUID 0
-#endif
#endif
/*
@@ -2232,52 +2219,3 @@ CheckUserAuthorization(void)
#endif
}
-#ifdef __SCO__
-#include <fcntl.h>
-
-static void
-lockit (int fd, short what)
-{
- struct flock lck;
-
- lck.l_whence = 0;
- lck.l_start = 0;
- lck.l_len = 1;
- lck.l_type = what;
-
- (void)fcntl (fd, F_SETLKW, &lck);
-}
-
-/* SCO OpenServer 5 lacks pread/pwrite. Emulate them. */
-ssize_t
-pread (int fd, void *buf, size_t nbytes, off_t offset)
-{
- off_t saved;
- ssize_t ret;
-
- lockit (fd, F_RDLCK);
- saved = lseek (fd, 0, SEEK_CUR);
- lseek (fd, offset, SEEK_SET);
- ret = read (fd, buf, nbytes);
- lseek (fd, saved, SEEK_SET);
- lockit (fd, F_UNLCK);
-
- return ret;
-}
-
-ssize_t
-pwrite (int fd, const void *buf, size_t nbytes, off_t offset)
-{
- off_t saved;
- ssize_t ret;
-
- lockit (fd, F_WRLCK);
- saved = lseek (fd, 0, SEEK_CUR);
- lseek (fd, offset, SEEK_SET);
- ret = write (fd, buf, nbytes);
- lseek (fd, saved, SEEK_SET);
- lockit (fd, F_UNLCK);
-
- return ret;
-}
-#endif /* __SCO__ */
diff --git a/nx-X11/programs/Xserver/os/xdmcp.c b/nx-X11/programs/Xserver/os/xdmcp.c
index 3a077d8f4..8da1131ed 100644
--- a/nx-X11/programs/Xserver/os/xdmcp.c
+++ b/nx-X11/programs/Xserver/os/xdmcp.c
@@ -17,22 +17,13 @@
#include <dix-config.h>
#endif
-#ifdef WIN32
-#include <nx-X11/Xwinsock.h>
-#define XSERV_t
-#define TRANS_SERVER
-#define TRANS_REOPEN
-#include <nx-X11/Xtrans/Xtrans.h>
-#endif
#include <nx-X11/Xos.h>
-#if !defined(WIN32)
#include <sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
-#endif
#include <stdio.h>
#include <stdlib.h>
@@ -1507,9 +1498,6 @@ get_addr_by_name(
#ifdef XTHREADS_NEEDS_BYNAMEPARAMS
_Xgethostbynameparams hparams;
#endif
-#if defined(WIN32) && defined(TCPCONN)
- _XSERVTransWSAStartup();
-#endif
if (!(hep = _XGethostbyname(namestr, hparams)))
{
FatalError("Xserver: %s unknown host: %s\n", argtype, namestr);