diff --git a/docs/src/errors.rst b/docs/src/errors.rst index 25d0efaf0..c7240f354 100644 --- a/docs/src/errors.rst +++ b/docs/src/errors.rst @@ -335,6 +335,10 @@ Error constants illegal byte sequence +.. c:macro:: UV_ESOCKTNOSUPPORT + + socket type not supported + API --- diff --git a/include/uv.h b/include/uv.h index d2bdcc9cf..7524ff95a 100644 --- a/include/uv.h +++ b/include/uv.h @@ -149,6 +149,7 @@ extern "C" { XX(ENOTTY, "inappropriate ioctl for device") \ XX(EFTYPE, "inappropriate file type or format") \ XX(EILSEQ, "illegal byte sequence") \ + XX(ESOCKTNOSUPPORT, "socket type not supported") \ #define UV_HANDLE_TYPE_MAP(XX) \ XX(ASYNC, async) \ diff --git a/include/uv/errno.h b/include/uv/errno.h index a0ca571b0..71906b3f5 100644 --- a/include/uv/errno.h +++ b/include/uv/errno.h @@ -451,4 +451,10 @@ # define UV__EOVERFLOW (-4026) #endif +#if defined(ESOCKTNOSUPPORT) && !defined(_WIN32) +# define UV__ESOCKTNOSUPPORT UV__ERR(ESOCKTNOSUPPORT) +#else +# define UV__ESOCKTNOSUPPORT (-4025) +#endif + #endif /* UV_ERRNO_H_ */ diff --git a/src/win/error.c b/src/win/error.c index 3ec984c83..3a269da87 100644 --- a/src/win/error.c +++ b/src/win/error.c @@ -105,7 +105,6 @@ int uv_translate_sys_error(int sys_errno) { case ERROR_SYMLINK_NOT_SUPPORTED: return UV_EINVAL; case WSAEINVAL: return UV_EINVAL; case WSAEPFNOSUPPORT: return UV_EINVAL; - case WSAESOCKTNOSUPPORT: return UV_EINVAL; case ERROR_BEGINNING_OF_MEDIA: return UV_EIO; case ERROR_BUS_RESET: return UV_EIO; case ERROR_CRC: return UV_EIO; @@ -168,6 +167,7 @@ int uv_translate_sys_error(int sys_errno) { case ERROR_NOT_SAME_DEVICE: return UV_EXDEV; case ERROR_INVALID_FUNCTION: return UV_EISDIR; case ERROR_META_EXPANSION_TOO_LONG: return UV_E2BIG; + case WSAESOCKTNOSUPPORT: return UV_ESOCKTNOSUPPORT; default: return UV_UNKNOWN; } }