SIGUSR1
Encyclopedia
On POSIX
POSIX
POSIX , an acronym for "Portable Operating System Interface", is a family of standards specified by the IEEE for maintaining compatibility between operating systems...

-compliant platforms, SIGUSR1 and SIGUSR2 are signals
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 a process
Process (computing)
In computing, a process is an instance of a computer program that is being executed. It contains the program code and its current activity. Depending on the operating system , a process may be made up of multiple threads of execution that execute instructions concurrently.A computer program is a...

 to indicate user-defined conditions. The symbolic constants
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 them are 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
Signal.h
signal.h is a header file defined in the C Standard Library to specify how a program handles signals while it executes. A signal can report some exceptional behavior within the program , or a signal can report some asynchronous event outside the program .A signal can be generated...

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

Etymology

SIG is a common prefix for signal names. USR is an abbreviation for user-defined.

Usage

Along with the realtime signals SIGRTMIN through SIGRTMAX, the semantics of SIGUSR1 and SIGUSR2 are not specified by POSIX. Use varies widely from one application to another.

Many applications use USR1 to synchronize internal data between threads and processes, for example by the obsolete LinuxThreads
LinuxThreads
In the Linux operating system, LinuxThreads was a partial implementation of POSIX Threads that has since been superseded by the Native POSIX Thread Library ....

 threading library under Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

 2.0 (superseded by the Native POSIX Thread Library
Native POSIX Thread Library
The Native POSIX Thread Library is a software feature that enables the Linux kernel to run programs written to use POSIX Threads efficiently.-History:...

). Other applications, such as some Versions of dd
Dd (Unix)
In computing, dd is a common Unix program whose primary purpose is the low-level copying and conversion of raw data. According to the manual page for Version 7 Unix, it will "convert and copy a file". It is used to copy a specified number of bytes or blocks, performing on-the-fly byte order...

, will print status when given this signal (BSD-derived systems use 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...

 for this purpose). USR1 is also often used to tell an application to reload config files; for example, sending the Apache HTTP Server
Apache HTTP Server
The Apache HTTP Server, commonly referred to as Apache , is web server software notable for playing a key role in the initial growth of the World Wide Web. In 2009 it became the first web server software to surpass the 100 million website milestone...

a USR1, will ask the server to stop allowing new connections, wait for the current ones to die, reread the config files, re-open its log files, and restart the server, allowing for relatively smooth in-production changes.

See also

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK