Gnu Error Messages
Contents |
of a library call. The functions strerror and perror give you the standard error message for a given error code; the variable program_invocation_short_name gives you convenient access to the name of the program that encountered the error. c error function Function: char * strerror (int errnum) Preliminary: | MT-Unsafe race:strerror | AS-Unsafe heap i18n |
C Error Codes
AC-Unsafe mem | See POSIX Safety Concepts. The strerror function maps the error code (see Checking for Errors) specified by the errnum
Error.h C
argument to a descriptive error message string. The return value is a pointer to this string. The value errnum normally comes from the variable errno. You should not modify the string returned by strerror. Also, if you
C Programming Error Codes
make subsequent calls to strerror, the string might be overwritten. (But it’s guaranteed that no library function ever calls strerror behind your back.) The function strerror is declared in string.h. Function: char * strerror_r (int errnum, char *buf, size_t n) Preliminary: | MT-Safe | AS-Unsafe i18n | AC-Unsafe | See POSIX Safety Concepts. The strerror_r function works like strerror but instead of returning the error message in a statically allocated buffer shared by all c error handling best practices threads in the process, it returns a private copy for the thread. This might be either some permanent global data or a message string in the user supplied buffer starting at buf with the length of n bytes. At most n characters are written (including the NUL byte) so it is up to the user to select a buffer large enough. This function should always be used in multi-threaded programs since there is no way to guarantee the string returned by strerror really belongs to the last call of the current thread. The function strerror_r is a GNU extension and it is declared in string.h. Function: void perror (const char *message) Preliminary: | MT-Safe race:stderr | AS-Unsafe corrupt i18n heap lock | AC-Unsafe corrupt lock mem fd | See POSIX Safety Concepts. This function prints an error message to the stream stderr; see Standard Streams. The orientation of stderr is not changed. If you call perror with a message that is either a null pointer or an empty string, perror just prints the error message corresponding to errno, adding a trailing newline. If you supply a non-null message argument, then perror prefixes its output with this string. It adds a colon and a space character to separate the message from the error string corresponding to errno. The function perror is dec
codes can’t occur on GNU systems, but they can occur using the GNU C Library on other systems. Macro: int EPERM Operation not permitted; only the owner of the file c print error message errno (or other resource) or processes with special privileges can perform the operation. Macro: error c-82e10193 int ENOENT No such file or directory. This is a “file doesn’t exist” error for ordinary files that are referenced c stderr in contexts where they are expected to already exist. Macro: int ESRCH No process matches the specified process ID. Macro: int EINTR Interrupted function call; an asynchronous signal occurred and prevented completion of the http://www.gnu.org/s/libc/manual/html_node/Error-Messages.html call. When this happens, you should try the call again. You can choose to have functions resume after a signal that is handled, rather than failing with EINTR; see Interrupted Primitives. Macro: int EIO Input/output error; usually used for physical read or write errors. Macro: int ENXIO No such device or address. The system tried to use the device represented by a file you specified, and it http://www.gnu.org/s/libc/manual/html_node/Error-Codes.html couldn’t find the device. This can mean that the device file was installed incorrectly, or that the physical device is missing or not correctly attached to the computer. Macro: int E2BIG Argument list too long; used when the arguments passed to a new program being executed with one of the exec functions (see Executing a File) occupy too much memory space. This condition never arises on GNU/Hurd systems. Macro: int ENOEXEC Invalid executable file format. This condition is detected by the exec functions; see Executing a File. Macro: int EBADF Bad file descriptor; for example, I/O on a descriptor that has been closed or reading from a descriptor open only for writing (or vice versa). Macro: int ECHILD There are no child processes. This error happens on operations that are supposed to manipulate child processes, when there aren’t any processes to manipulate. Macro: int EDEADLK Deadlock avoided; allocating a system resource would have resulted in a deadlock situation. The system does not guarantee that it will notice all such situations. This error means you got lucky and the system noticed; it might just hang. See File Locks, for an example. Macro: int ENOMEM No memory available. The system can
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this http://stackoverflow.com/questions/1043379/gnu-c-error-messages site About Us Learn more about Stack Overflow the company Business Learn http://www.linuxselfhelp.com/gnu/grub/html_chapter/grub_13.html more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up GNU c error C++ error messages up vote 6 down vote favorite 2 Is there a comprehensive list of error/warning messages for the g++ compiler available online? I'm looking for something similar to the MSDN documentation which describes what each message means and possibly has some sample code which demonstrates the conditions which would cause such an error. I've looked at the GCC online documentation, but I gnu error messages don't see even a simple enumeration of all possible messages. gcc documentation g++ error-list share|improve this question edited Jun 25 '09 at 12:33 Laurynas Biveinis 7,97633152 asked Jun 25 '09 at 11:19 Ferruccio 67.2k29169259 add a comment| 1 Answer 1 active oldest votes up vote 5 down vote accepted Unfortunately, there is no such list, only the GCC source code itself defines the messages. Some of those messages are exercised by the GCC testsuite, so you can find some examples there, if you download the source code of GCC. Of course they are written as functional and regression tests for GCC and not as a documentation for the user. share|improve this answer answered Jun 25 '09 at 12:33 Laurynas Biveinis 7,97633152 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged gcc do
specific to the grub shell. Errors reported by the Stage 1 The general way that the Stage 1 handles errors is to print an error string and then halt. Pressing CTRL-ALT-DEL will reboot. The following is a comprehensive list of error messages for the Stage 1: Hard Disk Error The stage2 or stage1.5 is being read from a hard disk, and the attempt to determine the size and geometry of the hard disk failed. Floppy Error The stage2 or stage1.5 is being read from a floppy disk, and the attempt to determine the size and geometry of the floppy disk failed. It's listed as a separate error since the probe sequence is different than for hard disks. Read Error A disk read error happened while trying to read the stage2 or stage1.5. Geom Error The location of the stage2 or stage1.5 is not in the portion of the disk supported directly by the BIOS read calls. This could occur because the BIOS translated geometry has been changed by the user or the disk is moved to another machine or controller after installation, or GRUB was not installed using itself (if it was, the Stage 2 version of this error would have been seen during that process and it would not have completed the install). Errors reported by the Stage 1.5 The general way that the Stage 1.5 handles errors is to print an error number in the form Error num and then halt. Pressing CTRL-ALT-DEL will reboot. The error numbers correspond to the errors reported by Stage 2. See section Errors reported by the Stage 2. Errors reported by the Stage 2 The general way that the Stage 2 handles errors is to abort the operation in question, print an error string, then (if possible) either continue based on the fact that an error occurred or wait for the user to deal with the error. The following is a comprehensive list of error messages for the Stage 2 (error numbers for the Stage 1.5 are listed before the colon in each description): 1 : Filename must be either an absolute filename or blocklist This error is returned if a file name is requested which doesn't fit the syntax/rules listed in the section Filesystem syntax and semantics. 2 : Bad file or directory type This error is returned if a file requested is not a regular file, but something like a symbolic link, directory, or FIFO. 3 : Bad or corrupt data while decompressing file This error is returned if the run-length decompression code gets an internal error. This is usually from a corrupt file. 4 : Bad or incompatible header in compressed file This error is returned if the file header for a supposedly compressed file is bad. 5 : Partition table invalid or corrupt This error is returned if the sanity checks on the integrity of the partition table fail