Manual Pages for Linux CentOS command on man error_one_per_line
MyWebUniversity

Manual Pages for Linux CentOS command on man error_one_per_line

ERROR(3) Linux Programmer's Manual ERROR(3)

NAME error, erroratline, errormessagecount, erroroneperline,

errorprintprogname - glibc error reporting functions SYNOPSIS

#include void error(int status, int errnum, const char *format, ...); void erroratline(int status, int errnum, const char *filename, unsigned int linenum, const char *format, ...); extern unsigned int errormessagecount; extern int erroroneperline; extern void (*errorprintprogname) (void); DESCRIPTION

error() is a general error-reporting function. It flushes stdout, and then outputs to stderr the program name, a colon and a space, the mes‐

sage specified by the printf(3)-style format string format, and, if errnum is nonzero, a second colon and a space followed by the string given by strerror(errnum). Any arguments required for format should follow format in the argument list. The output is terminated by a new‐ line character. The program name printed by error() is the value of the global variable programinvocationname(3). programinvocationname initially has the same value as main()'s argv[0]. The value of this variable can be mod‐ ified to change the output of error(). If status has a nonzero value, then error() calls exit(3) to terminate the program using the given value as the exit status. The erroratline() function is exactly the same as error(), except for the addition of the arguments filename and linenum. The output pro‐ duced is as for error(), except that after the program name are writ‐ ten: a colon, the value of filename, a colon, and the value of linenum. The preprocessor values LINE and FILE may be useful when call‐ ing erroratline(), but other values can also be used. For example, these arguments could refer to a location in an input file. If the global variable erroroneperline is set nonzero, a sequence of erroratline() calls with the same value of filename and linenum will result in only one message (the first) being output. The global variable errormessagecount counts the number of messages that have been output by error() and erroratline(). If the global variable errorprintprogname is assigned the address of a function (i.e., is not NULL), then that function is called instead of prefixing the message with the program name and colon. The function should print a suitable string to stderr. CONFORMING TO These functions and variables are GNU extensions, and should not be used in programs intended to be portable. SEE ALSO err(3), errno(3), exit(3), perror(3), programinvocationname(3), str‐ error(3) COLOPHON

This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can

be found at http://www.kernel.org/doc/man-pages/.

GNU 2010-08-29 ERROR(3)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™