When there is an exception to the C API function in Linux, generally will errno variable (need include errno.h) to assign an integer value, different values to represent different meanings, you can see the value of the reason for the error, in the
Lien000034August 24, 20141. errno variable
The file defines the symbol errno and various constants that can be assigned to it. These constants start with the character E. For example, if errno is equal to the constant eacces, a permission error
The C language provides a global variable errno for program execution. Errno is declared in errno. h.
The following example attempts to open a non-existing file and then outputs the errno value.
# Include
# Include
# Include
# Include
#
Ifndef _i386_errno_h#define _i386_errno_h#define EPERM 1/* Operation not permitted * *#define ENOENT 2/* No such file or directory */#define ESRCH 3/* No such process * *#define EINTR 4/* Interrupted system call * *#define EIO 5 */I/O error *
Http://docs.sun.com/app/docs/doc/819-7051?l=zh "Multithreaded Programming Guide"
An excerpt from the "Apue"
POSIX and ISO c define errno as such a symbol, which expands into a modifiable integer left value (lvalue). This can be an integer that
1. Relationship between printf and fprintf 1 printf ()# Include Int printf (const char * format ,...);The printf () function prints the output to stdout (standard output) and other parameters according to the format given by format. For the output
errno is thread-safe under Linux 2011-06-20 11:34:54
Category: Linux in Linux or UNIX environments, errno is a very important part. When there is a problem with the called function, we can determine the cause of the error by errno value, which
In Linux or UNIX environments, errno is a very important part. When the called function encounters a problem, we can use the errno value to determine the cause of the Error. This will involve a problem, that is, how to ensure the security of errno
In Linux or UNIX environments, errno is a very important part. When there is a problem with the called function, we can determine the cause of the error by errno value, which involves a problem, that is, how to ensure that the errno in
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.