boost :: system :: error_code产生错误158未知

时间:2014-08-27 15:56:12

标签: c++ linux boost openwrt

我正在使用boost::system::error_code将错误代码捕获到日志文件中,并且正在记录unknown error。我没有在网上找到任何对此错误的引用。

bool read_response_payload(size_t payload_len)
{
     boost::system::error_code ec;
     stream_connector<protocol_type, INTERFACE_BUFFER_LEN,
            INTERFACE_TIMEOUT_SECS>::read_all(payload_len, ec);
     if (ec) {
            LOGGER_LOG_WARN("Interface read error: %s", ec.message().c_str());
            stream_connector<protocol_type, INTERFACE_BUFFER_LEN,
                INTERFACE_TIMEOUT_SECS>::disconnect();
            return false;
     }
     else {
            return true;
     }
}

在日志文件中,我收到如下消息:

Interface read error: Unknown error 158

系统是:

root@OpenWrt:~# uname -a
Linux OpenWrt 2.6.30.9 #4 Thu Jul 3 16:08:13 BRT 2014 rlx GNU/Linux

1 个答案:

答案 0 :(得分:1)

正如评论中所建议的,这是来自OpenWRT的<asm/errno.h>中描述的错误

#define ECONNREFUSED    146 /* Connection refused */
#define EHOSTDOWN   147 /* Host is down */
#define EHOSTUNREACH    148 /* No route to host */
#define EWOULDBLOCK EAGAIN  /* Operation would block */
#define EALREADY    149 /* Operation already in progress */
#define EINPROGRESS 150 /* Operation now in progress */
#define ESTALE      151 /* Stale NFS file handle */
#define ECANCELED   158 /* AIO operation canceled */

已取消的异步IO操作。