Man page - warnx(3)

Packages contains this manual

Available languages:

en fr es it ja ro

Manual

err

NOM
BIBLIOTHÈQUE
SYNOPSIS
DESCRIPTION
ATTRIBUTS
STANDARDS
HISTORIQUE
EXEMPLES
VOIR AUSSI
TRADUCTION

NOM

err, verr, errx, verrx, warn, vwarn, warnx, vwarnx - Messages d’erreurs formatĂ©s

BIBLIOTHÈQUE

BibliothĂšque C standard ( libc , -lc )

SYNOPSIS

#include <err.h>

[[noreturn]] void err(int eval , const char * fmt , ...);
[[noreturn]] void errx(int
eval , const char * fmt , ...);

void warn(const char * fmt , ...);
void warnx(const char *
fmt , ...);

#include <stdarg.h>

[[noreturn]] void verr(int eval , const char * fmt , va_list args );
[[noreturn]] void verrx(int
eval , const char * fmt , va_list args );

void vwarn(const char * fmt , va_list args );
void vwarnx(const char *
fmt , va_list args );

DESCRIPTION

Les fonctions de la famille err () et warn () affichent un message d’erreur formatĂ© sur la sortie d’erreur standard. Dans tous les cas, elles affichent le nom du programme, un deux-points et une espace. Si l’argument fmt n’est pas NULL, le message est affichĂ© avec un format de type printf (3). La sortie se termine par un saut de ligne.

Les fonctions err (), verr (), warn () et vwarn () ajoutent un message d’erreur obtenu avec strerror (3) Ă  partir de la variable globale errno , prĂ©cĂ©dĂ© d’un autre deux-points et d’une espace, sauf si l’argument fmt est NULL.

Les fonctions errx () et warnx () n’ajoutent pas de message d’erreur.

Les fonctions err (), verr (), errx (), et verrx () ne renvoient pas, elles terminent le programme avec le code de retour eval .

ATTRIBUTS

Pour une explication des termes utilisés dans cette section, consulter attributes (7).

Image grohtml-3883738-1.png

STANDARDS

BSD.

HISTORIQUE

err ()

warn ()

4.4BSD.

EXEMPLES

Afficher la chaüne d’informations errno courante et sortir :

p = malloc(size);
if (p == NULL)
err(EXIT_FAILURE, NULL);
fd = open(file_name, O_RDONLY, 0);
if (fd == -1)
err(EXIT_FAILURE, "%s", file_name);

Afficher un message d’erreur et sortir :

if (tm.tm_hour < START_TIME)
errx(EXIT_FAILURE, "trop tît, attendre jusqu’à %s",
start_time_string);

Avertissement sur une erreur :

fd = open(raw_device, O_RDONLY, 0);
if (fd == -1)
warnx("%s : %s : essai du systÚme bloc",
raw_device, strerror(errno));
fd = open(block_device, O_RDONLY, 0);
if (fd == -1)
err(EXIT_FAILURE, "%s", block_device);

VOIR AUSSI

error (3), exit (3), perror (3), printf (3), strerror (3)

TRADUCTION

La traduction française de cette page de manuel a été créée par Christophe Blaess <https://www.blaess.fr/christophe/>, Stéphan Rafin <stephan.rafin@laposte.net>, Thierry Vignaud <tvignaud@mandriva.com>, François Micaux, Alain Portal <aportal@univ-montp2.fr>, Jean-Philippe Guérard <fevrier@tigreraye.org>, Jean-Luc Coulon (f5ibh) <jean-luc.coulon@wanadoo.fr>, Julien Cristau <jcristau@debian.org>, Thomas Huriaux <thomas.huriaux@gmail.com>, Nicolas François <nicolas.francois@centraliens.net>, Florentin Duneau <fduneau@gmail.com>, Simon Paillard <simon.paillard@resel.enst-bretagne.fr>, Denis Barbier <barbier@debian.org> et David Prévot <david@tilapin.org>

Cette traduction est une documentation libre ; veuillez vous reporter à la GNU General Public License version 3 concernant les conditions de copie et de distribution. Il n’y a aucune RESPONSABILITÉ LÉGALE.

Si vous découvrez un bogue dans la traduction de cette page de manuel, veuillez envoyer un message à debian-l10n-french@lists.debian.org .