.\" -*- coding: UTF-8 -*- .\" Copyright (c) 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" %%%LICENSE_START(BSD_4_CLAUSE_UCB) .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by the University of .\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" %%%LICENSE_END .\" .\" From: @(#)err.3 8.1 (Berkeley) 6/9/93 .\" $FreeBSD: src/lib/libc/gen/err.3,v 1.11.2.5 2001/08/17 15:42:32 ru Exp $ .\" .\" 2011-09-10, mtk, Converted from mdoc to man macros .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH ERR 3 "9 Junio 2020" Linux "Manual del Programador de Linux" .SH NOMBRE err, verr, errx, verrx, warn, vwarn, warnx, vwarnx \- mensajes de error con formato .SH SINOPSIS .nf \fB#include \fP .PP \fBvoid err(int \fP\fIeval\fP\fB, const char *\fP\fIfmt\fP\fB, ...);\fP .PP \fBvoid errx(int \fP\fIeval\fP\fB, const char *\fP\fIfmt\fP\fB, ...);\fP .PP \fBvoid warn(const char *\fP\fIfmt\fP\fB, ...);\fP .PP \fBvoid warnx(const char *\fP\fIfmt\fP\fB, ...);\fP \fB#include \fP .PP \fBvoid verr(int \fP\fIeval\fP\fB, const char *\fP\fIfmt\fP\fB, va_list \fP\fIargs\fP\fB);\fP .PP \fBvoid verrx(int \fP\fIeval\fP\fB, const char *\fP\fIfmt\fP\fB, va_list \fP\fIargs\fP\fB);\fP .PP \fBvoid vwarn(const char *\fP\fIfmt\fP\fB, va_list \fP\fIargs\fP\fB);\fP .PP \fBvoid vwarnx(const char *\fP\fIfmt\fP\fB, va_list \fP\fIargs\fP\fB);\fP .fi .SH DESCRIPCIÓN La familia de funciones \fBerr\fP() y \fBwarn\fP() muestran un mensaje de error con formato en la salida estándar de error. En todos los casos, se imprime el último componente del nombre del programa, un carácter punto y un espacio. Si el argumento \fIfmt\fP es distinto de NULL, se imprime un mensaje de error con formato al estilo de \fBprintf\fP(3). La salida finaliza con un carácter nueva línea. .PP The \fBerr\fP(), \fBverr\fP(), \fBwarn\fP(), and \fBvwarn\fP() functions append an error message obtained from \fBstrerror\fP(3) based on the global variable \fIerrno\fP, preceded by another colon and space unless the \fIfmt\fP argument is NULL. .PP Las funciones \fBerrx\fP() y \fBwarnx\fP() no añaden ningún mensaje de error. .PP Las funciones \fBerr\fP(), \fBverr\fP(), \fBerrx\fP() y \fBverrx\fP() no regresan, sino que terminan la ejecución con el valor del argumento \fIeval\fP. .SH ATRIBUTOS Para obtener una explicación de los términos usados en esta sección, véase \fBattributes\fP(7). .TS allbox; lbw17 lb lb l l l. Interfaz Atributo Valor T{ \fBerr\fP(), \fBerrx\fP(), .br \fBwarn\fP(), \fBwarnx\fP(), .br \fBverr\fP(), \fBverrx\fP(), .br \fBvwarn\fP(), \fBvwarnx\fP() T} Seguridad del hilo Configuración regional de multi\-hilo seguro .TE .sp 1 .SH "CONFORME A" .\" .SH HISTORY .\" The .\" .BR err () .\" and .\" .BR warn () .\" functions first appeared in .\" 4.4BSD. These functions are nonstandard BSD extensions. .SH EJEMPLOS Muestra la cadena de información del \fIerrno\fP actual y termina: .PP .in +4n .EX 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); .EE .in .PP Muestra un mensaje de error y termina: .PP .in +4n .EX if (tm.tm_hour < START_TIME) errx(EXIT_FAILURE, "too early, wait until %s", start_time_string); .EE .in .PP Aviso de un error: .PP .in +4n .EX fd = open(raw_device, O_RDONLY, 0); if (fd == \-1) warnx("%s: %s: trying the block device", raw_device, strerror(errno)); fd = open(block_device, O_RDONLY, 0); if (fd == \-1) err(EXIT_FAILURE, "%s", block_device); .EE .in .SH "VÉASE TAMBIÉN" \fBerror\fP(3), \fBexit\fP(3), \fBperror\fP(3), \fBprintf\fP(3), \fBstrerror\fP(3) .SH COLOFÓN Esta página es parte de la versión 5.10 del proyecto Linux \fIman\-pages\fP. Puede encontrar una descripción del proyecto, información sobre cómo informar errores y la última versión de esta página en \%https://www.kernel.org/doc/man\-pages/. .PP .SH TRADUCCIÓN La traducción al español de esta página del manual fue creada por Miguel Pérez Ibars . .PP Esta traducción es documentación libre; lea la .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3 .UE o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD. .PP Si encuentra algún error en la traducción de esta página del manual, envíe un correo electrónico a .MT debian-l10n-spanish@lists.debian.org .ME .