YAP 7.1.0
on_signal/3

on_signal(+ Signal,? OldAction,+ Callable) More...

Detailed Description

on_signal(+ Signal,? OldAction,+ Callable)

Set the interrupt handler for soft interrupt Signal to be Callable OldAction is unified with the previous handler

Only a subset of the software interrupts (signals) can have their handlers manipulated through on_signal/3 Their POSIX names, YAP names and default behavior is given below The "YAP name" of the signal is the atom that is associated with each signal, and should be used as the first argument to on_signal/3 It is chosen so that it matches the signal's POSIX name

on_signal/3 succeeds, unless when called with an invalid signal name or one that is not supported on this platform No checks are made on the handler provided by the user

  • sig_up (Hangup) SIGHUP in Unix/Linux; Reconsult the initialization files ~/.yaprc, ~/.prologrc and ~/prolog.ini
  • sig_usr1 and sig_usr2 (User signals) SIGUSR1 and SIGUSR2 in Unix/Linux; Print a message and halt

A special case is made, where if Callable is bound to default, then the default handler is restored for that signal

A call in the form on_signal( _S_, _H_, _H_) can be used to retrieve a signal's current handler without changing it

It must be noted that although a signal can be received at all times, the handler is not executed while YAP is waiting for a query at the

prompt The signal will be, however, registered and dealt with as soon as the user makes a query

Please also note, that neither POSIX Operating Systems nor YAP guarantee that the order of delivery and handling is going to correspond with the order of dispatch


The documentation for this class was generated from the following file: