File: signal.2

package info (click to toggle)
manpages-de 0.7-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 3,188 kB
  • ctags: 9
  • sloc: makefile: 83; perl: 61
file content (105 lines) | stat: -rw-r--r-- 3,153 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
.\" Copyright (c) 1994 Mike Battersby <mike@starbug.apana.org.au>
.\" based on work by faith@cs.unc.edu
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one
.\" 
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date.  The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein.  The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\" 
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" German translation by René Tschirley (gremlin@cs.tu-berlin.de)
.\" Modified Mon Jun 10 21:00:42 1996 by Martin Schulze (joey@linux.de)
.\"
.TH SIGNAL 2 "10. Juni 1996" "Linux 1.0" "Systemaufrufe"

.SH BEZEICHNUNG
signal \- ANSI C Signalmanagement

.SH ÜBERSICHT
.B #include <signal.h>
.sp 2
.BI "void (*signal(int " signum ", void (*" handler ")(int)))(int);"

.SH BESCHREIBUNG
Der Systemaufruf
.B signal
trägt einen neuen Signalhandler für das Signal mit der Nummer
.I signum
ein.  Der Signalhandler wird auf
.I handler
gesetzt, die eine benutzerdefinierte Funktion oder eines der folgenden
Makros sein darf:
.RS
.TP
.B SIG_IGN
Das Signal ist zu ignorieren.
.TP
.B SIG_DFL
Setzt das Signal auf das voreingestellte Verhalten zurück.
.RE
.PP
Das Ganzzahlargument, das an den Signalhandler durchgereicht wird, ist
die Signalnummer.  Dadurch wird es möglich, einen Signalhandler für
mehrere Signale zu verwenden.

Signalhandler sind Routinen, die aufgerufen werden wenn der Prozess
ein entsprechendes Signal empfängt.  Mittels
.BR alarm (2),
das ein
.B SIGALRM
schickt, kann der Prozess z.B. an regelmäßige Aufgaben erinnert
werden.  So kann auch erreicht werden, dass der Prozess z.B. seine
Konfigurationsdateien neu einliest.

.SH "RÜCKGABEWERT"
.B signal
liefert den vorherigen Signalhandler zurück oder
.B SIG_ERR
bei aufgetretenem Fehler.

.SH ANMERKUNGEN
Für
.B SIGKILL
und
.B SIGSTOP
können keine Signalhandler gesetzt werden.
.PP
Im Gegensatz zu BSD-Systemen werden Signale unter Linux auf das
voreingestellte Verhalten zurückgesetzt, wenn das Signal ausgelöst
wurde.
.PP
Wenn Sie vielleicht erstaunt über den Prototypen oben sind, betrachten
Sie Folgendes:
.PP
typedef void (*sighandler_t)(int);
.br
.BI "sighandler_t signal(int " signum ", sighandler_t " handler );

.SH "KOMPATIBEL ZU"
ANSI C

.SH "SIEHE AUCH"
.BR kill (1),
.BR kill (2),
.BR killpg (2),
.BR pause (2),
.BR raise (3),
.BR sigaction (2),
.BR signal (7),
.BR sigsetops (3),
.BR sigvec (2),
.BR alarm (2).