'Signal[].Send()' is a new method for sending a signal.
[GB.SIGNAL] * NEW: 'Signal[].Send()' is a new method for sending a signal. It's an alternative syntax to the 'Signal.Send()' method.
This commit is contained in:
parent
7f182bff2f
commit
f0d3f2e8c3
1 changed files with 10 additions and 2 deletions
|
@ -192,7 +192,14 @@ BEGIN_METHOD_VOID(Signal_exit)
|
|||
|
||||
END_METHOD
|
||||
|
||||
BEGIN_METHOD(Signal_Send, GB_INTEGER pid; GB_INTEGER sig)
|
||||
BEGIN_METHOD(Signal_Send, GB_INTEGER pid)
|
||||
|
||||
if (kill(VARG(pid), _signal))
|
||||
GB.Error("Unable to send signal: &1", strerror(errno));
|
||||
|
||||
END_METHOD
|
||||
|
||||
BEGIN_METHOD(Signal_SendOld, GB_INTEGER pid; GB_INTEGER sig)
|
||||
|
||||
if (kill(VARG(pid), VARG(sig)))
|
||||
GB.Error("Unable to send signal: &1", strerror(errno));
|
||||
|
@ -207,6 +214,7 @@ GB_DESC CSignalHandlerDesc[] =
|
|||
GB_STATIC_METHOD("Reset", NULL, Signal_Reset, NULL),
|
||||
GB_STATIC_METHOD("Ignore", NULL, Signal_Ignore, NULL),
|
||||
GB_STATIC_METHOD("Catch", NULL, Signal_Catch, NULL),
|
||||
GB_STATIC_METHOD("Send", NULL, Signal_Send, "(Process)i"),
|
||||
|
||||
GB_END_DECLARE
|
||||
};
|
||||
|
@ -254,7 +262,7 @@ GB_DESC CSignalDesc[] =
|
|||
|
||||
GB_STATIC_METHOD("_get", ".SignalHandler", Signal_get, "(Signal)i"),
|
||||
|
||||
GB_STATIC_METHOD("Send", NULL, Signal_Send, "(Process)i(Signal)i"),
|
||||
GB_STATIC_METHOD("Send", NULL, Signal_SendOld, "(Process)i(Signal)i"),
|
||||
|
||||
GB_END_DECLARE
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue