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.
This commit is contained in:
Billy Laws 2021-07-17 13:56:53 +01:00
parent b533801bbe
commit 85c48d0e7e

View File

@ -0,0 +1,23 @@
// SPDX-License-Identifier: MPL-2.0
// Copyright © 2021 Skyline Team and Contributors (https://github.com/skyline-emu/)
#pragma once
#include <common.h>
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<typename ValueType>
using PosixResultValue = ResultValue<ValueType, PosixResult>;
}