1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
7 #include "pal_compiler.h"
11 * Initializes the signal handling, called by InitializeTerminalAndSignalHandling.
13 * Returns 1 on success; otherwise returns 0 and sets errno.
15 int32_t InitializeSignalHandlingCore(void);
18 * Hooks up the specified callback for notifications when SIGINT or SIGQUIT is received.
20 * Not thread safe. Caller must provide its owns synchronization to ensure RegisterForCtrl
21 * is not called concurrently with itself or with UnregisterForCtrl.
23 * Should only be called when a callback is not currently registered.
25 DLLEXPORT void SystemNative_RegisterForCtrl(CtrlCallback callback);
28 * Unregisters the previously registered ctrlCCallback.
30 * Not thread safe. Caller must provide its owns synchronization to ensure UnregisterForCtrl
31 * is not called concurrently with itself or with RegisterForCtrl.
33 * Should only be called when a callback is currently registered. The pointer
34 * previously registered must remain valid until all ctrl handling activity
37 DLLEXPORT void SystemNative_UnregisterForCtrl(void);
39 typedef void (*SigChldCallback)(int reapAll);
42 * Hooks up the specified callback for notifications when SIGCHLD is received.
44 * Should only be called when a callback is not currently registered.
46 DLLEXPORT void SystemNative_RegisterForSigChld(SigChldCallback callback);
49 * Remove our handler and reissue the signal to be picked up by the previously registered handler.
51 * In the most common case, this will be the default handler, causing the process to be torn down.
52 * It could also be a custom handler registered by other code before us.
54 DLLEXPORT void SystemNative_RestoreAndHandleCtrl(CtrlCode ctrlCode);
56 typedef void (*TerminalInvalidationCallback)(void);
59 * Hooks up the specified callback for notifications when SIGCHLD, SIGCONT, SIGWINCH are received.
62 DLLEXPORT void SystemNative_SetTerminalInvalidationHandler(TerminalInvalidationCallback callback);