SIGPWR
Encyclopedia
On some Unix-like
Unix-like
A Unix-like operating system is one that behaves in a manner similar to a Unix system, while not necessarily conforming to or being certified to any version of the Single UNIX Specification....

 platforms, SIGPWR is the signal
Signal (computing)
A signal is a limited form of inter-process communication used in Unix, Unix-like, and other POSIX-compliant operating systems. Essentially it is an asynchronous notification sent to a process in order to notify it of an event that occurred. When a signal is sent to a process, the operating system...

 sent to computer program
Computer program
A computer program is a sequence of instructions written to perform a specified task with a computer. A computer requires programs to function, typically executing the program's instructions in a central processor. The program has an executable form that the computer can use directly to execute...

s when the system experiences a power failure. The symbolic constant
C preprocessor
The C preprocessor is the preprocessor for the C and C++ computer programming languages. The preprocessor handles directives for source file inclusion , macro definitions , and conditional inclusion ....

 for SIGPWR is defined in the header file
Header file
Some programming languages use header files. These files allow programmers to separate certain elements of a program's source code into reusable files. Header files commonly contain forward declarations of classes, subroutines, variables, and other identifiers...

 signal.h. Symbolic signal names are used because signal numbers can vary across platforms.

On some versions of Linux, SIGINFO
SIGINFO
On some Unix-like platforms, SIGINFO is the signal sent to computer programs when a status request is received from the keyboard. The symbolic constant for SIGINFO is defined in the header file signal.h...

 is defined as a synonym for SIGPWR, however this is not consistent even between different Linux platforms (most Linux systems do not define SIGINFO at all).

Etymology

SIG is a common prefix for signal names. PWR is an abbreviation for power. INFO refers to the system informing processes of a critical situation.

Usage

SIGPWR is sent when a power failure is imminent; for example, when the battery
Battery (electricity)
An electrical battery is one or more electrochemical cells that convert stored chemical energy into electrical energy. Since the invention of the first battery in 1800 by Alessandro Volta and especially since the technically improved Daniell cell in 1836, batteries have become a common power...

 is running low on a laptop
Laptop
A laptop, also called a notebook, is a personal computer for mobile use. A laptop integrates most of the typical components of a desktop computer, including a display, a keyboard, a pointing device and speakers into a single unit...

 or a power failure occurs. Upon receiving SIGPWR, an executing program has the opportunity to write its state to permanent storage.

On some operating systems, the Boehm garbage collector
Boehm garbage collector
In computer science, the Boehm-Demers-Weiser garbage collector, often simply known as Boehm GC, is a conservative garbage collector for C and C++.Boehm GC is free software distributed under a permissive free software licence similar to the X11 license....

 uses SIGXCPU
SIGXCPU
On POSIX-compliant platforms, SIGXCPU is the signal that is sent to a process when it has used up the CPU for a duration that exceeds a certain predetermined user-settable value....

and SIGPWR to synchronise cross-thread garbage collection.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK