From e9cda2cfe71dce809a6ecba4ff913e24e36c233e Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Mon, 2 Oct 2017 21:03:39 +0200 Subject: [PATCH] unix, windows: map ENOTTY errno PR-URL: https://github.com/libuv/libuv/pull/1582 Refs: https://github.com/libuv/libuv/issues/1579 Reviewed-By: Colin Ihrig Reviewed-By: Santiago Gimeno --- include/uv-errno.h | 6 ++++++ include/uv.h | 1 + 2 files changed, 7 insertions(+) diff --git a/include/uv-errno.h b/include/uv-errno.h index 32bbc517..8a415331 100644 --- a/include/uv-errno.h +++ b/include/uv-errno.h @@ -422,4 +422,10 @@ # define UV__EREMOTEIO (-4030) #endif +#if defined(ENOTTY) && !defined(_WIN32) +# define UV__ENOTTY (-ENOTTY) +#else +# define UV__ENOTTY (-4029) +#endif + #endif /* UV_ERRNO_H_ */ diff --git a/include/uv.h b/include/uv.h index 0e4151d1..d6f8a216 100644 --- a/include/uv.h +++ b/include/uv.h @@ -141,6 +141,7 @@ extern "C" { XX(EMLINK, "too many links") \ XX(EHOSTDOWN, "host is down") \ XX(EREMOTEIO, "remote I/O error") \ + XX(ENOTTY, "inappropriate ioctl for device") \ #define UV_HANDLE_TYPE_MAP(XX) \ XX(ASYNC, async) \