--- freem/src/service.c	2025/02/25 18:53:14	1.2
+++ freem/src/service.c	2025/03/24 01:54:09	1.9
@@ -1,24 +1,12 @@
 /*
- *                            *
- *                           * *
- *                          *   *
- *                     ***************
- *                      * *       * *
- *                       *  MUMPS  *
- *                      * *       * *
- *                     ***************
- *                          *   *
- *                           * *
- *                            *
- *
- *   service.c
+ *   $Id: service.c,v 1.9 2025/03/24 01:54:09 snw Exp $
  *    terminal and sequential I/O handling,
  *    file and global locking
  *
  *  
- *   Author: Serena Willis <jpw@coherent-logic.com>
+ *   Author: Serena Willis <snw@coherent-logic.com>
  *    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.
@@ -36,6 +24,19 @@
  *   You should have received a copy of the GNU Affero Public License
  *   along with FreeM.  If not, see <https://www.gnu.org/licenses/>.
  *
+ *   $Log: service.c,v $
+ *   Revision 1.9  2025/03/24 01:54:09  snw
+ *   Work around some OS/2 incompatibilities in set_break and set_zbreak
+ *
+ *   Revision 1.8  2025/03/24 01:52:30  snw
+ *   Work around some OS/2 incompatibilities in set_break and set_zbreak
+ *
+ *   Revision 1.7  2025/03/09 19:50:47  snw
+ *   Second phase of REUSE compliance and header reformat
+ *
+ *
+ * SPDX-FileCopyrightText:  (C) 2025 Coherent Logic Development LLC
+ * SPDX-License-Identifier: AGPL-3.0-or-later
  **/
 
 #include <errno.h>
@@ -65,20 +66,30 @@
 #include "events.h"
 
 long int tell ();
-unsigned alarm ();
-void    ris ();
-
+void ris (struct vtstyp *scr);
 
 #ifdef SCO
 int scosgr (short att, short bwflag);
 #endif
 
 /* system services */
-#if defined(__sun) || defined(__FreeBSD__) || defined(__NetBSD__)
-# include <termio.h>
+#if !defined(__APPLE__) && !defined(__gnu_hurd__) && !defined(EMSCRIPTEN)
+# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__AMIGA)
+#  include <termios.h>
+#  if !defined(__AMIGA)
+#   define TCGETA TIOCGETA
+#   define TCSETA TIOCSETA
+#  endif
+#  define termio termios
+# else
+#  if !defined(MSDOS)
+#    include <termio.h>
+#  endif
+# endif
 #else
 # include <termios.h>
 #endif
+
 #include <fcntl.h>
 
 /* search 'string' for occurence of 'pattrn'
@@ -3356,7 +3367,7 @@ void write_t (short int col)
 
 }					/* end of write_t() */
 
-void ontimo ()
+void ontimo (void)
 {					/* handle timeout (for read) */
     longjmp (sjbuf, 1);
 }					/* end of ontimo() */
@@ -4426,6 +4437,7 @@ void set_io (short action)
 /*  DEL = UNIX quit      */ 
 void set_break (short break_char)
 {
+#if !defined(__OS2__)
     struct termio arg;
 
     ioctl (0, TCGETA, &arg);
@@ -4433,7 +4445,7 @@ void set_break (short break_char)
     arg.c_cc[VINTR] = break_char;	/* interrupt = CTRL/C   */
     
     ioctl (0, TCSETA, &arg);
-    
+#endif    
     return;
 
 }					/* end of set_break() */
@@ -4444,6 +4456,7 @@ void set_break (short break_char)
 /* DEL = UNIX quit      */
 void set_zbreak (short quit_char)
 {
+#if !defined(__OS2__)    
     struct termio arg;
 
     ioctl (0, TCGETA, &arg);
@@ -4451,7 +4464,7 @@ void set_zbreak (short quit_char)
     arg.c_cc[VQUIT] = quit_char;
     
     ioctl (0, TCSETA, &arg);
-    
+#endif    
     return;
 
 }					/* end of set_zbreak() */
@@ -4496,6 +4509,8 @@ void set_io (short action)				/* set io_
 
 void set_break (short break_char)
 {
+
+#if !defined(__OS2__)
     struct termios termios_p;
 
     tcgetattr (0, &termios_p);
@@ -4503,14 +4518,14 @@ void set_break (short break_char)
     termios_p.c_cc[VINTR] = break_char;	/* interrupt = CTRL/C   */
     
     tcsetattr (0, TCSADRAIN, &termios_p);	/* set paramters */
-    
+#endif    
     return;
 
 }					/* end of set_break() */
 
 void set_zbreak (short quit_char)
 {
-
+#if !defined(__OS2__)
     struct termios termios_p;
 
     tcgetattr (0, &termios_p);
@@ -4518,7 +4533,7 @@ void set_zbreak (short quit_char)
     termios_p.c_cc[VQUIT] = quit_char;
     
     tcsetattr (0, TCSADRAIN, &termios_p);	/* set paramters */
-    
+#endif    
     return;
 
 }					/* end of set_zbreak() */