Lines Matching refs:error

4 @cindex error reporting
6 @cindex error codes
9 Many functions in @theglibc{} detect and report error conditions,
10 and sometimes your programs need to check for these error conditions.
12 file was actually opened correctly, and print an error message or take
15 This chapter describes how the error reporting facility works. Your
24 * Error Messages:: Mapping error codes onto error messages.
33 return value tells you only that an error has occurred. To find out
34 what kind of error it was, you need to look at the error code stored in the
41 The variable @code{errno} contains the system error number. You can
51 cases, when a library function encounters an error, it will set
52 @code{errno} to a non-zero value to indicate what specific error
54 error conditions that are possible for that function. Not all library
55 functions use this mechanism; some return an error code directly,
60 and even if they return error codes directly. Therefore, it is
61 usually incorrect to check @emph{whether} an error occurred by
63 error is documented for each function.
74 that return a perfectly legitimate value in case of an error, but also
76 whether an error occurred, the recommended method is to set @code{errno}
81 All the error codes have symbolic names; they are macros defined in
86 The error code values are all positive integers and are all distinct,
94 of these macros, since some library functions might return other error
115 The error code macros are defined in the header file @file{errno.h}.
116 All of them expand into integer constant values. Some of these error
130 This is a ``file doesn't exist'' error
155 @errno{EIO, 5, Input/output error}
180 @errno{ENOEXEC, 8, Exec format error}
196 This error happens on operations that are
206 all such situations. This error means you got lucky and the system
227 On @gnuhurdsystems{}, this error never happens; you get a signal instead.
235 system in Unix gives this error.
243 mounted filesystem, you get this error.
295 limit that can usually be increased. If you get this error, you might
305 @ref{Linked Channels}. This error never occurs on @gnuhurdsystems{}.
321 will cause this error. (The name stands for ``text file busy''.) This
322 is not an error on @gnuhurdsystems{}; the text is copied as necessary.
354 @code{rename} can cause this error if the file being renamed already has
362 Every library function that returns this error code also generates a
389 This error can happen in a few different situations:
400 was indicated by @code{EWOULDBLOCK}, which was a distinct error code
406 can return this error. It indicates that the shortage is expected to
411 so usually an interactive program should report the error to the user
423 separate error code.
492 error can happen for many calls when the object does not support the
561 error is always synonymous with @code{ENOMEM}; you may get one or the
575 The socket is not connected to anything. You get this error when you
585 error when you try to transmit data over a connectionless socket,
645 this error occurs when you are trying to delete a directory.
684 (This is an error on some operating systems, but we expect it to work
685 properly on @gnuhurdsystems{}, making this error code impossible.)
717 @ref{File Locks}. This error is never generated by @gnuhurdsystems{}, but
728 On some systems @code{chmod} returns this error if you try to set the
734 @errno{EAUTH, 80, Authentication error}
747 operating system. When you get this error, you can be sure that this
760 A function returns this error when certain parameter
785 this error for certain operations when the caller is not in the
787 error because functions such as @code{read} and @code{write} translate
795 On @gnuhurdsystems{}, opening a file returns this error when the file is
804 @c This error code is a joke. Its perror text is part of the joke.
835 @errno{EGRATUITOUS, 105, Gratuitous error}
836 This error code has no purpose.
886 @errno{EPROTO, 116, Protocol error}
900 error; @pxref{Cancel AIO Operations}.
914 @emph{The following error codes are defined by the Linux/i386 kernel.
994 @errno{EDEADLOCK, ???/58, File locking deadlock error}
1014 @errno{EADV, ???/68, Advertise error}
1019 @errno{ESRMNT, ???/69, Srmount error}
1024 @errno{ECOMM, ???/70, Communication error on send}
1029 @errno{EDOTDOT, ???/73, RFS specific error}
1069 @errno{ESTRPIPE, ???/86, Streams pipe error}
1094 @errno{EREMOTEIO, ???/121, Remote I/O error}
1134 @errno{EHWPOISON, ???/???, Memory page has hardware error}
1141 your program to report informative error messages in the customary
1143 @code{strerror} and @code{perror} give you the standard error message
1144 for a given error code; the variable
1146 name of the program that encountered the error.
1153 The @code{strerror} function maps the error code (@pxref{Checking for
1154 Errors}) specified by the @var{errnum} argument to a descriptive error
1171 returning the error message in a statically allocated buffer shared by
1194 This function prints an error message to the stream @code{stderr};
1199 pointer or an empty string, @code{perror} just prints the error message
1204 character to separate the @var{message} from the error string corresponding
1213 This function returns the name describing the error @var{errnum} or
1224 This function returns the message describing the error @var{errnum} or
1234 given error code; the precise text varies from system to system. With
1236 messages or embedded newlines. Each error message begins with a capital
1242 exit if any system call fails. By convention, the error message from
1275 error-reporting subroutines that require no explicit cooperation from
1283 appropriate error message using the @code{strerror} function, and
1285 calls before passing the error code to @code{strerror}, we'd have to
1319 instance, requires error messages to be preceded by the program name and
1321 about the input file name and the line number in case an error is
1324 These functions are declared in @file{error.h}.
1326 @deftypefun void error (int @var{status}, int @var{errnum}, const char *@var{format}, @dots{})
1327 @standards{GNU, error.h}
1335 The @code{error} function can be used to report general problems during
1339 Just like @code{perror}, @code{error} also can report an error code in
1340 textual form. But unlike @code{perror} the error value is explicitly
1342 the problem mentioned above that the error reporting function must be
1343 called immediately after the function causing the error since otherwise
1346 @code{error} prints first the program name. If the application
1353 by a colon and a space, followed by the error message for the error code
1363 @code{error} returns, the global variable @code{error_message_count} is
1368 @standards{GNU, error.h}
1377 @c like error.
1379 The @code{error_at_line} function is very similar to the @code{error}
1382 that of @code{error} except that between the program name and the string
1389 This additional output of course is meant to be used to locate an error
1397 Just like @code{error} this function only returns if @var{status} is
1399 @code{error} returns, the global variable @code{error_message_count} is
1403 As mentioned above, the @code{error} and @code{error_at_line} functions
1408 @standards{GNU, error.h}
1410 value the function pointed to is called by @code{error} or
1421 @standards{GNU, error.h}
1423 the functions @code{error} or @code{error_at_line} returns. The
1428 @standards{GNU, error.h}
1433 file name and line number for which an error was reported and avoids
1453 /* @r{End of file or error.} */
1460 if (@r{Detect error in line})
1462 "some error text %s", some_variable);
1466 error (EXIT_FAILURE, 0, "%u errors found", error_message_count);
1470 @code{error} and @code{error_at_line} are clearly the functions of
1483 error (0, errno, format, @r{the parameters})
1486 except that the global variables @code{error} respects and modifies
1494 @c given message, and the error string with fw?printf's %m. When the
1508 error (0, 0, format, @r{the parameters})
1511 except that the global variables @code{error} respects and modifies
1512 are not used. The difference to @code{warn} is that no error number
1531 error (status, errno, format, @r{the parameters})
1534 except that the global variables @code{error} respects and modifies
1553 error (status, 0, format, @r{the parameters})
1556 except that the global variables @code{error} respects and modifies
1558 is zero. The difference to @code{err} is that no error number