diff options
| author | TSRBerry <20988865+TSRBerry@users.noreply.github.com> | 2023-07-16 19:31:14 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-16 19:31:14 +0200 |
| commit | 326749498bed4360e5a4b11fc67d5ec7cb9a3076 (patch) | |
| tree | ae21fb26f99b401ca4e9efaab72b679a81c22369 /src/Ryujinx.HLE/HOS/Services/Sockets/Bsd | |
| parent | fec8291c17fa106c28f58b56419e90d49a41a1ea (diff) | |
[Ryujinx.HLE] Address dotnet-format issues (#5380)
* dotnet format style --severity info
Some changes were manually reverted.
* dotnet format analyzers --serverity info
Some changes have been minimally adapted.
* Restore a few unused methods and variables
* Silence dotnet format IDE0060 warnings
* Silence dotnet format IDE0052 warnings
* Address or silence dotnet format IDE1006 warnings
* Address dotnet format CA1816 warnings
* Address or silence dotnet format CA2208 warnings
* Address or silence dotnet format CA1806 and a few CA1854 warnings
* Address dotnet format CA2211 warnings
* Address dotnet format CA1822 warnings
* Address or silence dotnet format CA1069 warnings
* Make dotnet format succeed in style mode
* Address or silence dotnet format CA2211 warnings
* Address review comments
* Address dotnet format CA2208 warnings properly
* Make ProcessResult readonly
* Address most dotnet format whitespace warnings
* Apply dotnet format whitespace formatting
A few of them have been manually reverted and the corresponding warning was silenced
* Add previously silenced warnings back
I have no clue how these disappeared
* Revert formatting changes for while and for-loops
* Format if-blocks correctly
* Run dotnet format style after rebase
* Run dotnet format whitespace after rebase
* Run dotnet format style after rebase
* Run dotnet format analyzers after rebase
* Run dotnet format after rebase and remove unused usings
- analyzers
- style
- whitespace
* Disable 'prefer switch expression' rule
* Add comments to disabled warnings
* Fix a few disabled warnings
* Fix naming rule violation, Convert shader properties to auto-property and convert values to const
* Simplify properties and array initialization, Use const when possible, Remove trailing commas
* Start working on disabled warnings
* Fix and silence a few dotnet-format warnings again
* Run dotnet format after rebase
* Use using declaration instead of block syntax
* Address IDE0251 warnings
* Address a few disabled IDE0060 warnings
* Silence IDE0060 in .editorconfig
* Revert "Simplify properties and array initialization, Use const when possible, Remove trailing commas"
This reverts commit 9462e4136c0a2100dc28b20cf9542e06790aa67e.
* dotnet format whitespace after rebase
* First dotnet format pass
* Fix naming rule violations
* Fix typo
* Add trailing commas, use targeted new and use array initializer
* Fix build issues
* Fix remaining build issues
* Remove SuppressMessage for CA1069 where possible
* Address dotnet format issues
* Address formatting issues
Co-authored-by: Ac_K <acoustik666@gmail.com>
* Add GetHashCode implementation for RenderingSurfaceInfo
* Explicitly silence CA1822 for every affected method in Syscall
* Address formatting issues in Demangler.cs
* Address review feedback
Co-authored-by: Ac_K <acoustik666@gmail.com>
* Revert marking service methods as static
* Next dotnet format pass
* Address review feedback
---------
Co-authored-by: Ac_K <acoustik666@gmail.com>
Diffstat (limited to 'src/Ryujinx.HLE/HOS/Services/Sockets/Bsd')
23 files changed, 373 insertions, 358 deletions
diff --git a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/BsdContext.cs b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/BsdContext.cs index b0ac6e68..254ad667 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/BsdContext.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/BsdContext.cs @@ -8,11 +8,11 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd { class BsdContext { - private static ConcurrentDictionary<ulong, BsdContext> _registry = new ConcurrentDictionary<ulong, BsdContext>(); + private static readonly ConcurrentDictionary<ulong, BsdContext> _registry = new(); private readonly object _lock = new(); - private List<IFileDescriptor> _fds; + private readonly List<IFileDescriptor> _fds; private BsdContext() { @@ -181,4 +181,4 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd return processContext; } } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/IClient.cs b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/IClient.cs index b63864c9..d16e7536 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/IClient.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/IClient.cs @@ -7,7 +7,6 @@ using System; using System.Collections.Generic; using System.Net; using System.Net.Sockets; -using System.Numerics; using System.Runtime.CompilerServices; using System.Text; @@ -17,14 +16,14 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd [Service("bsd:u", false)] class IClient : IpcService { - private static readonly List<IPollManager> _pollManagers = new List<IPollManager> + private static readonly List<IPollManager> _pollManagers = new() { EventFileDescriptorPollManager.Instance, - ManagedSocketPollManager.Instance + ManagedSocketPollManager.Instance, }; private BsdContext _context; - private bool _isPrivileged; + private readonly bool _isPrivileged; public IClient(ServiceCtx context, bool isPrivileged) : base(context.Device.System.BsdServer) { @@ -46,19 +45,14 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd private static AddressFamily ConvertBsdAddressFamily(BsdAddressFamily family) { - switch (family) + return family switch { - case BsdAddressFamily.Unspecified: - return AddressFamily.Unspecified; - case BsdAddressFamily.InterNetwork: - return AddressFamily.InterNetwork; - case BsdAddressFamily.InterNetworkV6: - return AddressFamily.InterNetworkV6; - case BsdAddressFamily.Unknown: - return AddressFamily.Unknown; - default: - throw new NotImplementedException(family.ToString()); - } + BsdAddressFamily.Unspecified => AddressFamily.Unspecified, + BsdAddressFamily.InterNetwork => AddressFamily.InterNetwork, + BsdAddressFamily.InterNetworkV6 => AddressFamily.InterNetworkV6, + BsdAddressFamily.Unknown => AddressFamily.Unknown, + _ => throw new NotImplementedException(family.ToString()), + }; } private LinuxError SetResultErrno(IFileDescriptor socket, int result) @@ -68,9 +62,9 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd private ResultCode SocketInternal(ServiceCtx context, bool exempt) { - BsdAddressFamily domain = (BsdAddressFamily)context.RequestData.ReadInt32(); - BsdSocketType type = (BsdSocketType)context.RequestData.ReadInt32(); - ProtocolType protocol = (ProtocolType)context.RequestData.ReadInt32(); + BsdAddressFamily domain = (BsdAddressFamily)context.RequestData.ReadInt32(); + BsdSocketType type = (BsdSocketType)context.RequestData.ReadInt32(); + ProtocolType protocol = (ProtocolType)context.RequestData.ReadInt32(); BsdSocketCreationFlags creationFlags = (BsdSocketCreationFlags)((int)type >> (int)BsdSocketCreationFlags.FlagsShift); type &= BsdSocketType.TypeMask; @@ -101,8 +95,10 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd } } - ISocket newBsdSocket = new ManagedSocket(netDomain, (SocketType)type, protocol); - newBsdSocket.Blocking = !creationFlags.HasFlag(BsdSocketCreationFlags.NonBlocking); + ISocket newBsdSocket = new ManagedSocket(netDomain, (SocketType)type, protocol) + { + Blocking = !creationFlags.HasFlag(BsdSocketCreationFlags.NonBlocking), + }; LinuxError errno = LinuxError.SUCCESS; @@ -210,7 +206,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd public ResultCode Select(ServiceCtx context) { int fdsCount = context.RequestData.ReadInt32(); - int timeout = context.RequestData.ReadInt32(); + int timeout = context.RequestData.ReadInt32(); (ulong readFdsInBufferPosition, ulong readFdsInBufferSize) = context.Request.GetBufferType0x21(0); (ulong writeFdsInBufferPosition, ulong writeFdsInBufferSize) = context.Request.GetBufferType0x21(1); @@ -220,7 +216,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd (ulong writeFdsOutBufferPosition, ulong writeFdsOutBufferSize) = context.Request.GetBufferType0x22(1); (ulong errorFdsOutBufferPosition, ulong errorFdsOutBufferSize) = context.Request.GetBufferType0x22(2); - List<IFileDescriptor> readFds = _context.RetrieveFileDescriptorsFromMask(context.Memory.GetSpan(readFdsInBufferPosition, (int)readFdsInBufferSize)); + List<IFileDescriptor> readFds = _context.RetrieveFileDescriptorsFromMask(context.Memory.GetSpan(readFdsInBufferPosition, (int)readFdsInBufferSize)); List<IFileDescriptor> writeFds = _context.RetrieveFileDescriptorsFromMask(context.Memory.GetSpan(writeFdsInBufferPosition, (int)writeFdsInBufferSize)); List<IFileDescriptor> errorFds = _context.RetrieveFileDescriptorsFromMask(context.Memory.GetSpan(errorFdsInBufferPosition, (int)errorFdsInBufferSize)); @@ -312,7 +308,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd } } - using var readFdsOut = context.Memory.GetWritableRegion(readFdsOutBufferPosition, (int)readFdsOutBufferSize); + using var readFdsOut = context.Memory.GetWritableRegion(readFdsOutBufferPosition, (int)readFdsOutBufferSize); using var writeFdsOut = context.Memory.GetWritableRegion(writeFdsOutBufferPosition, (int)writeFdsOutBufferSize); using var errorFdsOut = context.Memory.GetWritableRegion(errorFdsOutBufferPosition, (int)errorFdsOutBufferSize); @@ -330,10 +326,12 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd public ResultCode Poll(ServiceCtx context) { int fdsCount = context.RequestData.ReadInt32(); - int timeout = context.RequestData.ReadInt32(); + int timeout = context.RequestData.ReadInt32(); (ulong inputBufferPosition, ulong inputBufferSize) = context.Request.GetBufferType0x21(); +#pragma warning disable IDE0059 // Remove unnecessary value assignment (ulong outputBufferPosition, ulong outputBufferSize) = context.Request.GetBufferType0x22(); +#pragma warning restore IDE0059 if (timeout < -1 || fdsCount < 0 || (ulong)(fdsCount * 8) > inputBufferSize) { @@ -356,7 +354,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd events[i] = new PollEvent(pollEventData, fileDescriptor); } - List<PollEvent> discoveredEvents = new List<PollEvent>(); + List<PollEvent> discoveredEvents = new(); List<PollEvent>[] eventsByPollManager = new List<PollEvent>[_pollManagers.Count]; for (int i = 0; i < eventsByPollManager.Length; i++) @@ -389,7 +387,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd if (fdsCount != 0) { - bool IsUnexpectedLinuxError(LinuxError error) + static bool IsUnexpectedLinuxError(LinuxError error) { return error != LinuxError.SUCCESS && error != LinuxError.ETIMEDOUT; } @@ -478,16 +476,16 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd // Recv(u32 socket, u32 flags) -> (i32 ret, u32 bsd_errno, array<i8, 0x22> message) public ResultCode Recv(ServiceCtx context) { - int socketFd = context.RequestData.ReadInt32(); + int socketFd = context.RequestData.ReadInt32(); BsdSocketFlags socketFlags = (BsdSocketFlags)context.RequestData.ReadInt32(); (ulong receivePosition, ulong receiveLength) = context.Request.GetBufferType0x22(); WritableRegion receiveRegion = context.Memory.GetWritableRegion(receivePosition, (int)receiveLength); - LinuxError errno = LinuxError.EBADF; - ISocket socket = _context.RetrieveSocket(socketFd); - int result = -1; + LinuxError errno = LinuxError.EBADF; + ISocket socket = _context.RetrieveSocket(socketFd); + int result = -1; if (socket != null) { @@ -508,17 +506,17 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd // RecvFrom(u32 sock, u32 flags) -> (i32 ret, u32 bsd_errno, u32 addrlen, buffer<i8, 0x22, 0> message, buffer<nn::socket::sockaddr_in, 0x22, 0x10>) public ResultCode RecvFrom(ServiceCtx context) { - int socketFd = context.RequestData.ReadInt32(); + int socketFd = context.RequestData.ReadInt32(); BsdSocketFlags socketFlags = (BsdSocketFlags)context.RequestData.ReadInt32(); - (ulong receivePosition, ulong receiveLength) = context.Request.GetBufferType0x22(0); + (ulong receivePosition, ulong receiveLength) = context.Request.GetBufferType0x22(0); (ulong sockAddrOutPosition, ulong sockAddrOutSize) = context.Request.GetBufferType0x22(1); WritableRegion receiveRegion = context.Memory.GetWritableRegion(receivePosition, (int)receiveLength); - LinuxError errno = LinuxError.EBADF; - ISocket socket = _context.RetrieveSocket(socketFd); - int result = -1; + LinuxError errno = LinuxError.EBADF; + ISocket socket = _context.RetrieveSocket(socketFd); + int result = -1; if (socket != null) { @@ -530,7 +528,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd receiveRegion.Dispose(); - if (sockAddrOutSize != 0 && sockAddrOutSize >= (ulong) Unsafe.SizeOf<BsdSockAddr>()) + if (sockAddrOutSize != 0 && sockAddrOutSize >= (ulong)Unsafe.SizeOf<BsdSockAddr>()) { context.Memory.Write(sockAddrOutPosition, BsdSockAddr.FromIPEndPoint(endPoint)); } @@ -548,16 +546,16 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd // Send(u32 socket, u32 flags, buffer<i8, 0x21, 0>) -> (i32 ret, u32 bsd_errno) public ResultCode Send(ServiceCtx context) { - int socketFd = context.RequestData.ReadInt32(); + int socketFd = context.RequestData.ReadInt32(); BsdSocketFlags socketFlags = (BsdSocketFlags)context.RequestData.ReadInt32(); (ulong sendPosition, ulong sendSize) = context.Request.GetBufferType0x21(); ReadOnlySpan<byte> sendBuffer = context.Memory.GetSpan(sendPosition, (int)sendSize); - LinuxError errno = LinuxError.EBADF; - ISocket socket = _context.RetrieveSocket(socketFd); - int result = -1; + LinuxError errno = LinuxError.EBADF; + ISocket socket = _context.RetrieveSocket(socketFd); + int result = -1; if (socket != null) { @@ -576,17 +574,19 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd // SendTo(u32 socket, u32 flags, buffer<i8, 0x21, 0>, buffer<nn::socket::sockaddr_in, 0x21, 0x10>) -> (i32 ret, u32 bsd_errno) public ResultCode SendTo(ServiceCtx context) { - int socketFd = context.RequestData.ReadInt32(); + int socketFd = context.RequestData.ReadInt32(); BsdSocketFlags socketFlags = (BsdSocketFlags)context.RequestData.ReadInt32(); - (ulong sendPosition, ulong sendSize) = context.Request.GetBufferType0x21(0); + (ulong sendPosition, ulong sendSize) = context.Request.GetBufferType0x21(0); +#pragma warning disable IDE0059 // Remove unnecessary value assignment (ulong bufferPosition, ulong bufferSize) = context.Request.GetBufferType0x21(1); +#pragma warning restore IDE0059 ReadOnlySpan<byte> sendBuffer = context.Memory.GetSpan(sendPosition, (int)sendSize); - LinuxError errno = LinuxError.EBADF; - ISocket socket = _context.RetrieveSocket(socketFd); - int result = -1; + LinuxError errno = LinuxError.EBADF; + ISocket socket = _context.RetrieveSocket(socketFd); + int result = -1; if (socket != null) { @@ -609,10 +609,12 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd { int socketFd = context.RequestData.ReadInt32(); +#pragma warning disable IDE0059 // Remove unnecessary value assignment (ulong bufferPos, ulong bufferSize) = context.Request.GetBufferType0x22(); +#pragma warning restore IDE0059 - LinuxError errno = LinuxError.EBADF; - ISocket socket = _context.RetrieveSocket(socketFd); + LinuxError errno = LinuxError.EBADF; + ISocket socket = _context.RetrieveSocket(socketFd); if (socket != null) { @@ -652,10 +654,12 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd { int socketFd = context.RequestData.ReadInt32(); +#pragma warning disable IDE0059 // Remove unnecessary value assignment (ulong bufferPosition, ulong bufferSize) = context.Request.GetBufferType0x21(); +#pragma warning restore IDE0059 - LinuxError errno = LinuxError.EBADF; - ISocket socket = _context.RetrieveSocket(socketFd); + LinuxError errno = LinuxError.EBADF; + ISocket socket = _context.RetrieveSocket(socketFd); if (socket != null) { @@ -673,10 +677,12 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd { int socketFd = context.RequestData.ReadInt32(); +#pragma warning disable IDE0059 // Remove unnecessary value assignment (ulong bufferPosition, ulong bufferSize) = context.Request.GetBufferType0x21(); +#pragma warning restore IDE0059 - LinuxError errno = LinuxError.EBADF; - ISocket socket = _context.RetrieveSocket(socketFd); + LinuxError errno = LinuxError.EBADF; + ISocket socket = _context.RetrieveSocket(socketFd); if (socket != null) { @@ -694,10 +700,12 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd { int socketFd = context.RequestData.ReadInt32(); +#pragma warning disable IDE0059 // Remove unnecessary value assignment (ulong bufferPosition, ulong bufferSize) = context.Request.GetBufferType0x22(); +#pragma warning restore IDE0059 - LinuxError errno = LinuxError.EBADF; - ISocket socket = _context.RetrieveSocket(socketFd); + LinuxError errno = LinuxError.EBADF; + ISocket socket = _context.RetrieveSocket(socketFd); if (socket != null) { errno = LinuxError.ENOTCONN; @@ -721,10 +729,12 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd { int socketFd = context.RequestData.ReadInt32(); +#pragma warning disable IDE0059 // Remove unnecessary value assignment (ulong bufferPos, ulong bufferSize) = context.Request.GetBufferType0x22(); +#pragma warning restore IDE0059 - LinuxError errno = LinuxError.EBADF; - ISocket socket = _context.RetrieveSocket(socketFd); + LinuxError errno = LinuxError.EBADF; + ISocket socket = _context.RetrieveSocket(socketFd); if (socket != null) { @@ -742,15 +752,15 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd // GetSockOpt(u32 socket, u32 level, u32 option_name) -> (i32 ret, u32 bsd_errno, u32, buffer<unknown, 0x22, 0>) public ResultCode GetSockOpt(ServiceCtx context) { - int socketFd = context.RequestData.ReadInt32(); - SocketOptionLevel level = (SocketOptionLevel)context.RequestData.ReadInt32(); - BsdSocketOption option = (BsdSocketOption)context.RequestData.ReadInt32(); + int socketFd = context.RequestData.ReadInt32(); + SocketOptionLevel level = (SocketOptionLevel)context.RequestData.ReadInt32(); + BsdSocketOption option = (BsdSocketOption)context.RequestData.ReadInt32(); (ulong bufferPosition, ulong bufferSize) = context.Request.GetBufferType0x22(); WritableRegion optionValue = context.Memory.GetWritableRegion(bufferPosition, (int)bufferSize); - LinuxError errno = LinuxError.EBADF; - ISocket socket = _context.RetrieveSocket(socketFd); + LinuxError errno = LinuxError.EBADF; + ISocket socket = _context.RetrieveSocket(socketFd); if (socket != null) { @@ -770,10 +780,10 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd public ResultCode Listen(ServiceCtx context) { int socketFd = context.RequestData.ReadInt32(); - int backlog = context.RequestData.ReadInt32(); + int backlog = context.RequestData.ReadInt32(); - LinuxError errno = LinuxError.EBADF; - ISocket socket = _context.RetrieveSocket(socketFd); + LinuxError errno = LinuxError.EBADF; + ISocket socket = _context.RetrieveSocket(socketFd); if (socket != null) { @@ -787,12 +797,14 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd // Ioctl(u32 fd, u32 request, u32 bufcount, buffer<unknown, 0x21, 0>, buffer<unknown, 0x21, 0>, buffer<unknown, 0x21, 0>, buffer<unknown, 0x21, 0>) -> (i32 ret, u32 bsd_errno, buffer<unknown, 0x22, 0>, buffer<unknown, 0x22, 0>, buffer<unknown, 0x22, 0>, buffer<unknown, 0x22, 0>) public ResultCode Ioctl(ServiceCtx context) { - int socketFd = context.RequestData.ReadInt32(); - BsdIoctl cmd = (BsdIoctl)context.RequestData.ReadInt32(); - int bufferCount = context.RequestData.ReadInt32(); + int socketFd = context.RequestData.ReadInt32(); + BsdIoctl cmd = (BsdIoctl)context.RequestData.ReadInt32(); +#pragma warning disable IDE0059 // Remove unnecessary value assignment + int bufferCount = context.RequestData.ReadInt32(); +#pragma warning restore IDE0059 - LinuxError errno = LinuxError.EBADF; - ISocket socket = _context.RetrieveSocket(socketFd); + LinuxError errno = LinuxError.EBADF; + ISocket socket = _context.RetrieveSocket(socketFd); if (socket != null) { @@ -801,7 +813,9 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd case BsdIoctl.AtMark: errno = LinuxError.SUCCESS; +#pragma warning disable IDE0059 // Remove unnecessary value assignment (ulong bufferPosition, ulong bufferSize) = context.Request.GetBufferType0x22(); +#pragma warning restore IDE0059 // FIXME: OOB not implemented. context.Memory.Write(bufferPosition, 0); @@ -823,12 +837,12 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd public ResultCode Fcntl(ServiceCtx context) { int socketFd = context.RequestData.ReadInt32(); - int cmd = context.RequestData.ReadInt32(); - int arg = context.RequestData.ReadInt32(); + int cmd = context.RequestData.ReadInt32(); + int arg = context.RequestData.ReadInt32(); - int result = 0; - LinuxError errno = LinuxError.EBADF; - ISocket socket = _context.RetrieveSocket(socketFd); + int result = 0; + LinuxError errno = LinuxError.EBADF; + ISocket socket = _context.RetrieveSocket(socketFd); if (socket != null) { @@ -856,16 +870,16 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd // SetSockOpt(u32 socket, u32 level, u32 option_name, buffer<unknown, 0x21, 0> option_value) -> (i32 ret, u32 bsd_errno) public ResultCode SetSockOpt(ServiceCtx context) { - int socketFd = context.RequestData.ReadInt32(); - SocketOptionLevel level = (SocketOptionLevel)context.RequestData.ReadInt32(); - BsdSocketOption option = (BsdSocketOption)context.RequestData.ReadInt32(); + int socketFd = context.RequestData.ReadInt32(); + SocketOptionLevel level = (SocketOptionLevel)context.RequestData.ReadInt32(); + BsdSocketOption option = (BsdSocketOption)context.RequestData.ReadInt32(); (ulong bufferPos, ulong bufferSize) = context.Request.GetBufferType0x21(); ReadOnlySpan<byte> optionValue = context.Memory.GetSpan(bufferPos, (int)bufferSize); - LinuxError errno = LinuxError.EBADF; - ISocket socket = _context.RetrieveSocket(socketFd); + LinuxError errno = LinuxError.EBADF; + ISocket socket = _context.RetrieveSocket(socketFd); if (socket != null) { @@ -880,10 +894,10 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd public ResultCode Shutdown(ServiceCtx context) { int socketFd = context.RequestData.ReadInt32(); - int how = context.RequestData.ReadInt32(); + int how = context.RequestData.ReadInt32(); - LinuxError errno = LinuxError.EBADF; - ISocket socket = _context.RetrieveSocket(socketFd); + LinuxError errno = LinuxError.EBADF; + ISocket socket = _context.RetrieveSocket(socketFd); if (socket != null) { @@ -924,9 +938,9 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd ReadOnlySpan<byte> sendBuffer = context.Memory.GetSpan(sendPosition, (int)sendSize); - LinuxError errno = LinuxError.EBADF; - IFileDescriptor file = _context.RetrieveFileDescriptor(fd); - int result = -1; + LinuxError errno = LinuxError.EBADF; + IFileDescriptor file = _context.RetrieveFileDescriptor(fd); + int result = -1; if (file != null) { @@ -951,9 +965,9 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd WritableRegion receiveRegion = context.Memory.GetWritableRegion(receivePosition, (int)receiveLength); - LinuxError errno = LinuxError.EBADF; - IFileDescriptor file = _context.RetrieveFileDescriptor(fd); - int result = -1; + LinuxError errno = LinuxError.EBADF; + IFileDescriptor file = _context.RetrieveFileDescriptor(fd); + int result = -1; if (file != null) { @@ -990,8 +1004,10 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd // DuplicateSocket(u32 fd, u64 reserved) -> (i32 ret, u32 bsd_errno) public ResultCode DuplicateSocket(ServiceCtx context) { - int fd = context.RequestData.ReadInt32(); + int fd = context.RequestData.ReadInt32(); +#pragma warning disable IDE0059 // Remove unnecessary value assignment ulong reserved = context.RequestData.ReadUInt64(); +#pragma warning restore IDE0059 LinuxError errno = LinuxError.ENOENT; int newSockFd = -1; @@ -1016,20 +1032,22 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd // RecvMMsg(u32 fd, u32 vlen, u32 flags, u32 reserved, nn::socket::TimeVal timeout) -> (i32 ret, u32 bsd_errno, buffer<bytes, 6> message); public ResultCode RecvMMsg(ServiceCtx context) { - int socketFd = context.RequestData.ReadInt32(); - int vlen = context.RequestData.ReadInt32(); + int socketFd = context.RequestData.ReadInt32(); + int vlen = context.RequestData.ReadInt32(); BsdSocketFlags socketFlags = (BsdSocketFlags)context.RequestData.ReadInt32(); - uint reserved = context.RequestData.ReadUInt32(); - TimeVal timeout = context.RequestData.ReadStruct<TimeVal>(); +#pragma warning disable IDE0059 // Remove unnecessary value assignment + uint reserved = context.RequestData.ReadUInt32(); +#pragma warning restore IDE0059 + TimeVal timeout = context.RequestData.ReadStruct<TimeVal>(); ulong receivePosition = context.Request.ReceiveBuff[0].Position; ulong receiveLength = context.Request.ReceiveBuff[0].Size; WritableRegion receiveRegion = context.Memory.GetWritableRegion(receivePosition, (int)receiveLength); - LinuxError errno = LinuxError.EBADF; - ISocket socket = _context.RetrieveSocket(socketFd); - int result = -1; + LinuxError errno = LinuxError.EBADF; + ISocket socket = _context.RetrieveSocket(socketFd); + int result = -1; if (socket != null) { @@ -1059,8 +1077,8 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd // SendMMsg(u32 fd, u32 vlen, u32 flags) -> (i32 ret, u32 bsd_errno, buffer<bytes, 6> message); public ResultCode SendMMsg(ServiceCtx context) { - int socketFd = context.RequestData.ReadInt32(); - int vlen = context.RequestData.ReadInt32(); + int socketFd = context.RequestData.ReadInt32(); + int vlen = context.RequestData.ReadInt32(); BsdSocketFlags socketFlags = (BsdSocketFlags)context.RequestData.ReadInt32(); ulong receivePosition = context.Request.ReceiveBuff[0].Position; @@ -1068,9 +1086,9 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd WritableRegion receiveRegion = context.Memory.GetWritableRegion(receivePosition, (int)receiveLength); - LinuxError errno = LinuxError.EBADF; - ISocket socket = _context.RetrieveSocket(socketFd); - int result = -1; + LinuxError errno = LinuxError.EBADF; + ISocket socket = _context.RetrieveSocket(socketFd); + int result = -1; if (socket != null) { @@ -1104,7 +1122,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd context.RequestData.BaseStream.Position += 4; // Padding ulong initialValue = context.RequestData.ReadUInt64(); - EventFileDescriptor newEventFile = new EventFileDescriptor(initialValue, flags); + EventFileDescriptor newEventFile = new(initialValue, flags); LinuxError errno = LinuxError.SUCCESS; @@ -1118,4 +1136,4 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd return WriteBsdResult(context, newSockFd, errno); } } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/IFileDescriptor.cs b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/IFileDescriptor.cs index 9d4f81ce..dbeb9022 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/IFileDescriptor.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/IFileDescriptor.cs @@ -12,4 +12,4 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd LinuxError Write(out int writeSize, ReadOnlySpan<byte> buffer); } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/EventFileDescriptor.cs b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/EventFileDescriptor.cs index d7b53158..937d2fd7 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/EventFileDescriptor.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/EventFileDescriptor.cs @@ -150,4 +150,4 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Impl } } } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/EventFileDescriptorPollManager.cs b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/EventFileDescriptorPollManager.cs index e0ab68c6..9039d49a 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/EventFileDescriptorPollManager.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/EventFileDescriptorPollManager.cs @@ -13,10 +13,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Impl { get { - if (_instance == null) - { - _instance = new EventFileDescriptorPollManager(); - } + _instance ??= new EventFileDescriptorPollManager(); return _instance; } @@ -31,7 +28,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Impl { updatedCount = 0; - List<ManualResetEvent> waiters = new List<ManualResetEvent>(); + List<ManualResetEvent> waiters = new(); for (int i = 0; i < events.Count; i++) { @@ -119,4 +116,4 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Impl return LinuxError.EOPNOTSUPP; } } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/ManagedSocket.cs b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/ManagedSocket.cs index 75efc49a..dfc2a672 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/ManagedSocket.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/ManagedSocket.cs @@ -462,7 +462,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Impl if (!CanSupportMMsgHdr(message)) { - Logger.Warning?.Print(LogClass.ServiceBsd, $"Unsupported BsdMMsgHdr"); + Logger.Warning?.Print(LogClass.ServiceBsd, "Unsupported BsdMMsgHdr"); return LinuxError.EOPNOTSUPP; } @@ -500,7 +500,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Impl if (!CanSupportMMsgHdr(message)) { - Logger.Warning?.Print(LogClass.ServiceBsd, $"Unsupported BsdMMsgHdr"); + Logger.Warning?.Print(LogClass.ServiceBsd, "Unsupported BsdMMsgHdr"); return LinuxError.EOPNOTSUPP; } @@ -527,4 +527,4 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Impl } } } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/ManagedSocketPollManager.cs b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/ManagedSocketPollManager.cs index 1b305dfb..10d9882c 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/ManagedSocketPollManager.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/ManagedSocketPollManager.cs @@ -13,10 +13,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Impl { get { - if (_instance == null) - { - _instance = new ManagedSocketPollManager(); - } + _instance ??= new ManagedSocketPollManager(); return _instance; } @@ -29,9 +26,9 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Impl public LinuxError Poll(List<PollEvent> events, int timeoutMilliseconds, out int updatedCount) { - List<Socket> readEvents = new List<Socket>(); - List<Socket> writeEvents = new List<Socket>(); - List<Socket> errorEvents = new List<Socket>(); + List<Socket> readEvents = new(); + List<Socket> writeEvents = new(); + List<Socket> errorEvents = new(); updatedCount = 0; @@ -174,4 +171,4 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Impl return LinuxError.SUCCESS; } } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/WSAError.cs b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/WSAError.cs index 0f24a57f..5f3495df 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/WSAError.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/WSAError.cs @@ -9,77 +9,77 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Impl * All Windows Sockets error constants are biased by WSABASEERR from * the "normal" */ - WSABASEERR = 10000, + WSABASEERR = 10000, /* * Windows Sockets definitions of regular Microsoft C error constants */ - WSAEINTR = (WSABASEERR + 4), - WSAEBADF = (WSABASEERR + 9), - WSAEACCES = (WSABASEERR + 13), - WSAEFAULT = (WSABASEERR + 14), - WSAEINVAL = (WSABASEERR + 22), - WSAEMFILE = (WSABASEERR + 24), + WSAEINTR = (WSABASEERR + 4), + WSAEBADF = (WSABASEERR + 9), + WSAEACCES = (WSABASEERR + 13), + WSAEFAULT = (WSABASEERR + 14), + WSAEINVAL = (WSABASEERR + 22), + WSAEMFILE = (WSABASEERR + 24), /* * Windows Sockets definitions of regular Berkeley error constants */ - WSAEWOULDBLOCK = (WSABASEERR + 35), - WSAEINPROGRESS = (WSABASEERR + 36), - WSAEALREADY = (WSABASEERR + 37), - WSAENOTSOCK = (WSABASEERR + 38), - WSAEDESTADDRREQ = (WSABASEERR + 39), - WSAEMSGSIZE = (WSABASEERR + 40), - WSAEPROTOTYPE = (WSABASEERR + 41), - WSAENOPROTOOPT = (WSABASEERR + 42), - WSAEPROTONOSUPPORT = (WSABASEERR + 43), - WSAESOCKTNOSUPPORT = (WSABASEERR + 44), - WSAEOPNOTSUPP = (WSABASEERR + 45), - WSAEPFNOSUPPORT = (WSABASEERR + 46), - WSAEAFNOSUPPORT = (WSABASEERR + 47), - WSAEADDRINUSE = (WSABASEERR + 48), - WSAEADDRNOTAVAIL = (WSABASEERR + 49), - WSAENETDOWN = (WSABASEERR + 50), - WSAENETUNREACH = (WSABASEERR + 51), - WSAENETRESET = (WSABASEERR + 52), - WSAECONNABORTED = (WSABASEERR + 53), - WSAECONNRESET = (WSABASEERR + 54), - WSAENOBUFS = (WSABASEERR + 55), - WSAEISCONN = (WSABASEERR + 56), - WSAENOTCONN = (WSABASEERR + 57), - WSAESHUTDOWN = (WSABASEERR + 58), - WSAETOOMANYREFS = (WSABASEERR + 59), - WSAETIMEDOUT = (WSABASEERR + 60), - WSAECONNREFUSED = (WSABASEERR + 61), - WSAELOOP = (WSABASEERR + 62), - WSAENAMETOOLONG = (WSABASEERR + 63), - WSAEHOSTDOWN = (WSABASEERR + 64), - WSAEHOSTUNREACH = (WSABASEERR + 65), - WSAENOTEMPTY = (WSABASEERR + 66), - WSAEPROCLIM = (WSABASEERR + 67), - WSAEUSERS = (WSABASEERR + 68), - WSAEDQUOT = (WSABASEERR + 69), - WSAESTALE = (WSABASEERR + 70), - WSAEREMOTE = (WSABASEERR + 71), + WSAEWOULDBLOCK = (WSABASEERR + 35), + WSAEINPROGRESS = (WSABASEERR + 36), + WSAEALREADY = (WSABASEERR + 37), + WSAENOTSOCK = (WSABASEERR + 38), + WSAEDESTADDRREQ = (WSABASEERR + 39), + WSAEMSGSIZE = (WSABASEERR + 40), + WSAEPROTOTYPE = (WSABASEERR + 41), + WSAENOPROTOOPT = (WSABASEERR + 42), + WSAEPROTONOSUPPORT = (WSABASEERR + 43), + WSAESOCKTNOSUPPORT = (WSABASEERR + 44), + WSAEOPNOTSUPP = (WSABASEERR + 45), + WSAEPFNOSUPPORT = (WSABASEERR + 46), + WSAEAFNOSUPPORT = (WSABASEERR + 47), + WSAEADDRINUSE = (WSABASEERR + 48), + WSAEADDRNOTAVAIL = (WSABASEERR + 49), + WSAENETDOWN = (WSABASEERR + 50), + WSAENETUNREACH = (WSABASEERR + 51), + WSAENETRESET = (WSABASEERR + 52), + WSAECONNABORTED = (WSABASEERR + 53), + WSAECONNRESET = (WSABASEERR + 54), + WSAENOBUFS = (WSABASEERR + 55), + WSAEISCONN = (WSABASEERR + 56), + WSAENOTCONN = (WSABASEERR + 57), + WSAESHUTDOWN = (WSABASEERR + 58), + WSAETOOMANYREFS = (WSABASEERR + 59), + WSAETIMEDOUT = (WSABASEERR + 60), + WSAECONNREFUSED = (WSABASEERR + 61), + WSAELOOP = (WSABASEERR + 62), + WSAENAMETOOLONG = (WSABASEERR + 63), + WSAEHOSTDOWN = (WSABASEERR + 64), + WSAEHOSTUNREACH = (WSABASEERR + 65), + WSAENOTEMPTY = (WSABASEERR + 66), + WSAEPROCLIM = (WSABASEERR + 67), + WSAEUSERS = (WSABASEERR + 68), + WSAEDQUOT = (WSABASEERR + 69), + WSAESTALE = (WSABASEERR + 70), + WSAEREMOTE = (WSABASEERR + 71), /* * Extended Windows Sockets error constant definitions */ - WSASYSNOTREADY = (WSABASEERR + 91), - WSAVERNOTSUPPORTED = (WSABASEERR + 92), - WSANOTINITIALISED = (WSABASEERR + 93), - WSAEDISCON = (WSABASEERR + 101), - WSAENOMORE = (WSABASEERR + 102), - WSAECANCELLED = (WSABASEERR + 103), - WSAEINVALIDPROCTABLE = (WSABASEERR + 104), - WSAEINVALIDPROVIDER = (WSABASEERR + 105), - WSAEPROVIDERFAILEDINIT = (WSABASEERR + 106), - WSASYSCALLFAILURE = (WSABASEERR + 107), - WSASERVICE_NOT_FOUND = (WSABASEERR + 108), - WSATYPE_NOT_FOUND = (WSABASEERR + 109), - WSA_E_NO_MORE = (WSABASEERR + 110), - WSA_E_CANCELLED = (WSABASEERR + 111), - WSAEREFUSED = (WSABASEERR + 112), + WSASYSNOTREADY = (WSABASEERR + 91), + WSAVERNOTSUPPORTED = (WSABASEERR + 92), + WSANOTINITIALISED = (WSABASEERR + 93), + WSAEDISCON = (WSABASEERR + 101), + WSAENOMORE = (WSABASEERR + 102), + WSAECANCELLED = (WSABASEERR + 103), + WSAEINVALIDPROCTABLE = (WSABASEERR + 104), + WSAEINVALIDPROVIDER = (WSABASEERR + 105), + WSAEPROVIDERFAILEDINIT = (WSABASEERR + 106), + WSASYSCALLFAILURE = (WSABASEERR + 107), + WSASERVICE_NOT_FOUND = (WSABASEERR + 108), + WSATYPE_NOT_FOUND = (WSABASEERR + 109), + WSA_E_NO_MORE = (WSABASEERR + 110), + WSA_E_CANCELLED = (WSABASEERR + 111), + WSAEREFUSED = (WSABASEERR + 112), /* * Error return codes from gethostbyname() and gethostbyaddr() @@ -93,42 +93,42 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Impl */ /* Authoritative Answer: Host not found */ - WSAHOST_NOT_FOUND = (WSABASEERR + 1001), + WSAHOST_NOT_FOUND = (WSABASEERR + 1001), /* Non-Authoritative: Host not found, or SERVERFAIL */ - WSATRY_AGAIN = (WSABASEERR + 1002), + WSATRY_AGAIN = (WSABASEERR + 1002), /* Non-recoverable errors, FORMERR, REFUSED, NOTIMP */ - WSANO_RECOVERY = (WSABASEERR + 1003), + WSANO_RECOVERY = (WSABASEERR + 1003), /* Valid name, no data record of requested type */ - WSANO_DATA = (WSABASEERR + 1004), + WSANO_DATA = (WSABASEERR + 1004), /* * Define QOS related error return codes * */ - WSA_QOS_RECEIVERS = (WSABASEERR + 1005), + WSA_QOS_RECEIVERS = (WSABASEERR + 1005), /* at least one Reserve has arrived */ - WSA_QOS_SENDERS = (WSABASEERR + 1006), + WSA_QOS_SENDERS = (WSABASEERR + 1006), /* at least one Path has arrived */ - WSA_QOS_NO_SENDERS = (WSABASEERR + 1007), + WSA_QOS_NO_SENDERS = (WSABASEERR + 1007), /* there are no senders */ - WSA_QOS_NO_RECEIVERS = (WSABASEERR + 1008), + WSA_QOS_NO_RECEIVERS = (WSABASEERR + 1008), /* there are no receivers */ - WSA_QOS_REQUEST_CONFIRMED = (WSABASEERR + 1009), + WSA_QOS_REQUEST_CONFIRMED = (WSABASEERR + 1009), /* Reserve has been confirmed */ - WSA_QOS_ADMISSION_FAILURE = (WSABASEERR + 1010), + WSA_QOS_ADMISSION_FAILURE = (WSABASEERR + 1010), /* error due to lack of resources */ - WSA_QOS_POLICY_FAILURE = (WSABASEERR + 1011), + WSA_QOS_POLICY_FAILURE = (WSABASEERR + 1011), /* rejected for administrative reasons - bad credentials */ - WSA_QOS_BAD_STYLE = (WSABASEERR + 1012), + WSA_QOS_BAD_STYLE = (WSABASEERR + 1012), /* unknown or conflicting style */ - WSA_QOS_BAD_OBJECT = (WSABASEERR + 1013), + WSA_QOS_BAD_OBJECT = (WSABASEERR + 1013), /* problem with some part of the filterspec or providerspecific * buffer in general */ WSA_QOS_TRAFFIC_CTRL_ERROR = (WSABASEERR + 1014), /* problem with some part of the flowspec */ - WSA_QOS_GENERIC_ERROR = (WSABASEERR + 1015) + WSA_QOS_GENERIC_ERROR = (WSABASEERR + 1015), } } diff --git a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/WinSockHelper.cs b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/WinSockHelper.cs index 5668d30b..9df18023 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/WinSockHelper.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/WinSockHelper.cs @@ -1,5 +1,5 @@ using Ryujinx.HLE.HOS.Services.Sockets.Bsd.Types; -using System; +using System; using System.Collections.Generic; using System.Net.Sockets; @@ -88,7 +88,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Impl // WSAEFAULT { WsaError.WSAEFAULT, LinuxError.EFAULT }, // NOERROR - { 0, 0 } + { 0, 0 }, }; private static readonly Dictionary<int, LinuxError> _errorMapMacOs = new() @@ -136,7 +136,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Impl { 59, LinuxError.ETOOMANYREFS }, { 92, LinuxError.EILSEQ }, { 89, LinuxError.ECANCELED }, - { 84, LinuxError.EOVERFLOW } + { 84, LinuxError.EOVERFLOW }, }; private static readonly Dictionary<BsdSocketOption, SocketOptionName> _soSocketOptionMap = new() @@ -157,7 +157,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Impl { BsdSocketOption.SoSndTimeo, SocketOptionName.SendTimeout }, { BsdSocketOption.SoRcvTimeo, SocketOptionName.ReceiveTimeout }, { BsdSocketOption.SoError, SocketOptionName.Error }, - { BsdSocketOption.SoType, SocketOptionName.Type } + { BsdSocketOption.SoType, SocketOptionName.Type }, }; private static readonly Dictionary<BsdSocketOption, SocketOptionName> _ipSocketOptionMap = new() @@ -172,7 +172,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Impl { BsdSocketOption.IpDropMembership, SocketOptionName.DropMembership }, { BsdSocketOption.IpDontFrag, SocketOptionName.DontFragment }, { BsdSocketOption.IpAddSourceMembership, SocketOptionName.AddSourceMembership }, - { BsdSocketOption.IpDropSourceMembership, SocketOptionName.DropSourceMembership } + { BsdSocketOption.IpDropSourceMembership, SocketOptionName.DropSourceMembership }, }; private static readonly Dictionary<BsdSocketOption, SocketOptionName> _tcpSocketOptionMap = new() @@ -180,7 +180,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Impl { BsdSocketOption.TcpNoDelay, SocketOptionName.NoDelay }, { BsdSocketOption.TcpKeepIdle, SocketOptionName.TcpKeepAliveTime }, { BsdSocketOption.TcpKeepIntvl, SocketOptionName.TcpKeepAliveInterval }, - { BsdSocketOption.TcpKeepCnt, SocketOptionName.TcpKeepAliveRetryCount } + { BsdSocketOption.TcpKeepCnt, SocketOptionName.TcpKeepAliveRetryCount }, }; public static LinuxError ConvertError(WsaError errorCode) @@ -210,7 +210,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Impl SocketOptionLevel.Socket => _soSocketOptionMap, SocketOptionLevel.IP => _ipSocketOptionMap, SocketOptionLevel.Tcp => _tcpSocketOptionMap, - _ => null + _ => null, }; if (table == null) @@ -222,4 +222,4 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Impl return table.TryGetValue(option, out name); } } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/ServerInterface.cs b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/ServerInterface.cs index 798fc015..9afdf250 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/ServerInterface.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/ServerInterface.cs @@ -5,4 +5,4 @@ { public ServerInterface(ServiceCtx context) { } } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdAddressFamily.cs b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdAddressFamily.cs index 37461bb2..74794638 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdAddressFamily.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdAddressFamily.cs @@ -6,6 +6,6 @@ InterNetwork = 2, InterNetworkV6 = 28, - Unknown = uint.MaxValue + Unknown = uint.MaxValue, } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdIoctl.cs b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdIoctl.cs index 1dfa5a5f..9c330e35 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdIoctl.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdIoctl.cs @@ -2,6 +2,6 @@ { enum BsdIoctl { - AtMark = 0x40047307 + AtMark = 0x40047307, } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdSockAddr.cs b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdSockAddr.cs index 67c11e54..af3a44e8 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdSockAddr.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdSockAddr.cs @@ -16,7 +16,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Types public IPEndPoint ToIPEndPoint() { - IPAddress address = new IPAddress(Address.AsSpan()); + IPAddress address = new(Address.AsSpan()); int port = (ushort)IPAddress.NetworkToHostOrder((short)Port); return new IPEndPoint(address, port); @@ -24,11 +24,11 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Types public static BsdSockAddr FromIPEndPoint(IPEndPoint endpoint) { - BsdSockAddr result = new BsdSockAddr + BsdSockAddr result = new() { Length = 0, Family = (byte)endpoint.AddressFamily, - Port = (ushort)IPAddress.HostToNetworkOrder((short)endpoint.Port) + Port = (ushort)IPAddress.HostToNetworkOrder((short)endpoint.Port), }; endpoint.Address.GetAddressBytes().AsSpan().CopyTo(result.Address.AsSpan()); diff --git a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdSocketCreationFlags.cs b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdSocketCreationFlags.cs index be5991ff..ac79deb3 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdSocketCreationFlags.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdSocketCreationFlags.cs @@ -9,6 +9,6 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Types CloseOnExecution = 1, NonBlocking = 2, - FlagsShift = 28 + FlagsShift = 28, } } diff --git a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdSocketFlags.cs b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdSocketFlags.cs index 4408c89a..63998129 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdSocketFlags.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdSocketFlags.cs @@ -17,6 +17,6 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Types Compat = 0x8000, SoCallbck = 0x10000, NoSignal = 0x20000, - CMsgCloExec = 0x40000 + CMsgCloExec = 0x40000, } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdSocketOption.cs b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdSocketOption.cs index 4d0d1dcf..5bc3e81f 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdSocketOption.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdSocketOption.cs @@ -1,5 +1,8 @@ +using System.Diagnostics.CodeAnalysis; + namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Types { + [SuppressMessage("Design", "CA1069: Enums values should not be duplicated")] enum BsdSocketOption { SoDebug = 0x1, @@ -114,6 +117,6 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Types TcpKeepInit = 128, TcpKeepIdle = 256, TcpKeepIntvl = 512, - TcpKeepCnt = 1024 + TcpKeepCnt = 1024, } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdSocketShutdownFlags.cs b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdSocketShutdownFlags.cs index 13230ac3..883e3c31 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdSocketShutdownFlags.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/BsdSocketShutdownFlags.cs @@ -4,6 +4,6 @@ { Receive, Send, - ReceiveAndSend + ReceiveAndSend, } } diff --git a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/EventFdFlags.cs b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/EventFdFlags.cs index e01d8226..996facd3 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/EventFdFlags.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/EventFdFlags.cs @@ -7,6 +7,6 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Types { None = 0, Semaphore = 1 << 0, - NonBlocking = 1 << 2 + NonBlocking = 1 << 2, } } diff --git a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/IPollManager.cs b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/IPollManager.cs index d3663878..66b1bcf1 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/IPollManager.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/IPollManager.cs @@ -10,4 +10,4 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Types LinuxError Select(List<PollEvent> events, int timeout, out int updatedCount); } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/LinuxError.cs b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/LinuxError.cs index 96602830..aaeee44d 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/LinuxError.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/LinuxError.cs @@ -5,44 +5,44 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Types [SuppressMessage("ReSharper", "InconsistentNaming")] enum LinuxError { - SUCCESS = 0, - EPERM = 1 /* Operation not permitted */, - ENOENT = 2 /* No such file or directory */, - ESRCH = 3 /* No such process */, - EINTR = 4 /* Interrupted system call */, - EIO = 5 /* I/O error */, - ENXIO = 6 /* No such device or address */, - E2BIG = 7 /* Argument list too long */, - ENOEXEC = 8 /* Exec format error */, - EBADF = 9 /* Bad file number */, - ECHILD = 10 /* No child processes */, - EAGAIN = 11 /* Try again */, - ENOMEM = 12 /* Out of memory */, - EACCES = 13 /* Permission denied */, - EFAULT = 14 /* Bad address */, - ENOTBLK = 15 /* Block device required */, - EBUSY = 16 /* Device or resource busy */, - EEXIST = 17 /* File exists */, - EXDEV = 18 /* Cross-device link */, - ENODEV = 19 /* No such device */, - ENOTDIR = 20 /* Not a directory */, - EISDIR = 21 /* Is a directory */, - EINVAL = 22 /* Invalid argument */, - ENFILE = 23 /* File table overflow */, - EMFILE = 24 /* Too many open files */, - ENOTTY = 25 /* Not a typewriter */, - ETXTBSY = 26 /* Text file busy */, - EFBIG = 27 /* File too large */, - ENOSPC = 28 /* No space left on device */, - ESPIPE = 29 /* Illegal seek */, - EROFS = 30 /* Read-only file system */, - EMLINK = 31 /* Too many links */, - EPIPE = 32 /* Broken pipe */, - EDOM = 33 /* Math argument out of domain of func */, - ERANGE = 34 /* Math result not representable */, - EDEADLK = 35 /* Resource deadlock would occur */, - ENAMETOOLONG = 36 /* File name too long */, - ENOLCK = 37 /* No record locks available */, + SUCCESS = 0, + EPERM = 1 /* Operation not permitted */, + ENOENT = 2 /* No such file or directory */, + ESRCH = 3 /* No such process */, + EINTR = 4 /* Interrupted system call */, + EIO = 5 /* I/O error */, + ENXIO = 6 /* No such device or address */, + E2BIG = 7 /* Argument list too long */, + ENOEXEC = 8 /* Exec format error */, + EBADF = 9 /* Bad file number */, + ECHILD = 10 /* No child processes */, + EAGAIN = 11 /* Try again */, + ENOMEM = 12 /* Out of memory */, + EACCES = 13 /* Permission denied */, + EFAULT = 14 /* Bad address */, + ENOTBLK = 15 /* Block device required */, + EBUSY = 16 /* Device or resource busy */, + EEXIST = 17 /* File exists */, + EXDEV = 18 /* Cross-device link */, + ENODEV = 19 /* No such device */, + ENOTDIR = 20 /* Not a directory */, + EISDIR = 21 /* Is a directory */, + EINVAL = 22 /* Invalid argument */, + ENFILE = 23 /* File table overflow */, + EMFILE = 24 /* Too many open files */, + ENOTTY = 25 /* Not a typewriter */, + ETXTBSY = 26 /* Text file busy */, + EFBIG = 27 /* File too large */, + ENOSPC = 28 /* No space left on device */, + ESPIPE = 29 /* Illegal seek */, + EROFS = 30 /* Read-only file system */, + EMLINK = 31 /* Too many links */, + EPIPE = 32 /* Broken pipe */, + EDOM = 33 /* Math argument out of domain of func */, + ERANGE = 34 /* Math result not representable */, + EDEADLK = 35 /* Resource deadlock would occur */, + ENAMETOOLONG = 36 /* File name too long */, + ENOLCK = 37 /* No record locks available */, /* * This error code is special: arch syscall entry code will return @@ -51,105 +51,105 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Types * failures due to attempts to use a nonexistent syscall, syscall * implementations should refrain from returning -ENOSYS. */ - ENOSYS = 38 /* Invalid system call number */, - ENOTEMPTY = 39 /* Directory not empty */, - ELOOP = 40 /* Too many symbolic links encountered */, - EWOULDBLOCK = EAGAIN /* Operation would block */, - ENOMSG = 42 /* No message of desired type */, - EIDRM = 43 /* Identifier removed */, - ECHRNG = 44 /* Channel number out of range */, - EL2NSYNC = 45 /* Level 2 not synchronized */, - EL3HLT = 46 /* Level 3 halted */, - EL3RST = 47 /* Level 3 reset */, - ELNRNG = 48 /* Link number out of range */, - EUNATCH = 49 /* Protocol driver not attached */, - ENOCSI = 50 /* No CSI structure available */, - EL2HLT = 51 /* Level 2 halted */, - EBADE = 52 /* Invalid exchange */, - EBADR = 53 /* Invalid request descriptor */, - EXFULL = 54 /* Exchange full */, - ENOANO = 55 /* No anode */, - EBADRQC = 56 /* Invalid request code */, - EBADSLT = 57 /* Invalid slot */, - EDEADLOCK = EDEADLK, - EBFONT = 59 /* Bad font file format */, - ENOSTR = 60 /* Device not a stream */, - ENODATA = 61 /* No data available */, - ETIME = 62 /* Timer expired */, - ENOSR = 63 /* Out of streams resources */, - ENONET = 64 /* Machine is not on the network */, - ENOPKG = 65 /* Package not installed */, - EREMOTE = 66 /* Object is remote */, - ENOLINK = 67 /* Link has been severed */, - EADV = 68 /* Advertise error */, - ESRMNT = 69 /* Srmount error */, - ECOMM = 70 /* Communication error on send */, - EPROTO = 71 /* Protocol error */, - EMULTIHOP = 72 /* Multihop attempted */, - EDOTDOT = 73 /* RFS specific error */, - EBADMSG = 74 /* Not a data message */, - EOVERFLOW = 75 /* Value too large for defined data type */, - ENOTUNIQ = 76 /* Name not unique on network */, - EBADFD = 77 /* File descriptor in bad state */, - EREMCHG = 78 /* Remote address changed */, - ELIBACC = 79 /* Can not access a needed shared library */, - ELIBBAD = 80 /* Accessing a corrupted shared library */, - ELIBSCN = 81 /* .lib section in a.out corrupted */, - ELIBMAX = 82 /* Attempting to link in too many shared libraries */, - ELIBEXEC = 83 /* Cannot exec a shared library directly */, - EILSEQ = 84 /* Illegal byte sequence */, - ERESTART = 85 /* Interrupted system call should be restarted */, - ESTRPIPE = 86 /* Streams pipe error */, - EUSERS = 87 /* Too many users */, - ENOTSOCK = 88 /* Socket operation on non-socket */, - EDESTADDRREQ = 89 /* Destination address required */, - EMSGSIZE = 90 /* Message too long */, - EPROTOTYPE = 91 /* Protocol wrong type for socket */, - ENOPROTOOPT = 92 /* Protocol not available */, + ENOSYS = 38 /* Invalid system call number */, + ENOTEMPTY = 39 /* Directory not empty */, + ELOOP = 40 /* Too many symbolic links encountered */, + EWOULDBLOCK = EAGAIN /* Operation would block */, + ENOMSG = 42 /* No message of desired type */, + EIDRM = 43 /* Identifier removed */, + ECHRNG = 44 /* Channel number out of range */, + EL2NSYNC = 45 /* Level 2 not synchronized */, + EL3HLT = 46 /* Level 3 halted */, + EL3RST = 47 /* Level 3 reset */, + ELNRNG = 48 /* Link number out of range */, + EUNATCH = 49 /* Protocol driver not attached */, + ENOCSI = 50 /* No CSI structure available */, + EL2HLT = 51 /* Level 2 halted */, + EBADE = 52 /* Invalid exchange */, + EBADR = 53 /* Invalid request descriptor */, + EXFULL = 54 /* Exchange full */, + ENOANO = 55 /* No anode */, + EBADRQC = 56 /* Invalid request code */, + EBADSLT = 57 /* Invalid slot */, + EDEADLOCK = EDEADLK, + EBFONT = 59 /* Bad font file format */, + ENOSTR = 60 /* Device not a stream */, + ENODATA = 61 /* No data available */, + ETIME = 62 /* Timer expired */, + ENOSR = 63 /* Out of streams resources */, + ENONET = 64 /* Machine is not on the network */, + ENOPKG = 65 /* Package not installed */, + EREMOTE = 66 /* Object is remote */, + ENOLINK = 67 /* Link has been severed */, + EADV = 68 /* Advertise error */, + ESRMNT = 69 /* Srmount error */, + ECOMM = 70 /* Communication error on send */, + EPROTO = 71 /* Protocol error */, + EMULTIHOP = 72 /* Multihop attempted */, + EDOTDOT = 73 /* RFS specific error */, + EBADMSG = 74 /* Not a data message */, + EOVERFLOW = 75 /* Value too large for defined data type */, + ENOTUNIQ = 76 /* Name not unique on network */, + EBADFD = 77 /* File descriptor in bad state */, + EREMCHG = 78 /* Remote address changed */, + ELIBACC = 79 /* Can not access a needed shared library */, + ELIBBAD = 80 /* Accessing a corrupted shared library */, + ELIBSCN = 81 /* .lib section in a.out corrupted */, + ELIBMAX = 82 /* Attempting to link in too many shared libraries */, + ELIBEXEC = 83 /* Cannot exec a shared library directly */, + EILSEQ = 84 /* Illegal byte sequence */, + ERESTART = 85 /* Interrupted system call should be restarted */, + ESTRPIPE = 86 /* Streams pipe error */, + EUSERS = 87 /* Too many users */, + ENOTSOCK = 88 /* Socket operation on non-socket */, + EDESTADDRREQ = 89 /* Destination address required */, + EMSGSIZE = 90 /* Message too long */, + EPROTOTYPE = 91 /* Protocol wrong type for socket */, + ENOPROTOOPT = 92 /* Protocol not available */, EPROTONOSUPPORT = 93 /* Protocol not supported */, ESOCKTNOSUPPORT = 94 /* Socket type not supported */, - EOPNOTSUPP = 95 /* Operation not supported on transport endpoint */, - EPFNOSUPPORT = 96 /* Protocol family not supported */, - EAFNOSUPPORT = 97 /* Address family not supported by protocol */, - EADDRINUSE = 98 /* Address already in use */, - EADDRNOTAVAIL = 99 /* Cannot assign requested address */, - ENETDOWN = 100 /* Network is down */, - ENETUNREACH = 101 /* Network is unreachable */, - ENETRESET = 102 /* Network dropped connection because of reset */, - ECONNABORTED = 103 /* Software caused connection abort */, - ECONNRESET = 104 /* Connection reset by peer */, - ENOBUFS = 105 /* No buffer space available */, - EISCONN = 106 /* Transport endpoint is already connected */, - ENOTCONN = 107 /* Transport endpoint is not connected */, - ESHUTDOWN = 108 /* Cannot send after transport endpoint shutdown */, - ETOOMANYREFS = 109 /* Too many references: cannot splice */, - ETIMEDOUT = 110 /* Connection timed out */, - ECONNREFUSED = 111 /* Connection refused */, - EHOSTDOWN = 112 /* Host is down */, - EHOSTUNREACH = 113 /* No route to host */, - EALREADY = 114 /* Operation already in progress */, - EINPROGRESS = 115 /* Operation now in progress */, - ESTALE = 116 /* Stale file handle */, - EUCLEAN = 117 /* Structure needs cleaning */, - ENOTNAM = 118 /* Not a XENIX named type file */, - ENAVAIL = 119 /* No XENIX semaphores available */, - EISNAM = 120 /* Is a named type file */, - EREMOTEIO = 121 /* Remote I/O error */, - EDQUOT = 122 /* Quota exceeded */, - ENOMEDIUM = 123 /* No medium found */, - EMEDIUMTYPE = 124 /* Wrong medium type */, - ECANCELED = 125 /* Operation Canceled */, - ENOKEY = 126 /* Required key not available */, - EKEYEXPIRED = 127 /* Key has expired */, - EKEYREVOKED = 128 /* Key has been revoked */, - EKEYREJECTED = 129 /* Key was rejected by service */, + EOPNOTSUPP = 95 /* Operation not supported on transport endpoint */, + EPFNOSUPPORT = 96 /* Protocol family not supported */, + EAFNOSUPPORT = 97 /* Address family not supported by protocol */, + EADDRINUSE = 98 /* Address already in use */, + EADDRNOTAVAIL = 99 /* Cannot assign requested address */, + ENETDOWN = 100 /* Network is down */, + ENETUNREACH = 101 /* Network is unreachable */, + ENETRESET = 102 /* Network dropped connection because of reset */, + ECONNABORTED = 103 /* Software caused connection abort */, + ECONNRESET = 104 /* Connection reset by peer */, + ENOBUFS = 105 /* No buffer space available */, + EISCONN = 106 /* Transport endpoint is already connected */, + ENOTCONN = 107 /* Transport endpoint is not connected */, + ESHUTDOWN = 108 /* Cannot send after transport endpoint shutdown */, + ETOOMANYREFS = 109 /* Too many references: cannot splice */, + ETIMEDOUT = 110 /* Connection timed out */, + ECONNREFUSED = 111 /* Connection refused */, + EHOSTDOWN = 112 /* Host is down */, + EHOSTUNREACH = 113 /* No route to host */, + EALREADY = 114 /* Operation already in progress */, + EINPROGRESS = 115 /* Operation now in progress */, + ESTALE = 116 /* Stale file handle */, + EUCLEAN = 117 /* Structure needs cleaning */, + ENOTNAM = 118 /* Not a XENIX named type file */, + ENAVAIL = 119 /* No XENIX semaphores available */, + EISNAM = 120 /* Is a named type file */, + EREMOTEIO = 121 /* Remote I/O error */, + EDQUOT = 122 /* Quota exceeded */, + ENOMEDIUM = 123 /* No medium found */, + EMEDIUMTYPE = 124 /* Wrong medium type */, + ECANCELED = 125 /* Operation Canceled */, + ENOKEY = 126 /* Required key not available */, + EKEYEXPIRED = 127 /* Key has expired */, + EKEYREVOKED = 128 /* Key has been revoked */, + EKEYREJECTED = 129 /* Key was rejected by service */, /* for robust mutexes */ - EOWNERDEAD = 130 /* Owner died */, + EOWNERDEAD = 130 /* Owner died */, ENOTRECOVERABLE = 131 /* State not recoverable */, - ERFKILL = 132 /* Operation not possible due to RF-kill */, + ERFKILL = 132 /* Operation not possible due to RF-kill */, - EHWPOISON = 133 /* Memory page has hardware error */ + EHWPOISON = 133, /* Memory page has hardware error */ } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/PollEvent.cs b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/PollEvent.cs index 8b77a6c2..27a96bd8 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/PollEvent.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/PollEvent.cs @@ -11,4 +11,4 @@ FileDescriptor = fileDescriptor; } } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/PollEventData.cs b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/PollEventData.cs index 546b738e..16d01055 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/PollEventData.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/PollEventData.cs @@ -2,10 +2,10 @@ { struct PollEventData { -#pragma warning disable CS0649 +#pragma warning disable CS0649 // Field is never assigned to public int SocketFd; public PollEventTypeMask InputEvents; #pragma warning restore CS0649 public PollEventTypeMask OutputEvents; } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/PollEventTypeMask.cs b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/PollEventTypeMask.cs index f434fa03..d4c96c81 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/PollEventTypeMask.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Types/PollEventTypeMask.cs @@ -10,6 +10,6 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Types Output = 4, Error = 8, Disconnected = 0x10, - Invalid = 0x20 + Invalid = 0x20, } } |
