[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
LYNX-DEV _WINDOWS patch for doing NSL_FORK
From: |
afn06760 |
Subject: |
LYNX-DEV _WINDOWS patch for doing NSL_FORK |
Date: |
Wed, 11 Mar 1998 18:37:57 GMT |
Code added to WWW/Library/Implementation/HTTCP.c.
This actually seems to work. (Sorry, not in patch
format)
=================================================
#ifdef _WINDOWS
void _fork_fun (void *phost)
{
long r_val;
r_val = (long)gethostbyname(*(((char ***)phost)[1]));
if (r_val == (long)NULL) r_val = -1L;
*((void ***)phost)[0] = (void *)r_val;
}
#endif
====================================================
FREE(host);
if (soc_in->sin_addr.s_addr == 0) {
if (TRACE)
fprintf(stderr,
"HTTPAccess: Can't find internet node name
`%s'.\n",host);
return -1; /* Fail? */
}
#else
#if defined(_WINDOWS)
{
void *arglist[2];
pid_t fpid;
arglist[0] = (void *)&phost;
arglist[1] = (void *)&host;
phost = (void *)NULL;
fpid = (pid_t)_beginthread(_fork_fun, 4096, arglist);
while (!phost)
if (HTCheckForInterrupt())
{
if (!phost) CloseHandle(fpid);
FREE(host);
return HT_INTERRUPTED;
};
};
if (phost == ((void *)-1L)) phost = (void *)NULL;
#else
phost = gethostbyname(host); /* See netdb.h */
#endif /* _WINDOWS */
#ifdef MVS
if (TRACE) {
fprintf(stderr,
"HTParseInet: gethostbyname() returned %d\n", phost);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- LYNX-DEV _WINDOWS patch for doing NSL_FORK,
afn06760 <=