.\" -*- coding: UTF-8 -*- '\" t .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de) .\" and Copyright (c) 2002, 2006, 2020 by Michael Kerrisk .\" and Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk .\" .\" .\" SPDX-License-Identifier: Linux-man-pages-copyleft .\" .\" Modified Sat Jul 24 17:34:08 1993 by Rik Faith (faith@cs.unc.edu) .\" Modified Sun Jan 7 01:41:27 1996 by Andries Brouwer (aeb@cwi.nl) .\" Modified Sun Apr 14 12:02:29 1996 by Andries Brouwer (aeb@cwi.nl) .\" Modified Sat Nov 13 16:28:23 1999 by Andries Brouwer (aeb@cwi.nl) .\" Modified 10 Apr 2002, by Michael Kerrisk .\" Modified 7 Jun 2002, by Michael Kerrisk .\" Added information on real-time signals .\" Modified 13 Jun 2002, by Michael Kerrisk .\" Noted that SIGSTKFLT is in fact unused .\" 2004-12-03, Modified mtk, added notes on RLIMIT_SIGPENDING .\" 2006-04-24, mtk, Added text on changing signal dispositions, .\" signal mask, and pending signals. .\" 2008-07-04, mtk: .\" Added section on system call restarting (SA_RESTART) .\" Added section on stop/cont signals interrupting syscalls. .\" 2008-10-05, mtk: various additions .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH signal 7 "3. dubna 2023" "Linux man\-pages 6.05.01" .SH JMÉNO signal \- overview of signals .SH POPIS V Linuxu jsou podporovány jak POSIX reliable signály (dále jen "standardní signály"), tak POSIX real\-time signály. .SS "Dispozice signálů" Každý signál má \fIdispozici\fP, která určuje, jak se proces zachová při jeho přijetí. .PP Údaje ve sloupci "Akce" níže uvedených tabulek určují výchozí dipozici každého signálu následujícně: .TP Term Výchozí akcí je ukončení procesu. .TP Ign Výchozí akcí je ignorování signálu. .TP Core Výchozí akcí je ukončení procesu a výpis paměti (core dump) (viz \fBcore\fP(5)). .TP Stop Výchozí akcí je zastavení procesu. .TP Cont Výchozí akcí je pokračování procesu, pokud je momentálně zastavený. .PP A process can change the disposition of a signal using \fBsigaction\fP(2) or \fBsignal\fP(2). (The latter is less portable when establishing a signal handler; see \fBsignal\fP(2) for details.) Using these system calls, a process can elect one of the following behaviors to occur on delivery of the signal: perform the default action; ignore the signal; or catch the signal with a \fIsignal handler\fP, a programmer\-defined function that is automatically invoked when the signal is delivered. .PP By default, a signal handler is invoked on the normal process stack. It is possible to arrange that the signal handler uses an alternate stack; see \fBsigaltstack\fP(2) for a discussion of how to do this and when it might be useful. .PP Dispozice signálu je atribut procesu: v mnohovláknových aplikacích je dispozice určitého signálu stejná pro všechna vlákna. .PP A child created via \fBfork\fP(2) inherits a copy of its parent's signal dispositions. During an \fBexecve\fP(2), the dispositions of handled signals are reset to the default; the dispositions of ignored signals are left unchanged. .SS "Sending a signal" The following system calls and library functions allow the caller to send a signal: .TP \fBraise\fP(3) Sends a signal to the calling thread. .TP \fBkill\fP(2) Sends a signal to a specified process, to all members of a specified process group, or to all processes on the system. .TP \fBpidfd_send_signal\fP(2) Sends a signal to a process identified by a PID file descriptor. .TP \fBkillpg\fP(3) Sends a signal to all of the members of a specified process group. .TP \fBpthread_kill\fP(3) Sends a signal to a specified POSIX thread in the same process as the caller. .TP \fBtgkill\fP(2) Sends a signal to a specified thread within a specific process. (This is the system call used to implement \fBpthread_kill\fP(3).) .TP \fBsigqueue\fP(3) Sends a real\-time signal with accompanying data to a specified process. .SS "Waiting for a signal to be caught" The following system calls suspend execution of the calling thread until a signal is caught (or an unhandled signal terminates the process): .TP \fBpause\fP(2) Suspends execution until any signal is caught. .TP \fBsigsuspend\fP(2) .\" Temporarily changes the signal mask (see below) and suspends execution until one of the unmasked signals is caught. .SS "Synchronously accepting a signal" Rather than asynchronously catching a signal via a signal handler, it is possible to synchronously accept the signal, that is, to block execution until the signal is delivered, at which point the kernel returns information about the signal to the caller. There are two general ways to do this: .IP \[bu] 3 \fBsigwaitinfo\fP(2), \fBsigtimedwait\fP(2), and \fBsigwait\fP(3) suspend execution until one of the signals in a specified set is delivered. Each of these calls returns information about the delivered signal. .IP \[bu] \fBsignalfd\fP(2) returns a file descriptor that can be used to read information about signals that are delivered to the caller. Each \fBread\fP(2) from this file descriptor blocks until one of the signals in the set specified in the \fBsignalfd\fP(2) call is delivered to the caller. The buffer returned by \fBread\fP(2) contains a structure describing the signal. .SS "Signal mask and pending signals" A signal may be \fIblocked\fP, which means that it will not be delivered until it is later unblocked. Between the time when it is generated and when it is delivered a signal is said to be \fIpending\fP. .PP Each thread in a process has an independent \fIsignal mask\fP, which indicates the set of signals that the thread is currently blocking. A thread can manipulate its signal mask using \fBpthread_sigmask\fP(3). In a traditional single\-threaded application, \fBsigprocmask\fP(2) can be used to manipulate the signal mask. .PP A child created via \fBfork\fP(2) inherits a copy of its parent's signal mask; the signal mask is preserved across \fBexecve\fP(2). .PP A signal may be process\-directed or thread\-directed. A process\-directed signal is one that is targeted at (and thus pending for) the process as a whole. A signal may be process\-directed because it was generated by the kernel for reasons other than a hardware exception, or because it was sent using \fBkill\fP(2) or \fBsigqueue\fP(3). A thread\-directed signal is one that is targeted at a specific thread. A signal may be thread\-directed because it was generated as a consequence of executing a specific machine\-language instruction that triggered a hardware exception (e.g., \fBSIGSEGV\fP for an invalid memory access, or \fBSIGFPE\fP for a math error), or because it was targeted at a specific thread using interfaces such as \fBtgkill\fP(2) or \fBpthread_kill\fP(3). .PP .\" Joseph C. Sible notes: .\" On Linux, if the main thread has the signal unblocked, then the kernel .\" will always deliver the signal there, citing this kernel code .\" .\" Per this comment in kernel/signal.c since time immemorial: .\" .\" /* .\" * Now find a thread we can wake up to take the signal off the queue. .\" * .\" * If the main thread wants the signal, it gets first crack. .\" * Probably the least surprising to the average bear. .\" */ .\" .\" But this does not mean the signal will be delivered only in the .\" main thread, since if a handler is already executing in the main thread .\" (and thus the signal is blocked in that thread), then a further .\" might be delivered in a different thread. .\" A process\-directed signal may be delivered to any one of the threads that does not currently have the signal blocked. If more than one of the threads has the signal unblocked, then the kernel chooses an arbitrary thread to which to deliver the signal. .PP A thread can obtain the set of signals that it currently has pending using \fBsigpending\fP(2). This set will consist of the union of the set of pending process\-directed signals and the set of signals pending for the calling thread. .PP .\" A child created via \fBfork\fP(2) initially has an empty pending signal set; the pending signal set is preserved across an \fBexecve\fP(2). .SS "Execution of signal handlers" Whenever there is a transition from kernel\-mode to user\-mode execution (e.g., on return from a system call or scheduling of a thread onto the CPU), the kernel checks whether there is a pending unblocked signal for which the process has established a signal handler. If there is such a pending signal, the following steps occur: .IP (1) 5 The kernel performs the necessary preparatory steps for execution of the signal handler: .RS .IP (1.1) 7 The signal is removed from the set of pending signals. .IP (1.2) If the signal handler was installed by a call to \fBsigaction\fP(2) that specified the \fBSA_ONSTACK\fP flag and the thread has defined an alternate signal stack (using \fBsigaltstack\fP(2)), then that stack is installed. .IP (1.3) Various pieces of signal\-related context are saved into a special frame that is created on the stack. The saved information includes: .RS .IP \[bu] 3 the program counter register (i.e., the address of the next instruction in the main program that should be executed when the signal handler returns); .IP \[bu] architecture\-specific register state required for resuming the interrupted program; .IP \[bu] the thread's current signal mask; .IP \[bu] the thread's alternate signal stack settings. .RE .IP (If the signal handler was installed using the \fBsigaction\fP(2) \fBSA_SIGINFO\fP flag, then the above information is accessible via the \fIucontext_t\fP object that is pointed to by the third argument of the signal handler.) .IP (1.4) Any signals specified in \fIact\->sa_mask\fP when registering the handler with \fBsigprocmask\fP(2) are added to the thread's signal mask. The signal being delivered is also added to the signal mask, unless \fBSA_NODEFER\fP was specified when registering the handler. These signals are thus blocked while the handler executes. .RE .IP (2) The kernel constructs a frame for the signal handler on the stack. The kernel sets the program counter for the thread to point to the first instruction of the signal handler function, and configures the return address for that function to point to a piece of user\-space code known as the signal trampoline (described in \fBsigreturn\fP(2)). .IP (3) The kernel passes control back to user\-space, where execution commences at the start of the signal handler function. .IP (4) When the signal handler returns, control passes to the signal trampoline code. .IP (5) The signal trampoline calls \fBsigreturn\fP(2), a system call that uses the information in the stack frame created in step 1 to restore the thread to its state before the signal handler was called. The thread's signal mask and alternate signal stack settings are restored as part of this procedure. Upon completion of the call to \fBsigreturn\fP(2), the kernel transfers control back to user space, and the thread recommences execution at the point where it was interrupted by the signal handler. .PP Note that if the signal handler does not return (e.g., control is transferred out of the handler using \fBsiglongjmp\fP(3), or the handler executes a new program with \fBexecve\fP(2)), then the final step is not performed. In particular, in such scenarios it is the programmer's responsibility to restore the state of the signal mask (using \fBsigprocmask\fP(2)), if it is desired to unblock the signals that were blocked on entry to the signal handler. (Note that \fBsiglongjmp\fP(3) may or may not restore the signal mask, depending on the \fIsavesigs\fP value that was specified in the corresponding call to \fBsigsetjmp\fP(3).) .PP .\" From the kernel's point of view, execution of the signal handler code is exactly the same as the execution of any other user\-space code. That is to say, the kernel does not record any special state information indicating that the thread is currently executing inside a signal handler. All necessary state information is maintained in user\-space registers and the user\-space stack. The depth to which nested signal handlers may be invoked is thus limited only by the user\-space stack (and sensible software design!). .SS "Standardní Signály" Linux supports the standard signals listed below. The second column of the table indicates which standard (if any) specified the signal: "P1990" indicates that the signal is described in the original POSIX.1\-1990 standard; "P2001" indicates that the signal was added in SUSv2 and POSIX.1\-2001. .TS l c c l ____ lB c c l. Signál Standard Akce Poznámka SIGABRT P1990 Core "Abort" \- ukončení funkcí \fBabort\fP(3) SIGALRM P1990 Term Signál od časovače, nastaveného funkcí \fBalarm\fP(1) SIGBUS P2001 Core "Bus error" \- pokus o přístup mimo mapovanou paměť SIGCHLD P1990 Ign Zastavení nebo ukončení dětského procesu SIGCLD \- Ign Synonymum \fBSIGCHLD\fP SIGCONT P1990 Cont Pokračování po zastavení SIGEMT \- Term Emulator trap SIGFPE P1990 Core "Floating point exception" \- přetečení v pohyblivé řádové čárce SIGHUP P1990 Term "Hangup" \- při zavěšení na řídícím terminálu nebo ukončení řídícího procesu SIGILL P1990 Core "Illegal Instruction" \- neplatná instrukce SIGINFO \- Synonymum \fBSIGPWR\fP SIGINT P1990 Term "Interrupt" \- přerušení z klávesnice SIGIO \- Term Lze pokračovat ve vstupu/výstupu (4.2 BSD) SIGIOT \- Core IOT \- synonymum signálu \fBSIGABRT\fP SIGKILL P1990 Term "Kill" \- signál pro nepodmíněné ukončení procesu SIGLOST \- Term Zámek souboru byl ztracen (nepoužívá se) SIGPIPE P1990 Term "Broken pipe" \- pokus o zápis do roury, readers; see \fBpipe\fP(7) SIGPOLL P2001 Term Pollable event (Sys V); Synonymum \fBSIGIO\fP SIGPROF P2001 Term Časovač používaný při profilování SIGPWR \- Term Výpadek napájení (Systém V) SIGQUIT P1990 Core "Quit" \- ukončení z klávesnice SIGSEGV P1990 Core Odkaz na nepřípustnou adresu v paměti SIGSTKFLT \- Term Chyba zásobníku koprocesoru (nepoužívá se) SIGSTOP P1990 Stop Zastavení procesu SIGTSTP P1990 Stop Stop typed at terminal SIGSYS P2001 Core Bad system call (SVr4); see also \fBseccomp\fP(2) SIGTERM P1990 Term "Termination" \- signál ukončení SIGTRAP P2001 Core Přerušení při ladění (trasování,breakpoint) SIGTTIN P1990 Stop Terminal input for background process SIGTTOU P1990 Stop Terminal output for background process SIGUNUSED \- Core Synonymous with \fBSIGSYS\fP SIGURG P2001 Ign Soket přijal data s příznakem Urgent (4.2 BSD) SIGUSR1 P1990 Term Signál 1 definovaný uživatelem SIGUSR2 P1990 Term Signál 2 definovaný uživatelem SIGVTALRM P2001 Term Virtuální časovač (4.2 BSD) SIGXCPU P2001 Core Překročen limit času CPU (4.2 BSD); viz \fBsetrlimit\fP(2) SIGXFSZ P2001 Core Překročen limit velikosti souboru (4.2 BSD); viz \fBsetrlimit\fP(2) SIGWINCH \- Ign Změna velikosti okna (4.3 BSD, Sun) .TE .PP Signály \fBSIGKILL\fP a \fBSIGSTOP\fP nemohou být zachyceny, blokovány ani ignorovány. .PP Až po Linux 2.2 včetně bylo výchozí chování pro \fBSIGSYS\fP, \fBSIGXCPU\fP, \fBSIGXFSZ\fP, a (na architekturách jiných než SPARC a MIPS) \fBSIGBUS\fP ukončit proces (bez core dump). (Na některých jiných UNIXových systémech bylo výchozí akcí pro \fBSIGXCPU\fP a \fBSIGXFSZ\fP ukončení procesu bez core dump.) Linux 2.4 splňuje požadavky POSIX.1\-2001 pro tyto signály, ukončuje procesy s core dump. .PP \fBSIGEMT\fP není specifikován v POSIX.1\-2001, ale stejně je přítomen na většině ostatních UNIXových systémů, kde je výchozí akcí obvykle ukončení procesu s core dump. .PP \fBSIGPWR\fP (není specifikován v POSIX.1\-2001) na většině ostatních UNIXových systémů, kde se objevuje, je obvykle ignorován. .PP .\" \fBSIGIO\fP (není specifikován v POSIX.1\-2001) na některých dalších UNIXech je jako výchozí ignorován. .SS "Queueing and delivery semantics for standard signals" If multiple standard signals are pending for a process, the order in which the signals are delivered is unspecified. .PP .\" Standard signals do not queue. If multiple instances of a standard signal are generated while that signal is blocked, then only one instance of the signal is marked as pending (and the signal will be delivered just once when it is unblocked). In the case where a standard signal is already pending, the \fIsiginfo_t\fP structure (see \fBsigaction\fP(2)) associated with that signal is not overwritten on arrival of subsequent instances of the same signal. Thus, the process will receive the information associated with the first instance of the signal. .SS "Signal numbering for standard signals" The numeric value for each signal is given in the table below. As shown in the table, many signals have different numeric values on different architectures. The first numeric value in each table row shows the signal number on x86, ARM, and most other architectures; the second value is for Alpha and SPARC; the third is for MIPS; and the last is for PARISC. A dash (\-) denotes that a signal is absent on the corresponding architecture. .TS l c c c c l l c c c c l ______ lB c c c c l. Signál x86/ARM Alpha/ MIPS PARISC Poznámky most others SPARC SIGHUP \01 \01 \01 \01 SIGINT \02 \02 \02 \02 SIGQUIT \03 \03 \03 \03 SIGILL \04 \04 \04 \04 SIGTRAP \05 \05 \05 \05 SIGABRT \06 \06 \06 \06 SIGIOT \06 \06 \06 \06 SIGBUS \07 10 10 10 SIGEMT \- \07 \07 \- SIGFPE \08 \08 \08 \08 SIGKILL \09 \09 \09 \09 SIGUSR1 10 30 16 16 SIGSEGV 11 11 11 11 SIGUSR2 12 31 17 17 SIGPIPE 13 13 13 13 SIGALRM 14 14 14 14 SIGTERM 15 15 15 15 SIGSTKFLT 16 \- \- \07 SIGCHLD 17 20 18 18 SIGCLD \- \- 18 \- SIGCONT 18 19 25 26 SIGSTOP 19 17 23 24 SIGTSTP 20 18 24 25 SIGTTIN 21 21 26 27 SIGTTOU 22 22 27 28 SIGURG 23 16 21 29 SIGXCPU 24 24 30 12 SIGXFSZ 25 25 31 30 SIGVTALRM 26 26 28 20 SIGPROF 27 27 29 21 SIGWINCH 28 28 20 23 SIGIO 29 23 22 22 SIGPOLL Same as SIGIO SIGPWR 30 29/\- 19 19 SIGINFO \- 29/\- \- \- SIGLOST \- \-/29 \- \- SIGSYS 31 12 12 31 SIGUNUSED 31 \- \- 31 .TE .PP Note the following: .IP \[bu] 3 Where defined, \fBSIGUNUSED\fP is synonymous with \fBSIGSYS\fP. Since glibc 2.26, \fBSIGUNUSED\fP is no longer defined on any architecture. .IP \[bu] .\" Signal 29 is \fBSIGINFO\fP/\fBSIGPWR\fP (synonyms for the same value) on Alpha but \fBSIGLOST\fP on SPARC. .SS "Real\-time signály" Starting with Linux 2.2, Linux supports real\-time signals as originally defined in the POSIX.1b real\-time extensions (and now included in POSIX.1\-2001). The range of supported real\-time signals is defined by the macros \fBSIGRTMIN\fP and \fBSIGRTMAX\fP. POSIX.1\-2001 requires that an implementation support at least \fB_POSIX_RTSIG_MAX\fP (8) real\-time signals. .PP Linux podporuje 33 různých real\-time signálů očíslovaných 32 až 64. Nicméně implementace POSIX threads v glibc používá interně dva (pro NPTL) nebo tři (pro LinuxThreads) real\-time signály (viz \fBpthreads\fP(7)), a podle toho upravuje hodnotu \fBSIGRTMIN\fP (na 34 nebo 35). protože rozsah dostupných real\-time signálů se liší v závislosti na implementaci vláken v glibc (může se měnit za běhu v závislosti na jádře a glibc) a navíc rozsah real\-time signálů se mezi UNIXovými systémy liší, programy by \fInikdy neměly odkazovat na real\-time signály pevně danými čísly\fP, místo toho by měly používat notaci \fBSIGRTMIN\fP+n, a za běhu kontrolovat, zda \fBSIGRTMIN\fP+n nepřesahuje \fBSIGRTMAX\fP. .PP Na rozdíl od standardních signálů nemají real\-time signály stanovený význam: Celá sada real\-time signálů může být použita pro účely definované aplikací. .PP Výchozí akcí pro nezpracovaný real\-time signál je ukončení procesu, který jej přijal. .PP Real\-time signály se liší následujícně: .IP \[bu] 3 Vícero instancí real\-time signálů může být zařazeno do fronty. Naopak pokud je doručeno vícero instancí standardního signálu, zatímco je signál blokován, je do fronty zařazen jen jeden. .IP \[bu] Pokud je signál poslán pomocí \fBsigqueue\fP(3), může s ním být poslána doprovodná hodnota (integer nebo pointer). Pokud přijímací proces vytvoří pro tento signál handler pomocí vlajky \fBSA_SIGINFO\fP pro \fBsigaction\fP(2), tak může tato data získat v poli \fIsi_value\fP struktury \fIsiginfo_t\fP předané jako druhý argument handleru. Navíc mohou být pole \fIsi_pid\fP a \fIsi_uid\fP této struktury použita k získání PID a real user ID procesu, který signál poslal. .IP \[bu] Real\-time signály jsou doručeny v zaručeném pořadí. Vícero real\-time signálů stejného typu je doručeno v pořadí, v jakém byly vyslány. Pokud jsou procesu poslány různé real\-time signály, jsou doručeny v pořadí podle čísla, začínajíc nejnižším (tj. signály s nízkým číslem mají vyšší prioritu). Naopak, pokud na proces čeká vícero standardních signálů, není pořadí jejich doručení definováno. .PP Pokud má proces nevyřízené zároveň real\-time a standardní signály, POSIX neurčuje, které mají být doručeny jako první. Linux, stejně jako mnoho jiných implementací, v takovém případě upřednostňí standardní signály. .PP According to POSIX, an implementation should permit at least \fB_POSIX_SIGQUEUE_MAX\fP (32) real\-time signals to be queued to a process. However, Linux does things differently. Up to and including Linux 2.6.7, Linux imposes a system\-wide limit on the number of queued real\-time signals for all processes. This limit can be viewed and (with privilege) changed via the \fI/proc/sys/kernel/rtsig\-max\fP file. A related file, \fI/proc/sys/kernel/rtsig\-nr\fP, can be used to find out how many real\-time signals are currently queued. In Linux 2.6.8, these \fI/proc\fP interfaces were replaced by the \fBRLIMIT_SIGPENDING\fP resource limit, which specifies a per\-user limit for queued signals; see \fBsetrlimit\fP(2) for further details. .PP The addition of real\-time signals required the widening of the signal set structure (\fIsigset_t\fP) from 32 to 64 bits. Consequently, various system calls were superseded by new system calls that supported the larger signal sets. The old and new system calls are as follows: .TS lb lb l l. Jádro 2.0 a dřívější Linux 2.2 and later \fBsigaction\fP(2) \fBrt_sigaction\fP(2) \fBsigpending\fP(2) \fBrt_sigpending\fP(2) \fBsigprocmask\fP(2) \fBrt_sigprocmask\fP(2) \fBsigreturn\fP(2) \fBrt_sigreturn\fP(2) \fBsigsuspend\fP(2) \fBrt_sigsuspend\fP(2) \fBsigtimedwait\fP(2) \fBrt_sigtimedwait\fP(2) .TE .\" .SS "Přerušení systémových volání a funkcí knihoven prostřednictvím \(dqsignal handlers\(dq" Pokud je signal handler vyvolán v okamžiku, kdy je systémové volání nebo funkce knihovny blokována, pak: .IP \[bu] 3 je volání automaticky restartováno po návratu signal handleru, nebo .IP \[bu] volání selže s chybou \fBEINTR\fP. .PP Která z těchto možností nastane, záleží na rozhraní a na tom, zda byl signal handler definován s pomocí vlajky \fBSA_RESTART\fP (viz \fBsigaction\fP(2)). Podrobnosti se mezi UNIXovými systémy liší; dále jsou uvedeny pro Linux. .PP .\" The following system calls use ERESTARTSYS, .\" so that they are restartable If a blocked call to one of the following interfaces is interrupted by a signal handler, then the call is automatically restarted after the signal handler returns if the \fBSA_RESTART\fP flag was used; otherwise the call fails with the error \fBEINTR\fP: .IP \[bu] 3 \fBread\fP(2), \fBreadv\fP(2), \fBwrite\fP(2), \fBwritev\fP(2), and \fBioctl\fP(2) calls on "slow" devices. A "slow" device is one where the I/O call may block for an indefinite time, for example, a terminal, pipe, or socket. If an I/O call on a slow device has already transferred some data by the time it is interrupted by a signal handler, then the call will return a success status (normally, the number of bytes transferred). Note that a (local) disk is not a slow device according to this definition; I/O operations on disk devices are not interrupted by signals. .IP \[bu] \fBopen\fP(2), v případě, že může blokovat (např. při otevírání FIFO; viz \fBfifo\fP(7)). .IP \[bu] \fBwait\fP(2), \fBwait3\fP(2), \fBwait4\fP(2), \fBwaitid\fP(2) a \fBwaitpid\fP(2). .IP \[bu] .\" If a timeout (setsockopt()) is in effect on the socket, then these .\" system calls switch to using EINTR. Consequently, they and are not .\" automatically restarted, and they show the stop/cont behavior .\" described below. (Verified from Linux 2.6.26 source, and by experiment; mtk) .\" FIXME What about sendmmsg()? Socket interfaces: \fBaccept\fP(2), \fBconnect\fP(2), \fBrecv\fP(2), \fBrecvfrom\fP(2), \fBrecvmmsg\fP(2), \fBrecvmsg\fP(2), \fBsend\fP(2), \fBsendto\fP(2), and \fBsendmsg\fP(2), unless a timeout has been set on the socket (see below). .IP \[bu] File locking interfaces: \fBflock\fP(2) and the \fBF_SETLKW\fP and \fBF_OFD_SETLKW\fP operations of \fBfcntl\fP(2) .IP \[bu] Rozhraní pro POSIXové fronty zpráv: \fBmq_receive\fP(3), \fBmq_timedreceive\fP(3), \fBmq_send\fP(3) a \fBmq_timedsend\fP(3). .IP \[bu] .\" commit 72c1bbf308c75a136803d2d76d0e18258be14c7a \fBfutex\fP(2) \fBFUTEX_WAIT\fP (od jádra 2.6.22; předtím vždycky selhalo s \fBEINTR\fP). .IP \[bu] \fBgetrandom\fP(2). .IP \[bu] \fBpthread_mutex_lock\fP(3), \fBpthread_cond_wait\fP(3), and related APIs. .IP \[bu] \fBfutex\fP(2) \fBFUTEX_WAIT_BITSET\fP. .IP \[bu] .\" as a consequence of the 2.6.22 changes in the futex() implementation Rozhraní POSIXových semaforů: \fBsem_wait\fP(3) a \fBsem_timedwait\fP(3) (od jádra 2.6.22; předtím vždycky selhalo s \fBEINTR\fP). .IP \[bu] .\" commit 1ca39ab9d21ac93f94b9e3eb364ea9a5cf2aba06 \fBread\fP(2) from an \fBinotify\fP(7) file descriptor (since Linux 3.8; beforehand, always failed with \fBEINTR\fP). .PP .\" These are the system calls that give EINTR or ERESTARTNOHAND .\" on interruption by a signal handler. The following interfaces are never restarted after being interrupted by a signal handler, regardless of the use of \fBSA_RESTART\fP; they always fail with the error \fBEINTR\fP when interrupted by a signal handler: .IP \[bu] 3 "Input" socket interfaces, when a timeout (\fBSO_RCVTIMEO\fP) has been set on the socket using \fBsetsockopt\fP(2): \fBaccept\fP(2), \fBrecv\fP(2), \fBrecvfrom\fP(2), \fBrecvmmsg\fP(2) (also with a non\-NULL \fItimeout\fP argument), and \fBrecvmsg\fP(2). .IP \[bu] .\" FIXME What about sendmmsg()? "Output" socket interfaces, when a timeout (\fBSO_RCVTIMEO\fP) has been set on the socket using \fBsetsockopt\fP(2): \fBconnect\fP(2), \fBsend\fP(2), \fBsendto\fP(2), and \fBsendmsg\fP(2). .IP \[bu] Interfaces used to wait for signals: \fBpause\fP(2), \fBsigsuspend\fP(2), \fBsigtimedwait\fP(2), and \fBsigwaitinfo\fP(2). .IP \[bu] Multiplexující rozhraní popisovačů souborů: \fBepoll_wait\fP(2), \fBepoll_pwait\fP(2), \fBpoll\fP(2), \fBppoll\fP(2), \fBselect\fP(2) a \fBpselect\fP(2). .IP \[bu] .\" On some other systems, SA_RESTART does restart these system calls System V IPC rozhraní: \fBmsgrcv\fP(2), \fBmsgsnd\fP(2), \fBsemop\fP(2) a \fBsemtimedop\fP(2). .IP \[bu] Rozhraní pro spánek: \fBclock_nanosleep\fP(2), \fBnanosleep\fP(2) a \fBusleep\fP(3). .IP \[bu] \fBio_getevents\fP(2). .PP Funkce \fBsleep\fP(3) se také při přerušení signal handlerem nerestartuje, nýbrž vrátí úspěch: počet sekund, které zbývají ke spaní. .PP .\" In certain circumstances, the \fBseccomp\fP(2) user\-space notification feature can lead to restarting of system calls that would otherwise never be restarted by \fBSA_RESTART\fP; for details, see \fBseccomp_unotify\fP(2). .SS "Přerušení systémovách volání a funkcí knihoven signály Stop" V Linuxu mohou některá blokující rozhraní selhat s chybou \fBEINTR\fP i bez signal handlerů, pokud je proces zastaven jedním ze stop signálů a poté obnoven pomocí \fBSIGCONT\fP. Toto chování neodporuje POSIX.1 a neobjevuje se v jiných systémech. .PP Linuxová rozhraní, v nichž se toto chování projevuje, jsou: .IP \[bu] 3 "Input" socket interfaces, when a timeout (\fBSO_RCVTIMEO\fP) has been set on the socket using \fBsetsockopt\fP(2): \fBaccept\fP(2), \fBrecv\fP(2), \fBrecvfrom\fP(2), \fBrecvmmsg\fP(2) (also with a non\-NULL \fItimeout\fP argument), and \fBrecvmsg\fP(2). .IP \[bu] .\" FIXME What about sendmmsg()? "Output" socket interfaces, when a timeout (\fBSO_RCVTIMEO\fP) has been set on the socket using \fBsetsockopt\fP(2): \fBconnect\fP(2), \fBsend\fP(2), \fBsendto\fP(2), and \fBsendmsg\fP(2), if a send timeout (\fBSO_SNDTIMEO\fP) has been set. .IP \[bu] \fBepoll_wait\fP(2), \fBepoll_pwait\fP(2). .IP \[bu] \fBsemop\fP(2), \fBsemtimedop\fP(2). .IP \[bu] \fBsigtimedwait\fP(2), \fBsigwaitinfo\fP(2). .IP \[bu] .\" commit 1ca39ab9d21ac93f94b9e3eb364ea9a5cf2aba06 Jádro 3.7 a dřívější: \fBread\fP(2) z popisovače souborů \fBinotify\fP(7). .IP \[bu] Jádro 2.6.21 a dřívější: \fBfutex\fP(2) \fBFUTEX_WAIT\fP, \fBsem_timedwait\fP(3), \fBsem_wait\fP(3). .IP \[bu] Jádro 2.6.8 a dřívější: \fBmsgrcv\fP(2), \fBmsgsnd\fP(2). .IP \[bu] Jádro 2.4 a dřívější: \fBnanosleep\fP(2). .SH STANDARDY POSIX.1, s uvedenými výjimkami. .SH POZNÁMKY For a discussion of async\-signal\-safe functions, see \fBsignal\-safety\fP(7). .PP The \fI/proc/\fPpid\fI/task/\fPtid\fI/status\fP file contains various fields that show the signals that a thread is blocking (\fISigBlk\fP), catching (\fISigCgt\fP), or ignoring (\fISigIgn\fP). (The set of signals that are caught or ignored will be the same across all threads in a process.) Other fields show the set of pending signals that are directed to the thread (\fISigPnd\fP) as well as the set of pending signals that are directed to the process as a whole (\fIShdPnd\fP). The corresponding fields in \fI/proc/\fPpid\fI/status\fP show the information for the main thread. See \fBproc\fP(5) for further details. .SH CHYBY There are six signals that can be delivered as a consequence of a hardware exception: \fBSIGBUS\fP, \fBSIGEMT\fP, \fBSIGFPE\fP, \fBSIGILL\fP, \fBSIGSEGV\fP, and \fBSIGTRAP\fP. Which of these signals is delivered, for any given hardware exception, is not documented and does not always make sense. .PP For example, an invalid memory access that causes delivery of \fBSIGSEGV\fP on one CPU architecture may cause delivery of \fBSIGBUS\fP on another architecture, or vice versa. .PP For another example, using the x86 \fIint\fP instruction with a forbidden argument (any number other than 3 or 128) causes delivery of \fBSIGSEGV\fP, even though \fBSIGILL\fP would make more sense, because of how the CPU reports the forbidden operation to the kernel. .SH "DALŠÍ INFORMACE" \fBkill\fP(1), \fBclone\fP(2), \fBgetrlimit\fP(2), \fBkill\fP(2), \fBpidfd_send_signal\fP(2), \fBrestart_syscall\fP(2), \fBrt_sigqueueinfo\fP(2), \fBsetitimer\fP(2), \fBsetrlimit\fP(2), \fBsgetmask\fP(2), \fBsigaction\fP(2), \fBsigaltstack\fP(2), \fBsignal\fP(2), \fBsignalfd\fP(2), \fBsigpending\fP(2), \fBsigprocmask\fP(2), \fBsigreturn\fP(2), \fBsigsuspend\fP(2), \fBsigwaitinfo\fP(2), \fBabort\fP(3), \fBbsd_signal\fP(3), \fBkillpg\fP(3), \fBlongjmp\fP(3), \fBpthread_sigqueue\fP(3), \fBraise\fP(3), \fBsigqueue\fP(3), \fBsigset\fP(3), \fBsigsetops\fP(3), \fBsigvec\fP(3), \fBsigwait\fP(3), \fBstrsignal\fP(3), \fBswapcontext\fP(3), \fBsysv_signal\fP(3), \fBcore\fP(5), \fBproc\fP(5), \fBnptl\fP(7), \fBpthreads\fP(7), \fBsigevent\fP(7) .PP .SH PŘEKLAD Překlad této příručky do španělštiny vytvořili Marek Kubita a Pavel Heimlich . .PP Tento překlad je bezplatná dokumentace; Přečtěte si .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3 .UE nebo novější ohledně podmínek autorských práv. Neexistuje ŽÁDNÁ ODPOVĚDNOST. .PP Pokud narazíte na nějaké chyby v překladu této příručky, pošlete e-mail na adresu .MT translation-team-cs@lists.sourceforge.net .ME .