signal {fork}R Documentation

Enable or disable handling of signals

Description

This function allows enabling or disabling handling of the specified signal.

Usage

signal(signal, action = c("ignore", "default"))

Arguments

signal Signal handler to manipulate, either as a numeric id or character mnemonic
action Either "ignore" or "default"

Details

It is occasionally necessary to instruct the R process to ignore certain signals. This function allows changing the status of a signal to either igore the signal (SIG_IGN="ignore") or to the OS's default handler (SIG_DFL="default")

Value

Nothing of interest.

Note

Be very careful with this function. It can be used to totally confuse the R process.

Author(s)

Gregory R. Warnes gregory.warnes@rochester.edu

References

See the unix man page for "signal" for more information

See Also

sigval, fork

Examples

## Not run: 
# Ignore child termination signals for forked processes
signal("SIGCHLD","ignore")

# Fork off a child process to say "Hi!".
 {
    pid = fork(slave=NULL) 
    if(pid==0) {
      # only runs in the child process
      cat("Hi from the child process!\n");
      exit() # force process to die
    } 
 } 
## End(Not run)

[Package fork version 1.1.0 Index]