From 85c48d0e7e1510d174486e889d4f6608b057a73a Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Sat, 17 Jul 2021 13:56:53 +0100 Subject: [PATCH] Add common PosixResult and PosixResultValue types Many services like bsd and nvdrv use these to represent the result values of functions so add a common type for these as an alternative to the macros. --- .../main/cpp/skyline/services/common/result.h | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 app/src/main/cpp/skyline/services/common/result.h diff --git a/app/src/main/cpp/skyline/services/common/result.h b/app/src/main/cpp/skyline/services/common/result.h new file mode 100644 index 00000000..62c287fa --- /dev/null +++ b/app/src/main/cpp/skyline/services/common/result.h @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: MPL-2.0 +// Copyright © 2021 Skyline Team and Contributors (https://github.com/skyline-emu/) + +#pragma once + +#include + +namespace skyline::service { + enum class PosixResult : i32 { + Success = 0, + NotPermitted = 1, // EPERM + TryAgain = 11, // EAGAIN + Busy = 16, // EBUSY + InvalidArgument = 22, // EINVAL + InappropriateIoctlForDevice = 25, // ENOTTY + NotSupported = 95, // EOPNOTSUPP, ENOTSUP + TimedOut = 110, // ETIMEDOUT + + }; + + template + using PosixResultValue = ResultValue; +}