dnl =================================================================
-if test "$EMXOS2" = yes || test "$host_os" = haiku; then
+if test "$host_os" = haiku; then
echo "Skipping user and group validity stuff.";
else
/* For gettimeofday() */
#include <sys/time.h>
-#if !defined(_WIN32) && !defined(__OS2__)
+#if !defined(_WIN32)
#include <unistd.h>
-#endif /* !defined(_WIN32) && !defined(__OS2__) */
+#endif /* !defined(_WIN32) */
#include <errno.h>
#include <assert.h>
#define inline __inline
#endif /* def _MSC_VER */
-#ifdef __OS2__
-#include <sys/socket.h> /* For sock_errno */
-#define INCL_DOS
-#include <os2.h>
-#endif
-
#include "errlog.h"
#include "project.h"
#include "jcc.h"
#ifdef _WIN32
static char *w32_socket_strerr(int errcode, char *tmp_buf);
#endif
-#ifdef __OS2__
-static char *os2_socket_strerr(int errcode, char *tmp_buf);
-#endif
#ifdef MUTEX_LOCKS_AVAILABLE
static inline void lock_logfile(void)
if ((NULL == fp) && (logfp != NULL))
{
/*
- * Some platforms (like OS/2) don't allow us to open
- * the same file twice, therefore we give it another
- * shot after closing the old file descriptor first.
+ * Some platforms (like OS/2 (XXX: no longer supported)) don't
+ * allow us to open the same file twice, therefore we give it
+ * another shot after closing the old file descriptor first.
*
* We don't do it right away because it prevents us
* from logging the "can't open logfile" message to
{
long this_thread;
-#ifdef __OS2__
- PTIB ptib;
- APIRET ulrc; /* XXX: I have no clue what this does */
-#endif /* __OS2__ */
-
/* FIXME get current thread id */
#ifdef FEATURE_PTHREAD
this_thread = (long)pthread_self();
#endif /* def __MACH__ */
#elif defined(_WIN32)
this_thread = GetCurrentThreadId();
-#elif defined(__OS2__)
- ulrc = DosGetInfoBlocks(&ptib, NULL);
- if (ulrc == 0)
- this_thread = ptib -> tib_ptib2 -> tib2_ultid;
#else
/* Forking instead of threading. */
this_thread = 1;
/*
* XXX: Only necessary on platforms where multiple threads
* can write to the buffer at the same time because we
- * don't support mutexes (OS/2 for example).
+ * don't support mutexes.
+ * XXX: Are there any such platforms left now that OS/2 is gone?
*/
outbuf[length] = '\0';
continue;
#ifdef _WIN32
ival = WSAGetLastError();
format_string = w32_socket_strerr(ival, tempbuf);
-#elif __OS2__
- ival = sock_errno();
- if (ival != 0)
- {
- format_string = os2_socket_strerr(ival, tempbuf);
- }
- else
- {
- ival = errno;
- format_string = strerror(ival);
- }
#else /* ifndef _WIN32 */
ival = errno;
#ifdef HAVE_STRERROR
#endif /* def _WIN32 */
-#ifdef __OS2__
-/*********************************************************************
- *
- * Function : os2_socket_strerr
- *
- * Description : Translate the return value from sock_errno()
- * into a string.
- *
- * Parameters :
- * 1 : errcode = The return value from sock_errno().
- * 2 : tmp_buf = A temporary buffer that might be used to
- * store the string.
- *
- * Returns : String representing the error code. This may be
- * a global string constant or a string stored in
- * tmp_buf.
- *
- *********************************************************************/
-static char *os2_socket_strerr(int errcode, char *tmp_buf)
-{
-#define TEXT_FOR_ERROR(code,text) \
- if (errcode == code) \
- { \
- return #code " - " text; \
- }
-
- TEXT_FOR_ERROR(SOCEPERM , "Not owner.")
- TEXT_FOR_ERROR(SOCESRCH , "No such process.")
- TEXT_FOR_ERROR(SOCEINTR , "Interrupted system call.")
- TEXT_FOR_ERROR(SOCENXIO , "No such device or address.")
- TEXT_FOR_ERROR(SOCEBADF , "Bad file number.")
- TEXT_FOR_ERROR(SOCEACCES , "Permission denied.")
- TEXT_FOR_ERROR(SOCEFAULT , "Bad address.")
- TEXT_FOR_ERROR(SOCEINVAL , "Invalid argument.")
- TEXT_FOR_ERROR(SOCEMFILE , "Too many open files.")
- TEXT_FOR_ERROR(SOCEPIPE , "Broken pipe.")
- TEXT_FOR_ERROR(SOCEWOULDBLOCK , "Operation would block.")
- TEXT_FOR_ERROR(SOCEINPROGRESS , "Operation now in progress.")
- TEXT_FOR_ERROR(SOCEALREADY , "Operation already in progress.")
- TEXT_FOR_ERROR(SOCENOTSOCK , "Socket operation on non-socket.")
- TEXT_FOR_ERROR(SOCEDESTADDRREQ , "Destination address required.")
- TEXT_FOR_ERROR(SOCEMSGSIZE , "Message too long.")
- TEXT_FOR_ERROR(SOCEPROTOTYPE , "Protocol wrong type for socket.")
- TEXT_FOR_ERROR(SOCENOPROTOOPT , "Protocol not available.")
- TEXT_FOR_ERROR(SOCEPROTONOSUPPORT, "Protocol not supported.")
- TEXT_FOR_ERROR(SOCESOCKTNOSUPPORT, "Socket type not supported.")
- TEXT_FOR_ERROR(SOCEOPNOTSUPP , "Operation not supported.")
- TEXT_FOR_ERROR(SOCEPFNOSUPPORT , "Protocol family not supported.")
- TEXT_FOR_ERROR(SOCEAFNOSUPPORT , "Address family not supported by protocol family.")
- TEXT_FOR_ERROR(SOCEADDRINUSE , "Address already in use.")
- TEXT_FOR_ERROR(SOCEADDRNOTAVAIL , "Can't assign requested address.")
- TEXT_FOR_ERROR(SOCENETDOWN , "Network is down.")
- TEXT_FOR_ERROR(SOCENETUNREACH , "Network is unreachable.")
- TEXT_FOR_ERROR(SOCENETRESET , "Network dropped connection on reset.")
- TEXT_FOR_ERROR(SOCECONNABORTED , "Software caused connection abort.")
- TEXT_FOR_ERROR(SOCECONNRESET , "Connection reset by peer.")
- TEXT_FOR_ERROR(SOCENOBUFS , "No buffer space available.")
- TEXT_FOR_ERROR(SOCEISCONN , "Socket is already connected.")
- TEXT_FOR_ERROR(SOCENOTCONN , "Socket is not connected.")
- TEXT_FOR_ERROR(SOCESHUTDOWN , "Can't send after socket shutdown.")
- TEXT_FOR_ERROR(SOCETOOMANYREFS , "Too many references: can't splice.")
- TEXT_FOR_ERROR(SOCETIMEDOUT , "Operation timed out.")
- TEXT_FOR_ERROR(SOCECONNREFUSED , "Connection refused.")
- TEXT_FOR_ERROR(SOCELOOP , "Too many levels of symbolic links.")
- TEXT_FOR_ERROR(SOCENAMETOOLONG , "File name too long.")
- TEXT_FOR_ERROR(SOCEHOSTDOWN , "Host is down.")
- TEXT_FOR_ERROR(SOCEHOSTUNREACH , "No route to host.")
- TEXT_FOR_ERROR(SOCENOTEMPTY , "Directory not empty.")
- TEXT_FOR_ERROR(SOCEOS2ERR , "OS/2 Error.")
-
- sprintf(tmp_buf, "(error number %d)", errcode);
- return tmp_buf;
-}
-#endif /* def __OS2__ */
-
-
/*
Local Variables:
tab-width: 3
#include <assert.h>
#ifndef _WIN32
-#ifndef __OS2__
#include <unistd.h>
-#endif /* ndef __OS2__ */
#include <netinet/in.h>
#else
#include <winsock2.h>
#endif /* ndef _WIN32 */
-#ifdef __OS2__
-#include <utils.h>
-#endif /* def __OS2__ */
-
#include "project.h"
#include "filters.h"
#include "encode.h"
#include <netdb.h>
#endif /* def __BEOS__ */
-#ifdef __OS2__
-#include <utils.h>
-#endif /* def __OS2__ */
-
#include "project.h"
#include "jcc.h"
#include "errlog.h"
#else
-#ifndef __OS2__
#include <unistd.h>
-#endif
#include <sys/time.h>
#include <netinet/in.h>
#include <sys/ioctl.h>
#ifndef __BEOS__
#include <netinet/tcp.h>
-#ifndef __OS2__
#include <arpa/inet.h>
-#endif
#else
#include <socket.h>
#endif
-#if defined(__EMX__) || defined (__OS2__)
-#include <sys/select.h> /* OS/2/EMX needs a little help with select */
-#ifdef __OS2__
-#include <nerrno.h>
-#endif
-#endif
-
#endif
#ifdef HAVE_POLL
fd_set wfds;
struct timeval timeout;
#endif
-#if !defined(_WIN32) && !defined(__BEOS__) && !defined(__OS2__)
+#if !defined(_WIN32) && !defined(__BEOS__)
int flags;
#endif
int connect_failed;
if (block_acl(dst, csp))
{
-#ifdef __OS2__
- socket_error = errno = SOCEPERM;
-#else
socket_error = errno = EPERM;
-#endif
continue;
}
#endif /* def FEATURE_ACL */
set_no_delay_flag(fd);
-#if !defined(_WIN32) && !defined(__BEOS__) && !defined(__OS2__)
+#if !defined(_WIN32) && !defined(__BEOS__)
if ((flags = fcntl(fd, F_GETFL, 0)) != -1)
{
flags |= O_NDELAY;
fcntl(fd, F_SETFL, flags);
}
-#endif /* !defined(_WIN32) && !defined(__BEOS__) && !defined(__OS2__) */
+#endif /* !defined(_WIN32) && !defined(__BEOS__) */
connect_failed = 0;
while (connect(fd, rp->ai_addr, rp->ai_addrlen) == JB_INVALID_SOCKET)
{
-#ifdef __OS2__
- errno = sock_errno();
-#endif /* __OS2__ */
-
#ifdef _WIN32
if (errno == WSAEINPROGRESS)
#else /* ifndef _WIN32 */
if (errno == EINPROGRESS)
-#endif /* ndef _WIN32 || __OS2__ */
+#endif /* ndef _WIN32 */
{
break;
}
continue;
}
-#if !defined(_WIN32) && !defined(__BEOS__) && !defined(__OS2__)
+#if !defined(_WIN32) && !defined(__BEOS__)
if (flags != -1)
{
flags &= ~O_NDELAY;
fcntl(fd, F_SETFL, flags);
}
-#endif /* !defined(_WIN32) && !defined(__BEOS__) && !defined(__OS2__) */
+#endif /* !defined(_WIN32) && !defined(__BEOS__) */
#ifdef HAVE_POLL
poll_fd[0].fd = fd;
fd_set wfds;
struct timeval tv[1];
#endif
-#if !defined(_WIN32) && !defined(__BEOS__) && !defined(__OS2__)
+#if !defined(_WIN32) && !defined(__BEOS__)
int flags;
#endif
if (block_acl(dst, csp))
{
-#ifdef __OS2__
- errno = SOCEPERM;
-#else
errno = EPERM;
-#endif
return(JB_INVALID_SOCKET);
}
#endif /* def FEATURE_ACL */
set_no_delay_flag(fd);
-#if !defined(_WIN32) && !defined(__BEOS__) && !defined(__OS2__)
+#if !defined(_WIN32) && !defined(__BEOS__)
if ((flags = fcntl(fd, F_GETFL, 0)) != -1)
{
flags |= O_NDELAY;
mark_socket_for_close_on_execute(fd);
#endif
}
-#endif /* !defined(_WIN32) && !defined(__BEOS__) && !defined(__OS2__) */
+#endif /* !defined(_WIN32) && !defined(__BEOS__) */
while (connect(fd, (struct sockaddr *) & inaddr, sizeof inaddr) == JB_INVALID_SOCKET)
{
#ifdef _WIN32
if (errno == WSAEINPROGRESS)
-#elif __OS2__
- if (sock_errno() == EINPROGRESS)
#else /* ifndef _WIN32 */
if (errno == EINPROGRESS)
-#endif /* ndef _WIN32 || __OS2__ */
+#endif /* ndef _WIN32 */
{
break;
}
-#ifdef __OS2__
- if (sock_errno() != EINTR)
-#else
if (errno != EINTR)
-#endif /* __OS2__ */
{
close_socket(fd);
return(JB_INVALID_SOCKET);
}
}
-#if !defined(_WIN32) && !defined(__BEOS__) && !defined(__OS2__)
+#if !defined(_WIN32) && !defined(__BEOS__)
if (flags != -1)
{
flags &= ~O_NDELAY;
fcntl(fd, F_SETFL, flags);
}
-#endif /* !defined(_WIN32) && !defined(__BEOS__) && !defined(__OS2__) */
+#endif /* !defined(_WIN32) && !defined(__BEOS__) */
#ifdef HAVE_POLL
poll_fd[0].fd = fd;
return (send(fd, buf, (int)len, 0) != (int)len);
#elif defined(__BEOS__)
return (send(fd, buf, len, 0) != len);
-#elif defined(__OS2__)
- /*
- * Break the data up into SOCKET_SEND_MAX chunks for sending...
- * OS/2 seemed to complain when the chunks were too large.
- */
-#define SOCKET_SEND_MAX 65000
- {
- int send_len, send_rc = 0, i = 0;
- while ((i < len) && (send_rc != -1))
- {
- if ((i + SOCKET_SEND_MAX) > len)
- send_len = len - i;
- else
- send_len = SOCKET_SEND_MAX;
- send_rc = send(fd,(char*)buf + i, send_len, 0);
- if (send_rc == -1)
- return 1;
- i = i + send_len;
- }
- return 0;
- }
#else
return (write(fd, buf, len) != len);
#endif
#if defined(_WIN32)
ret = recv(fd, buf, len, 0);
-#elif defined(__BEOS__) || defined(__OS2__)
+#elif defined(__BEOS__)
ret = recv(fd, buf, (size_t)len, 0);
#else
ret = (int)read(fd, buf, (size_t)len);
memset(&timeout, 0, sizeof(timeout));
timeout.tv_sec = seconds_to_wait;
-#ifdef __OS2__
- /* Copy and pasted from jcc.c ... */
- memset(&rfds, 0, sizeof(fd_set));
-#else
FD_ZERO(&rfds);
-#endif
FD_SET(fd, &rfds);
n = select(fd+1, &rfds, NULL, NULL, &timeout);
{
#if defined(_WIN32) || defined(__BEOS__)
closesocket(fd);
-#elif defined(__OS2__)
- soclose(fd);
#else
close(fd);
#endif
struct sockaddr_in server;
struct hostent *host = NULL;
#endif /* HAVE_RFC2553 */
-#if defined(_WIN32) || defined(__OS2__)
+#if defined(_WIN32)
/* according to accept_connection() this fixes a warning. */
int s_length, s_length_provided;
#else
struct sockaddr_in client;
#endif
jb_socket afd;
-#if defined(_WIN32) || defined(__OS2__)
+#if defined(_WIN32)
/* Weirdness - fix a warning. */
int c_length;
#else
#else /* ifndef _WIN32 */
-# if !defined (__OS2__)
# include <unistd.h>
# include <sys/wait.h>
-# endif /* ndef __OS2__ */
# include <sys/time.h>
# include <sys/stat.h>
# include <sys/ioctl.h>
# include <OS.h> /* declarations for threads and stuff. */
# endif
-# if defined(__EMX__) || defined(__OS2__)
-# include <sys/select.h> /* OS/2/EMX needs a little help with select */
-# endif
-# ifdef __OS2__
-#define INCL_DOS
-# include <os2.h>
-# endif
-
#ifdef HAVE_POLL
#ifdef __GLIBC__
#include <sys/poll.h>
int g_terminate = 0;
#endif
-#if !defined(_WIN32) && !defined(__OS2__)
+#if !defined(_WIN32)
static void sig_handler(int the_signal);
#endif
static int client_protocol_is_unsupported(struct client_state *csp, char *req);
#define sleep(N) Sleep(((N) * 1000))
#endif
-#ifdef __OS2__
-#define sleep(N) DosSleep(((N) * 100))
-#endif
-
#ifdef FUZZ
int process_fuzzed_input(char *fuzz_input_type, char *fuzz_input_file);
void show_fuzz_usage(const char *name);
*
* here?
*/
-#if !defined(_WIN32) && !defined(__OS2__)
+#if !defined(_WIN32)
/*********************************************************************
*
* Function : sig_handler
for (;;)
{
#ifndef HAVE_POLL
-#ifdef __OS2__
- /*
- * FD_ZERO here seems to point to an errant macro which crashes.
- * So do this by hand for now...
- */
- memset(&rfds,0x00,sizeof(fd_set));
-#else
FD_ZERO(&rfds);
-#endif
#ifdef FEATURE_CONNECTION_KEEP_ALIVE
if (!watch_client_socket)
{
* are handled when and where they occur without relying
* on a signal.
*/
-#if !defined(_WIN32) && !defined(__OS2__)
+#if !defined(_WIN32)
{
int idx;
const int catched_signals[] = { SIGTERM, SIGINT, SIGHUP };
for (;;)
#endif
{
-#if !defined(FEATURE_PTHREAD) && !defined(_WIN32) && !defined(__BEOS__) && !defined(__OS2__)
+#if !defined(FEATURE_PTHREAD) && !defined(_WIN32) && !defined(__BEOS__)
while (waitpid(-1, NULL, WNOHANG) > 0)
{
/* zombie children */
csp);
#endif
-#if defined(__OS2__) && !defined(SELECTED_ONE_OPTION)
-#define SELECTED_ONE_OPTION
- child_id = _beginthread(
- (void(* _Optlink)(void*))serve,
- NULL,
- 64 * 1024,
- csp);
-#endif
-
#if defined(__BEOS__) && !defined(SELECTED_ONE_OPTION)
#define SELECTED_ONE_OPTION
{
#endif
#include <string.h>
-#if !defined(_WIN32) && !defined(__OS2__)
+#if !defined(_WIN32)
#include <unistd.h>
#endif
#else /* ifndef _WIN32 */
-#ifndef __OS2__
# include <unistd.h>
# include <sys/wait.h>
-#endif
# include <sys/time.h>
# include <sys/stat.h>
# include <signal.h>
*
* On platforms were we use poll() we don't have to enforce
* an upper connection limit either.
- *
- * XXX: Do OS/2 etc. belong here as well?
*/
if (max_client_connections < 1)
{
#include <ctype.h>
#include <assert.h>
-#if !defined(_WIN32) && !defined(__OS2__)
+#if !defined(_WIN32)
#include <unistd.h>
#endif
#include <stdio.h>
#include <sys/types.h>
#include <stdlib.h>
-#if !defined(_WIN32) && !defined(__OS2__)
+#if !defined(_WIN32)
#include <unistd.h>
-#endif /* #if !defined(_WIN32) && !defined(__OS2__) */
+#endif /* #if !defined(_WIN32) */
#include <string.h>
#include <ctype.h>
#include <assert.h>
}
if ((dir == NULL) || (*dir == '\0') /* No directory specified */
-#if defined(_WIN32) || defined(__OS2__)
+#if defined(_WIN32)
|| (*file == '\\') || (file[1] == ':') /* Absolute path (DOS) */
-#else /* ifndef _WIN32 || __OS2__ */
+#else /* ifndef _WIN32 */
|| (*file == '/') /* Absolute path (U*ix) */
-#endif /* ifndef _WIN32 || __OS2__ */
+#endif /* ifndef _WIN32 */
)
{
return strdup(file);
}
assert(NULL != path);
-#if defined(_WIN32) || defined(__OS2__)
+#if defined(_WIN32)
if (path[strlen(path)-1] != '\\')
{
strlcat(path, "\\", path_size);
}
-#else /* ifndef _WIN32 || __OS2__ */
+#else /* ifndef _WIN32 */
if (path[strlen(path)-1] != '/')
{
strlcat(path, "/", path_size);
}
-#endif /* ifndef _WIN32 || __OS2__ */
+#endif /* ifndef _WIN32 */
strlcat(path, file, path_size);
return path;
#elif defined (_WIN32)
Sleep(milliseconds);
- return 0;
-#elif defined(__OS2__)
- DosSleep(milliseconds * 10);
-
return 0;
#else
#warning Missing privoxy_milisleep() implementation. delay-response{} will not work.
#include <brotli/decode.h>
#endif
-#if !defined(_WIN32) && !defined(__OS2__)
+#if !defined(_WIN32)
#include <unistd.h>
#endif
+ strlen(file_name) + strlen(suffix) + 2;
/* Setting delimiter and editing path length */
-#if defined(_WIN32) || defined(__OS2__)
+#if defined(_WIN32)
char delim[] = "\\";
path_size += 1;
-#else /* ifndef _WIN32 || __OS2__ */
+#else /* ifndef _WIN32 */
char delim[] = "/";
-#endif /* ifndef _WIN32 || __OS2__ */
+#endif /* ifndef _WIN32 */
/*
* Building up path from many parts
#include <assert.h>
#include <string.h>
-#if !defined(_WIN32) && !defined(__OS2__)
+#if !defined(_WIN32)
#include <unistd.h>
#endif