From e6376b6a4195e9caa0f8600db4aaf499b91b65d9 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 15 Jul 2019 13:32:03 +0200 Subject: [PATCH] errno: add new ERRNO_IS_NOT_SUPPORTED() helper --- src/basic/errno-util.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/basic/errno-util.h b/src/basic/errno-util.h index 6053cde..b2723b8 100644 --- a/src/basic/errno-util.h +++ b/src/basic/errno-util.h @@ -86,3 +86,11 @@ static inline bool ERRNO_IS_RESOURCE(int r) { ENFILE, ENOMEM); } + +/* Three different errors for "operation/system call/ioctl not supported" */ +static inline bool ERRNO_IS_NOT_SUPPORTED(int r) { + return IN_SET(abs(r), + EOPNOTSUPP, + ENOTTY, + ENOSYS); +} -- 2.7.4