SIGPIPE

SIGPIPE

Infobox Computing signal
description = Write on a pipe with no one to read it
action = Abnormal termination of the process
On POSIX-compliant platforms, SIGPIPE is the signal raised when a computer program attempts to write to a pipe without a process connected to the other end. The symbolic constant for SIGPIPE is defined in the header file signal.h. Symbolic signal names are used because signal numbers can vary across platforms.

Etymology

"SIG" is a common prefix for signal names. "PIPE" refers to the Unix pipe.

Description

Unix supports the principle of piping, which allows processes to send data to other processes without the need for creating temporary files. When a pipe is broken, the process writing to it is sent the SIGPIPE signal. The default reaction to this signal for a process is to terminate.

A simple example of piping is the following. ps l | headThis command, when run on a Unix-like machine (including Linux), returns a list of processes, limited to ten lines.
* ps l returns a list of all processes (including those of other users).
* head selects the first ten lines.

When ps has written ten lines, head has received all it needs and exits. ps will receive a SIGPIPE when it tries to write the remaining lines, causing it to terminate as well: It is no use writing data that no one will use. It is also possible that the reading process terminates while reading the data. This will also cause SIGPIPE to be sent to the writing process.

One can ignore SIGPIPE (using, for example, the signal system call). In this case, all system calls that would cause SIGPIPE to be sent will return -1 and set errno to EPIPE.


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать курсовую

Look at other dictionaries:

  • SIGPIPE — Описание: запись в разорванное соединение По умолчанию: завершение процесса коды SA SIGINFO (не имеет специфических кодов) В POSIX системах, SIGPIPE  сигнал, посылаемый процессу при записи в соединение (пайп, сокет) при отсутствии или… …   Википедия

  • SIGPIPE — Pipe Fehler Signal (Signal Nr. 13) unter X/Open UNIX wird normalerweise erzeugt, wenn auf eine Pipe geschrieben wird, bei der der lesende Prozess fehlt ( >xedit /usr/include/signal.h) …   Acronyms

  • SIGPIPE — Pipe Fehler Signal (Signal Nr. 13) unter X/Open UNIX wird normalerweise erzeugt, wenn auf eine Pipe geschrieben wird, bei der der lesende Prozess fehlt ( >xedit /usr/include/signal.h) …   Acronyms von A bis Z

  • TTY-абстракция — Стиль этой статьи неэнциклопедичен или нарушает нормы русского языка. Статью следует исправить согласно стилистическим правилам Википедии. У этого термина существуют и другие значения, см. Tty. Подсистема TTY, или TTY абстракция  это одна из …   Википедия

  • Q (programming language) — Infobox programming language name = Q logo = paradigm = multiparadigm: functional, object oriented year = designer = Albert Gräf developer = latest release version = 7.5 latest release date = September 12, 2006 typing = dynamic, strong… …   Wikipedia

  • 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 …   Wikipedia

  • Señal (informática) — Una señal (signal) es una forma limitada de comunicación entre procesos empleada en Unix y otros sistemas operativos compatibles con POSIX. En esencia es una notificación asíncrona enviada a un proceso para informarle de un evento. Cuando se le… …   Wikipedia Español

  • SIGQUIT — Ein Signal ist eine Systemnachricht an einen laufenden Prozess. Signale sind eine primitive Form von Interprozesskommunikation. Die meisten Signale bewirken auch eine Aktion – meist das Beenden des Prozesses. Andere hingegen dienen lediglich der… …   Deutsch Wikipedia

  • SIGTSTP — Ein Signal ist eine Systemnachricht an einen laufenden Prozess. Signale sind eine primitive Form von Interprozesskommunikation. Die meisten Signale bewirken auch eine Aktion – meist das Beenden des Prozesses. Andere hingegen dienen lediglich der… …   Deutsch Wikipedia

  • Signal (Computer) — Ein Signal ist eine Systemnachricht an einen laufenden Prozess. Signale sind eine primitive Form von Interprozesskommunikation. Die meisten Signale bewirken auch eine Aktion – meist das Beenden des Prozesses. Andere hingegen dienen lediglich der… …   Deutsch Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”