标准库头文件 <cerrno>
来自 cppreference.cn
此头文件最初在 C 标准库中为 <errno.h>。
此头文件是错误处理库的一部分。
目录 |
[编辑] 宏
扩展为 POSIX 兼容的线程局部错误码变量的宏 (宏变量) | |
E2BIG (C++11) |
参数列表过长 (宏常量) |
EACCES (C++11) |
权限被拒绝 (宏常量) |
EADDRINUSE (C++11) |
地址已在使用 (宏常量) |
EADDRNOTAVAIL (C++11) |
地址不可用 (宏常量) |
EAFNOSUPPORT (C++11) |
地址族不受支持 (宏常量) |
EAGAIN (C++11) |
资源不可用,请重试 (宏常量) |
EALREADY (C++11) |
连接已在进行中 (宏常量) |
EBADF (C++11) |
错误的文件描述符 (宏常量) |
EBADMSG (C++11) |
错误的消息 (宏常量) |
EBUSY (C++11) |
设备或资源忙 (宏常量) |
ECANCELED (C++11) |
操作已取消 (宏常量) |
ECHILD (C++11) |
无子进程 (宏常量) |
ECONNABORTED (C++11) |
连接中止 (宏常量) |
ECONNREFUSED (C++11) |
连接被拒绝 (宏常量) |
ECONNRESET (C++11) |
连接重置 (宏常量) |
EDEADLK (C++11) |
资源死锁将发生 (宏常量) |
EDESTADDRREQ (C++11) |
需要目标地址 (宏常量) |
EDOM |
数学参数超出函数域 (宏常量) |
EEXIST (C++11) |
文件已存在 (宏常量) |
EFAULT (C++11) |
错误的地址 (宏常量) |
EFBIG (C++11) |
文件过大 (宏常量) |
EHOSTUNREACH (C++11) |
主机无法访问 (宏常量) |
EIDRM (C++11) |
标识符已移除 (宏常量) |
EILSEQ |
非法字节序列 (宏常量) |
EINPROGRESS (C++11) |
操作正在进行中 (宏常量) |
EINTR (C++11) |
函数被中断 (宏常量) |
EINVAL (C++11) |
无效参数 (宏常量) |
EIO (C++11) |
I/O 错误 (宏常量) |
EISCONN (C++11) |
套接字已连接 (宏常量) |
EISDIR (C++11) |
是一个目录 (宏常量) |
ELOOP (C++11) |
符号链接层数过多 (宏常量) |
EMFILE (C++11) |
文件描述符值过大 (宏常量) |
EMLINK (C++11) |
链接过多 (宏常量) |
EMSGSIZE (C++11) |
消息过大 (宏常量) |
ENAMETOOLONG (C++11) |
文件名过长 (宏常量) |
ENETDOWN (C++11) |
网络已关闭 (宏常量) |
ENETRESET (C++11) |
连接被网络重置 (宏常量) |
ENETUNREACH (C++11) |
网络无法访问 (宏常量) |
ENFILE (C++11) |
系统打开的文件过多 (宏常量) |
ENOBUFS (C++11) |
无可用缓冲区空间 (宏常量) |
ENODATA (C++11) (在 C++23 中已弃用) |
STREAM 头读取队列中无可用消息 (宏常量) |
ENODEV (C++11) |
无此设备 (宏常量) |
ENOENT (C++11) |
无此文件或目录 (宏常量) |
ENOEXEC (C++11) |
可执行文件格式错误 (宏常量) |
ENOLCK (C++11) |
无可用锁 (宏常量) |
ENOLINK (C++11) |
链接已断开 (宏常量) |
ENOMEM (C++11) |
空间不足 (宏常量) |
ENOMSG (C++11) |
无所需类型的消息 (宏常量) |
ENOPROTOOPT (C++11) |
协议不可用 (宏常量) |
ENOSPC (C++11) |
设备上无剩余空间 (宏常量) |
ENOSR (C++11) (在 C++23 中已弃用) |
无 STREAM 资源 (宏常量) |
ENOSTR (C++11) (在 C++23 中已弃用) |
不是 STREAM (宏常量) |
ENOSYS (C++11) |
函数不支持 (宏常量) |
ENOTCONN (C++11) |
套接字未连接 (宏常量) |
ENOTDIR (C++11) |
不是目录 (宏常量) |
ENOTEMPTY (C++11) |
目录不为空 (宏常量) |
ENOTRECOVERABLE (C++11) |
状态不可恢复 (宏常量) |
ENOTSOCK (C++11) |
不是套接字 (宏常量) |
ENOTSUP (C++11) |
不支持 (宏常量) |
ENOTTY (C++11) |
不适当的 I/O 控制操作 (宏常量) |
ENXIO (C++11) |
无此设备或地址 (宏常量) |
EOPNOTSUPP (C++11) |
套接字上不支持此操作 (宏常量) |
EOVERFLOW (C++11) |
值过大,无法存储在数据类型中 (宏常量) |
EOWNERDEAD (C++11) |
前一个所有者已死亡 (宏常量) |
EPERM (C++11) |
操作不被允许 (宏常量) |
EPIPE (C++11) |
管道破裂 (宏常量) |
EPROTO (C++11) |
协议错误 (宏常量) |
EPROTONOSUPPORT (C++11) |
协议不支持 (宏常量) |
EPROTOTYPE (C++11) |
套接字协议类型错误 (宏常量) |
ERANGE |
结果过大 (宏常量) |
EROFS (C++11) |
只读文件系统 (宏常量) |
ESPIPE (C++11) |
无效的寻道 (宏常量) |
ESRCH (C++11) |
无此进程 (宏常量) |
ETIME (C++11) (在 C++23 中已弃用) |
流 ioctl() 超时(宏常量) |
ETIMEDOUT (C++11) |
连接超时 (宏常量) |
ETXTBSY (C++11) |
文本文件忙 (宏常量) |
EWOULDBLOCK (C++11) |
操作将阻塞 (宏常量) |
EXDEV (C++11) |
跨设备链接 (宏常量) |
[编辑] 注意
尽管头文件 <cerrno>
基于 C 标准库头文件 <errno.h>,但 <cerrno>
定义的大多数宏是从 POSIX 标准而非 C 标准库引入 C++ 的。
[编辑] 概要
#define errno /* see description */ #define E2BIG /* see description */ // freestanding #define EACCES /* see description */ // freestanding #define EADDRINUSE /* see description */ // freestanding #define EADDRNOTAVAIL /* see description */ // freestanding #define EAFNOSUPPORT /* see description */ // freestanding #define EAGAIN /* see description */ // freestanding #define EALREADY /* see description */ // freestanding #define EBADF /* see description */ // freestanding #define EBADMSG /* see description */ // freestanding #define EBUSY /* see description */ // freestanding #define ECANCELED /* see description */ // freestanding #define ECHILD /* see description */ // freestanding #define ECONNABORTED /* see description */ // freestanding #define ECONNREFUSED /* see description */ // freestanding #define ECONNRESET /* see description */ // freestanding #define EDEADLK /* see description */ // freestanding #define EDESTADDRREQ /* see description */ // freestanding #define EDOM /* see description */ // freestanding #define EEXIST /* see description */ // freestanding #define EFAULT /* see description */ // freestanding #define EFBIG /* see description */ // freestanding #define EHOSTUNREACH /* see description */ // freestanding #define EIDRM /* see description */ // freestanding #define EILSEQ /* see description */ // freestanding #define EINPROGRESS /* see description */ // freestanding #define EINTR /* see description */ // freestanding #define EINVAL /* see description */ // freestanding #define EIO /* see description */ // freestanding #define EISCONN /* see description */ // freestanding #define EISDIR /* see description */ // freestanding #define ELOOP /* see description */ // freestanding #define EMFILE /* see description */ // freestanding #define EMLINK /* see description */ // freestanding #define EMSGSIZE /* see description */ // freestanding #define ENAMETOOLONG /* see description */ // freestanding #define ENETDOWN /* see description */ // freestanding #define ENETRESET /* see description */ // freestanding #define ENETUNREACH /* see description */ // freestanding #define ENFILE /* see description */ // freestanding #define ENOBUFS /* see description */ // freestanding #define ENODEV /* see description */ // freestanding #define ENOENT /* see description */ // freestanding #define ENOEXEC /* see description */ // freestanding #define ENOLCK /* see description */ // freestanding #define ENOLINK /* see description */ // freestanding #define ENOMEM /* see description */ // freestanding #define ENOMSG /* see description */ // freestanding #define ENOPROTOOPT /* see description */ // freestanding #define ENOSPC /* see description */ // freestanding #define ENOSYS /* see description */ // freestanding #define ENOTCONN /* see description */ // freestanding #define ENOTDIR /* see description */ // freestanding #define ENOTEMPTY /* see description */ // freestanding #define ENOTRECOVERABLE /* see description */ // freestanding #define ENOTSOCK /* see description */ // freestanding #define ENOTSUP /* see description */ // freestanding #define ENOTTY /* see description */ // freestanding #define ENXIO /* see description */ // freestanding #define EOPNOTSUPP /* see description */ // freestanding #define EOVERFLOW /* see description */ // freestanding #define EOWNERDEAD /* see description */ // freestanding #define EPERM /* see description */ // freestanding #define EPIPE /* see description */ // freestanding #define EPROTO /* see description */ // freestanding #define EPROTONOSUPPORT /* see description */ // freestanding #define EPROTOTYPE /* see description */ // freestanding #define ERANGE /* see description */ // freestanding #define EROFS /* see description */ // freestanding #define ESPIPE /* see description */ // freestanding #define ESRCH /* see description */ // freestanding #define ETIMEDOUT /* see description */ // freestanding #define ETXTBSY /* see description */ // freestanding #define EWOULDBLOCK /* see description */ // freestanding #define EXDEV /* see description */ // freestanding
[编辑] 缺陷报告
下列更改行为的缺陷报告追溯地应用于以前出版的 C++ 标准。
缺陷报告 | 应用于 | 发布时的行为 | 正确的行为 |
---|---|---|---|
LWG 288 | C++98 | 宏 EILSEQ 未在 <cerrno> 中定义 |
已定义 |