我有以下代码返回错误号 22。我在任何地方都找不到 22 指的是什么,有人能指出我可能在哪里找到吗?
if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY,
(char *)&arg, sizeof(arg)) < 0) {
log.debug("unable to setsockopt TCP_NODELAY: %d", errorNumber());
return false;
}
我有以下代码返回错误号 22。我在任何地方都找不到 22 指的是什么,有人能指出我可能在哪里找到吗?
if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY,
(char *)&arg, sizeof(arg)) < 0) {
log.debug("unable to setsockopt TCP_NODELAY: %d", errorNumber());
return false;
}
Its defined in errno.h
or somewhere close to it. I would guess it to be EINVAL, but its really implementation dependent. You should check your return values with error code defines, not numeric values.
It's system specific.
Use e.g. strerror(3)
, strerror_r(3)
or perror(3)
to see error description.