Friday 21 December 2012

Common Unix Signals

NameNumber  Default ActionSemantics
SIGHUP1 TerminateHangup detected on controlling terminal or death of controlling process
SIGINT2 TerminateInterrupt from keyboard. Usually terminate the process. Can be triggered by Ctrl-C
SIGQUIT3  Core dumpQuit from keyboard. Usually causes the process to terminate and dump core. Cab be triggered by Ctrl-\
SIGILL4 Core dumpThe process has executed an illegal hardware instruction.
SIGTRAP5 Core dumpTrace/breakpoint trap. Hardware fault.
SIGABRT6 Core dumpAbort signal from abort(3)
SIGFPE8 Core dumpFloating point exception such as dividing by zero or a floating point overflow.
SIGKILL9 TerminateSure way to terminate (kill) a process. Cannot be caught or ignored.
SIGSEGV11 Core dumpThe process attempted to access an invalid memory reference.
SIGPIPE13 TerminateBroken pipe: Sent to a process writing to a pipe or a socket with no reader (most likely the reader has terminated).
SIGALRM14 TerminateTimer signal from alarm(2)
SIGTERM15 TerminateTermination signal. The kill command send this signal by default, when no explicit signal type is provided.
SIGUSR130,10,16 TerminateFirst user-defined signal, designed to be used by application programs which can freely define its semantics.
SIGUSR231,12,17 TerminateSecond user-defined signal, designed to be used by application programs which can freely define its semantics.
SIGCHLD20,17,18 IgnoreChild stopped or terminated
SIGCONT19,18,25 Continue / IgnoreContinue if stopped
SIGSTOP17,19,23 StopSure way to stop a process: cannot be caught or ignored. Used for non interactive job-control while SIGSTP is the interactive stop signal.
SIGTSTP18,20,24 StopInteractive signal used to suspend process execution. Usually generated by typing Ctrl-Z in a terminal.
SIGTTIN21,21,26 StopA background process attempt to read from its controlling terminal (tty input).
SIGTTOU22,22,27 StopA background process attempt to write to its controlling terminal (tty output).
SIGIO23,29,22 TerminateAsynchronous I/O now event.
SIGBUS10,7,10 Core dumpBus error (bad memory access)
SIGPOLL
 TerminateSignals an event on a pollable device.
SIGPROF27,27,29 TerminateExpiration of a profiling timer set with setitimer.
SIGSYS12,-,12 Core dumpInvalid system call. The Kernel interpreted a processor instruction as a system call, but its argument is invalid.
SIGURG16,23,21 IgnoreUrgent condition on socket (e.g. out-of-band data).
SIGVTALRM26,26,28 TerminateExpiration of a virtual interval timer set with setitimer.
SIGXCPU24,24,30 Core dumpCPU soft time limit exceeded (Resource limits).
SIGXFSZ25,25,31 Core dumpFile soft size limit exceeded (Resource limits).
SIGWINCH28,28,20 IgnoreInforms a process of a change in associated terminal window size.

*) example command:     [ kill -9 3010 ]

*) Few unix system calls:

 *  System calls for low level file I/O
          o creat(name, permissions)
          o open(name, mode)
          o close(fd)
          o unlink(fd)
          o read(fd, buffer, n_to_read)
          o write(fd, buffer, n_to_write)
          o lseek(fd, offest, whence)

    * System Calls for process control
          o fork()
          o wait()
          o execl(), execlp(), execv(), execvp()
          o exit()
          o signal(sig, handler)
          o kill(sig, pid)

    * System Calls for IPC
          o pipe(fildes)
          o dup(fd)

No comments:

Post a Comment