Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
en:docs:fapi:dosholdsignal [2018/08/31 13:16] – created prokushev | en:docs:fapi:dosholdsignal [2021/09/18 11:12] (current) – prokushev | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | {{page> | ||
+ | |||
+ | ====== 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 |
- | | + | <code c> |
+ | DosHoldSignal (ActionCode) | ||
+ | </ | ||
- | ==Parameters== | + | ===== Parameters ===== |
- | ;ActionCode (USHORT) - input : Disables or enables signals intended for the current process. | + | |
- | ''' | + | |
- | | + | |
- | | + | ^ Value ^ Definition |
+ | | 0 | Signals are enabled | ||
+ | | 1 | 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 | USHORT | ||
- | </PRE> | + | </code> |
+ | |||
+ | ==== MASM Binding ==== | ||
+ | |||
+ | <code asm> | ||
+ | EXTRN DosHoldSignal: | ||
+ | INCL_DOSSIGNALS | ||
+ | |||
+ | PUSH | ||
+ | CALL | ||
+ | |||
+ | Returns NONE | ||
+ | </ | ||
+ | |||
+ | ===== 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(" | printf(" | ||
} | } | ||
- | </PRE> | + | </code> |
- | + | ||
- | ===MASM Binding=== | + | |
- | < | + | |
- | EXTRN DosHoldSignal: | + | |
- | INCL_DOSSIGNALS | + | |
- | + | ||
- | PUSH | + | |
- | CALL | + | |
- | + | ||
- | Returns NONE | + | |
- | </ | + | |
- | + | ||
- | ====== Note ====== | + | ===== Note ===== |
Text based on [[http:// | Text based on [[http:// |