mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-29 22:04:17 +01:00
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:
parent
14dc42b991
commit
3d3c13f90c
23
app/src/main/cpp/skyline/services/common/result.h
Normal file
23
app/src/main/cpp/skyline/services/common/result.h
Normal 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>;
|
||||
}
|
Loading…
Reference in New Issue
Block a user