File: signal.2

package info (click to toggle)
manpages-de 0.4-8
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,808 kB
  • ctags: 4
  • sloc: sh: 7,666; makefile: 60
file content (105 lines) | stat: -rw-r--r-- 3,132 bytes parent folder | download | duplicates (5)
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
trgt einen neuen Signalhandler fr 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 zurck.
.RE
.PP
Das Ganzzahlargument, das an den Signalhandler durchgereicht wird, ist
die Signalnummer.  Dadurch wird es mglich, einen Signalhandler fr
mehrere Signale zu verwenden.

Signalhandler sind Routinen, die aufgerufen werden wenn der Proze
ein entsprechendes Signal empfngt.  Mittels
.BR alarm (2),
das ein
.B SIGALRM
schickt, kann der Proze z.B. an regelmige Aufgaben erinnert
werden.  So kann auch erreicht werden, da der Proze z.B. seine
Konfigurationsdateien neu einliest.

.SH "RCKGABEWERT"
.B signal
liefert den vorherigen Signalhandler zurck oder
.B SIG_ERR
bei aufgetretenem Fehler.

.SH ANMERKUNGEN
Fr
.B SIGKILL
und
.B SIGSTOP
knnen keine Signalhandler gesetzt werden.
.PP
Im Gegensatz zu BSD-Systemen werden Signale unter Linux auf das
voreingestellte Verhalten zurckgesetzt, wenn das Signal ausgelst
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).