en:docs:fapi:dosholdsignal

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en:docs:fapi:dosholdsignal [2018/08/31 13:16] – created prokusheven:docs:fapi:dosholdsignal [2021/09/18 11:12] (current) prokushev
Line 1: Line 1:
 +{{page>en:templates:fapiint}}
 +
 +====== DosHoldSignal ======
 +
 This call temporarily disables or enables signal processing for the current process. This call temporarily disables or enables signal processing for the current process.
  
-==Syntax== +===== Syntax ===== 
- DosHoldSignal (ActionCode)+<code c> 
 +DosHoldSignal (ActionCode) 
 +</code>
  
-==Parameters== +===== Parameters ===== 
-;ActionCode (USHORT) - input : Disables or enables signals intended for the current process. + 
- '''Value   Definition''' +  ActionCode (USHORT) - input : Disables or enables signals intended for the current process. 
-     Signals are enabled + 
-     Signals are disabled.+Value Definition ^ 
 +Signals are enabled | 
 +Signals are disabled 
 + 
 +===== Return Code ===== 
 + 
 +rc ([[USHORT]]) - return
  
-==Return Code== 
- rc (USHORT) - return 
 Return code descriptions are: Return code descriptions are:
-* 0  NO_ERROR 
-* 1  ERROR_INVALID_FUNCTION  
  
-==Remarks==+  * 0  NO_ERROR 
 +  * 1  ERROR_INVALID_FUNCTION  
 + 
 +===== Remarks ===== 
 DosHoldSignal with ActionCode = 1 causes signal processing (except central processing errors and numeric processor errors) to be postponed until a DosHoldSignal with ActionCode = 0 is issued. Any signals that occur while processing is disabled are recognized, but not accepted until signal recognition is enabled. DosHoldSignal with ActionCode = 1 causes signal processing (except central processing errors and numeric processor errors) to be postponed until a DosHoldSignal with ActionCode = 0 is issued. Any signals that occur while processing is disabled are recognized, but not accepted until signal recognition is enabled.
  
Line 25: Line 37:
 Signals can be held for a short period and should be released and re-held, if necessary. Their guidelines for proper use are similar to hardware interrupt counterparts such as the CLI/STI instructions. Signals can be held for a short period and should be released and re-held, if necessary. Their guidelines for proper use are similar to hardware interrupt counterparts such as the CLI/STI instructions.
  
-===Family API Considerations===+==== Family API Considerations ===
 Some options operate differently in the DOS mode than in the OS/2 mode. Therefore, the following restriction applies to DosHoldSignal when coding for the DOS mode: Some options operate differently in the DOS mode than in the OS/2 mode. Therefore, the following restriction applies to DosHoldSignal when coding for the DOS mode:
  
 The only signal recognized in the DOS mode is SIGINTR (Ctrl-C) and SIGBREAK. Only SIGINTR and SIGBREAK are turned off by this call. The only signal recognized in the DOS mode is SIGINTR (Ctrl-C) and SIGBREAK. Only SIGINTR and SIGBREAK are turned off by this call.
  
-===C Binding=== +===== Bindings ===== 
-<PRE>+ 
 +==== C Binding ===
 + 
 +<code c>
 #define INCL_DOSSIGNALS #define INCL_DOSSIGNALS
  
Line 39: Line 55:
  
 USHORT           rc;            /* return code */ USHORT           rc;            /* return code */
-</PRE>+</code> 
 + 
 +==== MASM Binding ==== 
 + 
 +<code asm> 
 +EXTRN  DosHoldSignal:FAR 
 +INCL_DOSSIGNALS     EQU 1 
 + 
 +PUSH   WORD    ActionCode    ;Indicate to Disable/Enable Signals 
 +CALL   DosHoldSignal 
 + 
 +Returns NONE 
 +</code> 
 + 
 +===== Example =====
  
-==Example== 
 The following example illustrates the use of the Ctrl-C (SIGINTR) signal to signal time-critical events. Process1 invokes process2, which establishes a signal handler named CtrlC_Handler() and waits, by blocking on a reserved RAM semaphore, for a signal from process1. A portion of process2 is immune to signalling.  The following example illustrates the use of the Ctrl-C (SIGINTR) signal to signal time-critical events. Process1 invokes process2, which establishes a signal handler named CtrlC_Handler() and waits, by blocking on a reserved RAM semaphore, for a signal from process1. A portion of process2 is immune to signalling. 
-<PRE>+ 
 +<code c>
 #define INCL_DOSPROCESS #define INCL_DOSPROCESS
 #define INCL_DOSSIGNALS #define INCL_DOSSIGNALS
Line 142: Line 172:
   printf("Process2 interrupted while waiting, rc is %d.\n", rc);   printf("Process2 interrupted while waiting, rc is %d.\n", rc);
 } }
-</PRE> +</code>
- +
-===MASM Binding=== +
-<PRE> +
-EXTRN  DosHoldSignal:FAR +
-INCL_DOSSIGNALS     EQU 1 +
- +
-PUSH   WORD    ActionCode    ;Indicate to Disable/Enable Signals +
-CALL   DosHoldSignal +
- +
-Returns NONE +
-</PRE> +
- +
  
-====== Note ======+===== Note =====
  
 Text based on [[http://www.edm2.com/index.php/DosHoldSignal]] Text based on [[http://www.edm2.com/index.php/DosHoldSignal]]