File: perror.3

package info (click to toggle)
manpages-fr 0.9.3-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 7,052 kB
  • ctags: 4
  • sloc: makefile: 58; sh: 8
file content (98 lines) | stat: -rw-r--r-- 3,646 bytes parent folder | download | duplicates (2)
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
.\" Copyright (c) 1994 Michael Haardt (u31b3hs@pool.informatik.rwth-aachen.de), Sat Jun  4 20:38:26 MET DST 1994
.\" Copyright (c) 1995 Michael Haardt (michael@cantor.informatik.rwth-aachen.de), Thu Mar 16 18:46:23 MET 1995
.\" Copyright (c) 1996 Andries Brouwer (aeb@cwi.nl), Sat Jan 13 00:16:41 MET 1996
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
.\" USA.
.\"
.\" Sat Jan 13 00:16:41 MET 1996, aeb: merged in some text contributed
.\" by Melvin Smith (msmith@falcon.mercer.peachnet.edu) and various
.\" other changes.
.\" Modified Fri May 16 23:41:15 1996 by Martin Schulze (joey@infodrom.north.de)
.\"
.\" Traduction 05/11/1996 par Christophe Blaess (ccb@club-internet.fr)
.\" mj 16/07/99 - Fautes de frappe
.TH PERROR 3 "16 Juillet 1999" Linux "Manuel du programmeur Linux"
.SH NOM
perror \- Affiche un message d'erreur.
.SH SYNOPSIS
.B #include <stdio.h>
.sp
.BI "void perror (const char " *s );
.sp
.B #include <errno.h>
.sp
.BI "const char *" sys_errlist [];
.br
.BI "int " sys_nerr ;
.SH DESCRIPTION
La fonction
.B perror()
affiche un message sur la sortie d'erreur standard, dcrivant la dernire
erreur rencontre durant un appel systme ou une fonction de bibliothque.
La chane de caractre \fIs\fP est imprime en premier, suivie d'un double-point
ou d'un blanc, puis le message, suivi d'un saut de ligne.

La chane de caractres contient gnralement le nom de la fonction
o s'est produit l'erreur. Le numro d'erreur est obtenu  partir de
la variable externe \fIerrno\fP, qui contient le code d'erreur lorsqu'un
problme survient, mais qui n'est PAS effac lorsqu'un appel est russi.

La liste globale d'erreurs 
.IR sys_errlist "[]"
indexe par
.I errno
peut tre utilise pour obtenir le message d'erreur sans le saut de ligne.
Le plus grand numro de message contenu dans cette table est
.IR sys_nerr " - 1."
Soyez prudents lors des accs directs dans cette liste, car de nouvelles
erreurs n'ont peut tre pas de message dans
.IR sys_errlist "[]."


Quand un appel systme choue, il renvoie habituellement -1, et place le
code d'erreur dans
.IR errno .
(Les codes sont dcrits dans 
.IR "<errno.h>" .)
Beaucoup de fonctions de bibliothque se comportent galement ainsi.

La fonction
.B perror()
permet de traduire les codes d'erreur en une forme humainement lisible.
Notez que
.I errno
est indfini aprs un appel de fonction de bibliothque russi. Cette fonction
peut modifier \fIerrno\fP mme si elle russit, ne serait-ce que par des
appels systmes internes qui peuvent chouer.

Ainsi, si un appel qui choue n'est pas immdiatement suivi par
.BR perror ,
la valeur de
.I errno
doit tre sauvegarde.

.SH "CONFORMIT"
ANSI C, BSD 4.3, POSIX, X/OPEN
.SH "VOIR AUSSI"
.BR strerror (3)

.SH TRADUCTION
Christophe Blaess, 1997.