--- freem/src/io_socket.c 2025/01/19 02:04:04 1.1 +++ freem/src/io_socket.c 2025/03/24 02:56:15 1.7 @@ -1,23 +1,11 @@ /* - * * - * * * - * * * - * *************** - * * * * * - * * MUMPS * - * * * * * - * *************** - * * * - * * * - * * - * - * io_socket.c + * $Id: io_socket.c,v 1.7 2025/03/24 02:56:15 snw Exp $ * socket i/o support * * - * Author: Serena Willis + * Author: Serena Willis * Copyright (C) 1998 MUG Deutschland - * Copyright (C) 2020 Coherent Logic Development LLC + * Copyright (C) 2020, 2025 Coherent Logic Development LLC * * * This file is part of FreeM. @@ -35,6 +23,25 @@ * You should have received a copy of the GNU Affero Public License * along with FreeM. If not, see . * + * $Log: io_socket.c,v $ + * Revision 1.7 2025/03/24 02:56:15 snw + * Socket I/O compat fixes for OS/2 + * + * Revision 1.6 2025/03/24 02:55:26 snw + * Socket I/O compat fixes for OS/2 + * + * Revision 1.5 2025/03/24 02:54:11 snw + * Socket I/O compat fixes for OS/2 + * + * Revision 1.4 2025/03/22 18:43:54 snw + * Make STRLEN 255 chars and add BIGSTR macro for larger buffers + * + * Revision 1.3 2025/03/09 19:14:25 snw + * First phase of REUSE compliance and header reformat + * + * + * SPDX-FileCopyrightText: (C) 2025 Coherent Logic Development LLC + * SPDX-License-Identifier: AGPL-3.0-or-later **/ #include @@ -84,7 +91,7 @@ io_socket *io_sockets[MAXSCK]; addr_string: server:port[:family:[udp|tcp]]*/ short msck_open (int channel, char *addr_string) { -#if !defined(MSDOS) +#if !defined(MSDOS) && !defined(__OS2__) char *addr = ""; char *port = ""; char *family = ""; @@ -104,7 +111,7 @@ short msck_open (int channel, char *addr short i = channel + FIRSTSCK; /* get index into io_sockets[] array */ - finaddr = (char *) malloc (STRLEN * sizeof (char)); + finaddr = (char *) malloc (256 * sizeof (char)); NULLPTRCHK(finaddr,"msck_open"); @@ -125,10 +132,10 @@ short msck_open (int channel, char *addr if (ct == 1) { - family = (char *) malloc (STRLEN * sizeof (char)); + family = (char *) malloc (256 * sizeof (char)); NULLPTRCHK(family,"msck_open"); - typ = (char *) malloc (STRLEN * sizeof (char)); + typ = (char *) malloc (256 * sizeof (char)); NULLPTRCHK(typ,"msck_open"); strcpy (family, "IPV4"); @@ -138,7 +145,7 @@ short msck_open (int channel, char *addr if (ct == 2) { family = strtok (NULL, ":"); - typ = (char *) malloc (STRLEN * sizeof (char)); + typ = (char *) malloc (256 * sizeof (char)); NULLPTRCHK(typ,"msck_open"); strcpy (typ, "TCP"); @@ -243,7 +250,7 @@ short msck_open (int channel, char *addr short msck_connect (int channel) { -#if !defined(MSDOS) +#if !defined(MSDOS) && !defined(__OS2__) short i = channel + FIRSTSCK; @@ -281,7 +288,7 @@ short msck_connect (int channel) short msck_write (int channel, char *buf, short length) { -#if !defined(MSDOS) +#if !defined(MSDOS) && !defined(__OS2__) ssize_t ct; short i = channel + FIRSTSCK; @@ -316,7 +323,7 @@ short msck_write (int channel, char *buf short msck_read (int channel, char *buf, long sck_timeout, short sck_timeoutms, short length) { -#if !defined(MSDOS) +#if !defined(MSDOS) && !defined(__OS2__) fd_set fds; short i; struct timeval t; @@ -420,7 +427,7 @@ read_done: short msck_close (int channel) { -#if !defined(MSDOS) +#if !defined(MSDOS) && !defined(__OS2__) short i = channel + FIRSTSCK;