mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-11-15 09:35:27 +00:00
Rename enum fields
This commit is contained in:
parent
9b22e8af5e
commit
8faae5612d
|
@ -253,7 +253,7 @@ namespace Ryujinx.HLE.HOS.Kernel
|
||||||
|
|
||||||
ElfDynamicTag Tag = (ElfDynamicTag)TagVal;
|
ElfDynamicTag Tag = (ElfDynamicTag)TagVal;
|
||||||
|
|
||||||
if (Tag == ElfDynamicTag.DT_NULL)
|
if (Tag == ElfDynamicTag.Null)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -261,9 +261,9 @@ namespace Ryujinx.HLE.HOS.Kernel
|
||||||
Dynamic[Tag] = Value;
|
Dynamic[Tag] = Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Dynamic.TryGetValue(ElfDynamicTag.DT_STRTAB, out long StrTab) ||
|
if (!Dynamic.TryGetValue(ElfDynamicTag.StrTab, out long StrTab) ||
|
||||||
!Dynamic.TryGetValue(ElfDynamicTag.DT_SYMTAB, out long SymTab) ||
|
!Dynamic.TryGetValue(ElfDynamicTag.SymTab, out long SymTab) ||
|
||||||
!Dynamic.TryGetValue(ElfDynamicTag.DT_SYMENT, out long SymEntSize))
|
!Dynamic.TryGetValue(ElfDynamicTag.SymEnt, out long SymEntSize))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,93 +11,93 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
class IClient : IpcService
|
class IClient : IpcService
|
||||||
{
|
{
|
||||||
|
|
||||||
private static Dictionary<WSAError, LinuxError> ErrorMap = new Dictionary<WSAError, LinuxError>
|
private static Dictionary<WsaError, LinuxError> ErrorMap = new Dictionary<WsaError, LinuxError>
|
||||||
{
|
{
|
||||||
// WSAEINTR
|
// WSAEINTR
|
||||||
{WSAError.WSAEINTR, LinuxError.EINTR},
|
{WsaError.Interrupted, LinuxError.Intr},
|
||||||
// WSAEWOULDBLOCK
|
// WSAEWOULDBLOCK
|
||||||
{WSAError.WSAEWOULDBLOCK, LinuxError.EWOULDBLOCK},
|
{WsaError.WouldBlock, LinuxError.WouldBlock},
|
||||||
// WSAEINPROGRESS
|
// WSAEINPROGRESS
|
||||||
{WSAError.WSAEINPROGRESS, LinuxError.EINPROGRESS},
|
{WsaError.InProgress, LinuxError.InProgress},
|
||||||
// WSAEALREADY
|
// WSAEALREADY
|
||||||
{WSAError.WSAEALREADY, LinuxError.EALREADY},
|
{WsaError.AlreadyInProgress, LinuxError.Already},
|
||||||
// WSAENOTSOCK
|
// WSAENOTSOCK
|
||||||
{WSAError.WSAENOTSOCK, LinuxError.ENOTSOCK},
|
{WsaError.NotSocket, LinuxError.NotSock},
|
||||||
// WSAEDESTADDRREQ
|
// WSAEDESTADDRREQ
|
||||||
{WSAError.WSAEDESTADDRREQ, LinuxError.EDESTADDRREQ},
|
{WsaError.DestinationAddressRequired, LinuxError.DestAddrReq},
|
||||||
// WSAEMSGSIZE
|
// WSAEMSGSIZE
|
||||||
{WSAError.WSAEMSGSIZE, LinuxError.EMSGSIZE},
|
{WsaError.MessageSize, LinuxError.MsgSize},
|
||||||
// WSAEPROTOTYPE
|
// WSAEPROTOTYPE
|
||||||
{WSAError.WSAEPROTOTYPE, LinuxError.EPROTOTYPE},
|
{WsaError.ProtocolType, LinuxError.ProtoType},
|
||||||
// WSAENOPROTOOPT
|
// WSAENOPROTOOPT
|
||||||
{WSAError.WSAENOPROTOOPT, LinuxError.ENOPROTOOPT},
|
{WsaError.ProtocolOption, LinuxError.NoProtoOpt},
|
||||||
// WSAEPROTONOSUPPORT
|
// WSAEPROTONOSUPPORT
|
||||||
{WSAError.WSAEPROTONOSUPPORT, LinuxError.EPROTONOSUPPORT},
|
{WsaError.ProtocolNotSupported, LinuxError.ProtoNoSupport},
|
||||||
// WSAESOCKTNOSUPPORT
|
// WSAESOCKTNOSUPPORT
|
||||||
{WSAError.WSAESOCKTNOSUPPORT, LinuxError.ESOCKTNOSUPPORT},
|
{WsaError.SocketNotSupported, LinuxError.SocktNoSupport},
|
||||||
// WSAEOPNOTSUPP
|
// WSAEOPNOTSUPP
|
||||||
{WSAError.WSAEOPNOTSUPP, LinuxError.EOPNOTSUPP},
|
{WsaError.OperationNotSupported, LinuxError.OpNotSupp},
|
||||||
// WSAEPFNOSUPPORT
|
// WSAEPFNOSUPPORT
|
||||||
{WSAError.WSAEPFNOSUPPORT, LinuxError.EPFNOSUPPORT},
|
{WsaError.ProtocolFamilyNotSupported, LinuxError.PfNoSupport},
|
||||||
// WSAEAFNOSUPPORT
|
// WSAEAFNOSUPPORT
|
||||||
{WSAError.WSAEAFNOSUPPORT, LinuxError.EAFNOSUPPORT},
|
{WsaError.AddressFamilyNotSupported, LinuxError.AfNoSupport},
|
||||||
// WSAEADDRINUSE
|
// WSAEADDRINUSE
|
||||||
{WSAError.WSAEADDRINUSE, LinuxError.EADDRINUSE},
|
{WsaError.AddressAlreadyInUse, LinuxError.AddrInUse},
|
||||||
// WSAEADDRNOTAVAIL
|
// WSAEADDRNOTAVAIL
|
||||||
{WSAError.WSAEADDRNOTAVAIL, LinuxError.EADDRNOTAVAIL},
|
{WsaError.AddressNotAvailable, LinuxError.AddrNotAvail},
|
||||||
// WSAENETDOWN
|
// WSAENETDOWN
|
||||||
{WSAError.WSAENETDOWN, LinuxError.ENETDOWN},
|
{WsaError.NetworkDown, LinuxError.NetDown},
|
||||||
// WSAENETUNREACH
|
// WSAENETUNREACH
|
||||||
{WSAError.WSAENETUNREACH, LinuxError.ENETUNREACH},
|
{WsaError.NetworkUnreachable, LinuxError.NetUnReach},
|
||||||
// WSAENETRESET
|
// WSAENETRESET
|
||||||
{WSAError.WSAENETRESET, LinuxError.ENETRESET},
|
{WsaError.NetworkReset, LinuxError.NetReset},
|
||||||
// WSAECONNABORTED
|
// WSAECONNABORTED
|
||||||
{WSAError.WSAECONNABORTED, LinuxError.ECONNABORTED},
|
{WsaError.ConnectionAborted, LinuxError.ConnAborted},
|
||||||
// WSAECONNRESET
|
// WSAECONNRESET
|
||||||
{WSAError.WSAECONNRESET, LinuxError.ECONNRESET},
|
{WsaError.ConnectionReset, LinuxError.ConnReset},
|
||||||
// WSAENOBUFS
|
// WSAENOBUFS
|
||||||
{WSAError.WSAENOBUFS, LinuxError.ENOBUFS},
|
{WsaError.NoBufferSpaceAvailable, LinuxError.NoBufs},
|
||||||
// WSAEISCONN
|
// WSAEISCONN
|
||||||
{WSAError.WSAEISCONN, LinuxError.EISCONN},
|
{WsaError.IsConnected, LinuxError.IsConn},
|
||||||
// WSAENOTCONN
|
// WSAENOTCONN
|
||||||
{WSAError.WSAENOTCONN, LinuxError.ENOTCONN},
|
{WsaError.NotConnected, LinuxError.NotConn},
|
||||||
// WSAESHUTDOWN
|
// WSAESHUTDOWN
|
||||||
{WSAError.WSAESHUTDOWN, LinuxError.ESHUTDOWN},
|
{WsaError.Shutdown, LinuxError.Shutdown},
|
||||||
// WSAETOOMANYREFS
|
// WSAETOOMANYREFS
|
||||||
{WSAError.WSAETOOMANYREFS, LinuxError.ETOOMANYREFS},
|
{WsaError.TooManyReferences, LinuxError.TooManyRefs},
|
||||||
// WSAETIMEDOUT
|
// WSAETIMEDOUT
|
||||||
{WSAError.WSAETIMEDOUT, LinuxError.ETIMEDOUT},
|
{WsaError.TimedOut, LinuxError.TimedOut},
|
||||||
// WSAECONNREFUSED
|
// WSAECONNREFUSED
|
||||||
{WSAError.WSAECONNREFUSED, LinuxError.ECONNREFUSED},
|
{WsaError.ConnectionRefused, LinuxError.ConnRefused},
|
||||||
// WSAELOOP
|
// WSAELOOP
|
||||||
{WSAError.WSAELOOP, LinuxError.ELOOP},
|
{WsaError.Loop, LinuxError.Loop},
|
||||||
// WSAENAMETOOLONG
|
// WSAENAMETOOLONG
|
||||||
{WSAError.WSAENAMETOOLONG, LinuxError.ENAMETOOLONG},
|
{WsaError.NameTooLong, LinuxError.NameTooLong},
|
||||||
// WSAEHOSTDOWN
|
// WSAEHOSTDOWN
|
||||||
{WSAError.WSAEHOSTDOWN, LinuxError.EHOSTDOWN},
|
{WsaError.HostDown, LinuxError.HostDown},
|
||||||
// WSAEHOSTUNREACH
|
// WSAEHOSTUNREACH
|
||||||
{WSAError.WSAEHOSTUNREACH, LinuxError.EHOSTUNREACH},
|
{WsaError.HostUnreachable, LinuxError.HostUnReach},
|
||||||
// WSAENOTEMPTY
|
// WSAENOTEMPTY
|
||||||
{WSAError.WSAENOTEMPTY, LinuxError.ENOTEMPTY},
|
{WsaError.NotEmpty, LinuxError.NotEmpty},
|
||||||
// WSAEUSERS
|
// WSAEUSERS
|
||||||
{WSAError.WSAEUSERS, LinuxError.EUSERS},
|
{WsaError.UserQuota, LinuxError.Users},
|
||||||
// WSAEDQUOT
|
// WSAEDQUOT
|
||||||
{WSAError.WSAEDQUOT, LinuxError.EDQUOT},
|
{WsaError.DiskQuota, LinuxError.DQuot},
|
||||||
// WSAESTALE
|
// WSAESTALE
|
||||||
{WSAError.WSAESTALE, LinuxError.ESTALE},
|
{WsaError.Stale, LinuxError.Stale},
|
||||||
// WSAEREMOTE
|
// WSAEREMOTE
|
||||||
{WSAError.WSAEREMOTE, LinuxError.EREMOTE},
|
{WsaError.Remote, LinuxError.Remote},
|
||||||
// WSAEINVAL
|
// WSAEINVAL
|
||||||
{WSAError.WSAEINVAL, LinuxError.EINVAL},
|
{WsaError.InvalidArgument, LinuxError.InVal},
|
||||||
// WSAEFAULT
|
// WSAEFAULT
|
||||||
{WSAError.WSAEFAULT, LinuxError.EFAULT},
|
{WsaError.Fault, LinuxError.Fault},
|
||||||
// NOERROR
|
// NOERROR
|
||||||
{0, 0}
|
{0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
private Dictionary<int, ServiceProcessRequest> m_Commands;
|
private Dictionary<int, ServiceProcessRequest> _commands;
|
||||||
|
|
||||||
public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
|
public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => _commands;
|
||||||
|
|
||||||
private bool IsPrivileged;
|
private bool IsPrivileged;
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
|
|
||||||
public IClient(bool IsPrivileged)
|
public IClient(bool IsPrivileged)
|
||||||
{
|
{
|
||||||
m_Commands = new Dictionary<int, ServiceProcessRequest>()
|
_commands = new Dictionary<int, ServiceProcessRequest>()
|
||||||
{
|
{
|
||||||
{ 0, RegisterClient },
|
{ 0, RegisterClient },
|
||||||
{ 1, StartMonitoring },
|
{ 1, StartMonitoring },
|
||||||
|
@ -140,7 +140,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
this.IsPrivileged = IsPrivileged;
|
this.IsPrivileged = IsPrivileged;
|
||||||
}
|
}
|
||||||
|
|
||||||
private LinuxError ConvertError(WSAError ErrorCode)
|
private LinuxError ConvertError(WsaError ErrorCode)
|
||||||
{
|
{
|
||||||
LinuxError Errno;
|
LinuxError Errno;
|
||||||
|
|
||||||
|
@ -152,14 +152,14 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
return Errno;
|
return Errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
private long WriteWinSock2Error(ServiceCtx Context, WSAError ErrorCode)
|
private long WriteWinSock2Error(ServiceCtx Context, WsaError ErrorCode)
|
||||||
{
|
{
|
||||||
return WriteBsdResult(Context, -1, ConvertError(ErrorCode));
|
return WriteBsdResult(Context, -1, ConvertError(ErrorCode));
|
||||||
}
|
}
|
||||||
|
|
||||||
private long WriteBsdResult(ServiceCtx Context, int Result, LinuxError ErrorCode = 0)
|
private long WriteBsdResult(ServiceCtx Context, int Result, LinuxError ErrorCode = 0)
|
||||||
{
|
{
|
||||||
if (ErrorCode != LinuxError.SUCCESS)
|
if (ErrorCode != LinuxError.Success)
|
||||||
{
|
{
|
||||||
Result = -1;
|
Result = -1;
|
||||||
}
|
}
|
||||||
|
@ -182,7 +182,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
|
|
||||||
private LinuxError SetResultErrno(Socket Socket, int Result)
|
private LinuxError SetResultErrno(Socket Socket, int Result)
|
||||||
{
|
{
|
||||||
return Result == 0 && !Socket.Blocking ? LinuxError.EWOULDBLOCK : LinuxError.SUCCESS;
|
return Result == 0 && !Socket.Blocking ? LinuxError.WouldBlock : LinuxError.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
private AddressFamily ConvertFromBsd(int Domain)
|
private AddressFamily ConvertFromBsd(int Domain)
|
||||||
|
@ -204,13 +204,13 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
|
|
||||||
if (Domain == AddressFamily.Unknown)
|
if (Domain == AddressFamily.Unknown)
|
||||||
{
|
{
|
||||||
return WriteBsdResult(Context, -1, LinuxError.EPROTONOSUPPORT);
|
return WriteBsdResult(Context, -1, LinuxError.ProtoNoSupport);
|
||||||
}
|
}
|
||||||
else if ((Type == SocketType.Seqpacket || Type == SocketType.Raw) && !IsPrivileged)
|
else if ((Type == SocketType.Seqpacket || Type == SocketType.Raw) && !IsPrivileged)
|
||||||
{
|
{
|
||||||
if (Domain != AddressFamily.InterNetwork || Type != SocketType.Raw || Protocol != ProtocolType.Icmp)
|
if (Domain != AddressFamily.InterNetwork || Type != SocketType.Raw || Protocol != ProtocolType.Icmp)
|
||||||
{
|
{
|
||||||
return WriteBsdResult(Context, -1, LinuxError.ENOENT);
|
return WriteBsdResult(Context, -1, LinuxError.NoEnt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -314,7 +314,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
byte[] RawPath = Context.Memory.ReadBytes(BufferPosition, BufferSize);
|
byte[] RawPath = Context.Memory.ReadBytes(BufferPosition, BufferSize);
|
||||||
string Path = Encoding.ASCII.GetString(RawPath);
|
string Path = Encoding.ASCII.GetString(RawPath);
|
||||||
|
|
||||||
WriteBsdResult(Context, -1, LinuxError.EOPNOTSUPP);
|
WriteBsdResult(Context, -1, LinuxError.OpNotSupp);
|
||||||
|
|
||||||
Logger.PrintStub(LogClass.ServiceBsd, $"Stubbed. Path: {Path} - " +
|
Logger.PrintStub(LogClass.ServiceBsd, $"Stubbed. Path: {Path} - " +
|
||||||
$"Flags: {Flags}");
|
$"Flags: {Flags}");
|
||||||
|
@ -325,7 +325,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
// Select(u32 nfds, nn::socket::timeout timeout, buffer<nn::socket::fd_set, 0x21, 0> readfds_in, buffer<nn::socket::fd_set, 0x21, 0> writefds_in, buffer<nn::socket::fd_set, 0x21, 0> errorfds_in) -> (i32 ret, u32 bsd_errno, buffer<nn::socket::fd_set, 0x22, 0> readfds_out, buffer<nn::socket::fd_set, 0x22, 0> writefds_out, buffer<nn::socket::fd_set, 0x22, 0> errorfds_out)
|
// Select(u32 nfds, nn::socket::timeout timeout, buffer<nn::socket::fd_set, 0x21, 0> readfds_in, buffer<nn::socket::fd_set, 0x21, 0> writefds_in, buffer<nn::socket::fd_set, 0x21, 0> errorfds_in) -> (i32 ret, u32 bsd_errno, buffer<nn::socket::fd_set, 0x22, 0> readfds_out, buffer<nn::socket::fd_set, 0x22, 0> writefds_out, buffer<nn::socket::fd_set, 0x22, 0> errorfds_out)
|
||||||
public long Select(ServiceCtx Context)
|
public long Select(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
WriteBsdResult(Context, -1, LinuxError.EOPNOTSUPP);
|
WriteBsdResult(Context, -1, LinuxError.OpNotSupp);
|
||||||
|
|
||||||
Logger.PrintStub(LogClass.ServiceBsd, $"Stubbed.");
|
Logger.PrintStub(LogClass.ServiceBsd, $"Stubbed.");
|
||||||
|
|
||||||
|
@ -343,7 +343,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
|
|
||||||
if (Timeout < -1 || FdsCount < 0 || (FdsCount * 8) > BufferSize)
|
if (Timeout < -1 || FdsCount < 0 || (FdsCount * 8) > BufferSize)
|
||||||
{
|
{
|
||||||
return WriteBsdResult(Context, -1, LinuxError.EINVAL);
|
return WriteBsdResult(Context, -1, LinuxError.InVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
PollEvent[] Events = new PollEvent[FdsCount];
|
PollEvent[] Events = new PollEvent[FdsCount];
|
||||||
|
@ -356,7 +356,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
|
|
||||||
if (Socket == null)
|
if (Socket == null)
|
||||||
{
|
{
|
||||||
return WriteBsdResult(Context, -1, LinuxError.EBADF);
|
return WriteBsdResult(Context, -1, LinuxError.BadF);
|
||||||
}
|
}
|
||||||
|
|
||||||
PollEvent.EventTypeMask InputEvents = (PollEvent.EventTypeMask)Context.Memory.ReadInt16(BufferPosition + i * 8 + 4);
|
PollEvent.EventTypeMask InputEvents = (PollEvent.EventTypeMask)Context.Memory.ReadInt16(BufferPosition + i * 8 + 4);
|
||||||
|
@ -406,7 +406,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
if (!IsValidEvent)
|
if (!IsValidEvent)
|
||||||
{
|
{
|
||||||
Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported Poll input event type: {Event.InputEvents}");
|
Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported Poll input event type: {Event.InputEvents}");
|
||||||
return WriteBsdResult(Context, -1, LinuxError.EINVAL);
|
return WriteBsdResult(Context, -1, LinuxError.InVal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -416,7 +416,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
}
|
}
|
||||||
catch (SocketException Exception)
|
catch (SocketException Exception)
|
||||||
{
|
{
|
||||||
return WriteWinSock2Error(Context, (WSAError)Exception.ErrorCode);
|
return WriteWinSock2Error(Context, (WsaError)Exception.ErrorCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < FdsCount; i++)
|
for (int i = 0; i < FdsCount; i++)
|
||||||
|
@ -455,13 +455,13 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
Context.Memory.WriteInt16(BufferPosition + i * 8 + 6, (short)OutputEvents);
|
Context.Memory.WriteInt16(BufferPosition + i * 8 + 6, (short)OutputEvents);
|
||||||
}
|
}
|
||||||
|
|
||||||
return WriteBsdResult(Context, ReadEvents.Count + WriteEvents.Count + ErrorEvents.Count, LinuxError.SUCCESS);
|
return WriteBsdResult(Context, ReadEvents.Count + WriteEvents.Count + ErrorEvents.Count, LinuxError.Success);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sysctl(buffer<unknown, 0x21, 0>, buffer<unknown, 0x21, 0>) -> (i32 ret, u32 bsd_errno, u32, buffer<unknown, 0x22, 0>)
|
// Sysctl(buffer<unknown, 0x21, 0>, buffer<unknown, 0x21, 0>) -> (i32 ret, u32 bsd_errno, u32, buffer<unknown, 0x22, 0>)
|
||||||
public long Sysctl(ServiceCtx Context)
|
public long Sysctl(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
WriteBsdResult(Context, -1, LinuxError.EOPNOTSUPP);
|
WriteBsdResult(Context, -1, LinuxError.OpNotSupp);
|
||||||
|
|
||||||
Logger.PrintStub(LogClass.ServiceBsd, $"Stubbed.");
|
Logger.PrintStub(LogClass.ServiceBsd, $"Stubbed.");
|
||||||
|
|
||||||
|
@ -476,7 +476,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
|
|
||||||
(long ReceivePosition, long ReceiveLength) = Context.Request.GetBufferType0x22();
|
(long ReceivePosition, long ReceiveLength) = Context.Request.GetBufferType0x22();
|
||||||
|
|
||||||
LinuxError Errno = LinuxError.EBADF;
|
LinuxError Errno = LinuxError.BadF;
|
||||||
BsdSocket Socket = RetrieveSocket(SocketFd);
|
BsdSocket Socket = RetrieveSocket(SocketFd);
|
||||||
int Result = -1;
|
int Result = -1;
|
||||||
|
|
||||||
|
@ -486,7 +486,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
&& (SocketFlags & SocketFlags.Peek) == 0)
|
&& (SocketFlags & SocketFlags.Peek) == 0)
|
||||||
{
|
{
|
||||||
Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported Recv flags: {SocketFlags}");
|
Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported Recv flags: {SocketFlags}");
|
||||||
return WriteBsdResult(Context, -1, LinuxError.EOPNOTSUPP);
|
return WriteBsdResult(Context, -1, LinuxError.OpNotSupp);
|
||||||
}
|
}
|
||||||
|
|
||||||
byte[] ReceivedBuffer = new byte[ReceiveLength];
|
byte[] ReceivedBuffer = new byte[ReceiveLength];
|
||||||
|
@ -500,7 +500,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
}
|
}
|
||||||
catch (SocketException Exception)
|
catch (SocketException Exception)
|
||||||
{
|
{
|
||||||
Errno = ConvertError((WSAError)Exception.ErrorCode);
|
Errno = ConvertError((WsaError)Exception.ErrorCode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -517,7 +517,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
(long SockAddrInPosition, long SockAddrInSize) = Context.Request.GetBufferType0x21();
|
(long SockAddrInPosition, long SockAddrInSize) = Context.Request.GetBufferType0x21();
|
||||||
(long SockAddrOutPosition, long SockAddrOutSize) = Context.Request.GetBufferType0x22(1);
|
(long SockAddrOutPosition, long SockAddrOutSize) = Context.Request.GetBufferType0x22(1);
|
||||||
|
|
||||||
LinuxError Errno = LinuxError.EBADF;
|
LinuxError Errno = LinuxError.BadF;
|
||||||
BsdSocket Socket = RetrieveSocket(SocketFd);
|
BsdSocket Socket = RetrieveSocket(SocketFd);
|
||||||
int Result = -1;
|
int Result = -1;
|
||||||
|
|
||||||
|
@ -528,7 +528,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
{
|
{
|
||||||
Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported Recv flags: {SocketFlags}");
|
Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported Recv flags: {SocketFlags}");
|
||||||
|
|
||||||
return WriteBsdResult(Context, -1, LinuxError.EOPNOTSUPP);
|
return WriteBsdResult(Context, -1, LinuxError.OpNotSupp);
|
||||||
}
|
}
|
||||||
|
|
||||||
byte[] ReceivedBuffer = new byte[ReceiveLength];
|
byte[] ReceivedBuffer = new byte[ReceiveLength];
|
||||||
|
@ -544,7 +544,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
}
|
}
|
||||||
catch (SocketException Exception)
|
catch (SocketException Exception)
|
||||||
{
|
{
|
||||||
Errno = ConvertError((WSAError)Exception.ErrorCode);
|
Errno = ConvertError((WsaError)Exception.ErrorCode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -559,7 +559,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
|
|
||||||
(long SendPosition, long SendSize) = Context.Request.GetBufferType0x21();
|
(long SendPosition, long SendSize) = Context.Request.GetBufferType0x21();
|
||||||
|
|
||||||
LinuxError Errno = LinuxError.EBADF;
|
LinuxError Errno = LinuxError.BadF;
|
||||||
BsdSocket Socket = RetrieveSocket(SocketFd);
|
BsdSocket Socket = RetrieveSocket(SocketFd);
|
||||||
int Result = -1;
|
int Result = -1;
|
||||||
|
|
||||||
|
@ -570,7 +570,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
{
|
{
|
||||||
Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported Send flags: {SocketFlags}");
|
Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported Send flags: {SocketFlags}");
|
||||||
|
|
||||||
return WriteBsdResult(Context, -1, LinuxError.EOPNOTSUPP);
|
return WriteBsdResult(Context, -1, LinuxError.OpNotSupp);
|
||||||
}
|
}
|
||||||
|
|
||||||
byte[] SendBuffer = Context.Memory.ReadBytes(SendPosition, SendSize);
|
byte[] SendBuffer = Context.Memory.ReadBytes(SendPosition, SendSize);
|
||||||
|
@ -582,7 +582,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
}
|
}
|
||||||
catch (SocketException Exception)
|
catch (SocketException Exception)
|
||||||
{
|
{
|
||||||
Errno = ConvertError((WSAError)Exception.ErrorCode);
|
Errno = ConvertError((WsaError)Exception.ErrorCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -599,7 +599,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
(long SendPosition, long SendSize) = Context.Request.GetBufferType0x21();
|
(long SendPosition, long SendSize) = Context.Request.GetBufferType0x21();
|
||||||
(long BufferPosition, long BufferSize) = Context.Request.GetBufferType0x21(1);
|
(long BufferPosition, long BufferSize) = Context.Request.GetBufferType0x21(1);
|
||||||
|
|
||||||
LinuxError Errno = LinuxError.EBADF;
|
LinuxError Errno = LinuxError.BadF;
|
||||||
BsdSocket Socket = RetrieveSocket(SocketFd);
|
BsdSocket Socket = RetrieveSocket(SocketFd);
|
||||||
int Result = -1;
|
int Result = -1;
|
||||||
|
|
||||||
|
@ -610,7 +610,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
{
|
{
|
||||||
Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported Send flags: {SocketFlags}");
|
Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported Send flags: {SocketFlags}");
|
||||||
|
|
||||||
return WriteBsdResult(Context, -1, LinuxError.EOPNOTSUPP);
|
return WriteBsdResult(Context, -1, LinuxError.OpNotSupp);
|
||||||
}
|
}
|
||||||
|
|
||||||
byte[] SendBuffer = Context.Memory.ReadBytes(SendPosition, SendSize);
|
byte[] SendBuffer = Context.Memory.ReadBytes(SendPosition, SendSize);
|
||||||
|
@ -623,7 +623,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
}
|
}
|
||||||
catch (SocketException Exception)
|
catch (SocketException Exception)
|
||||||
{
|
{
|
||||||
Errno = ConvertError((WSAError)Exception.ErrorCode);
|
Errno = ConvertError((WsaError)Exception.ErrorCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -638,12 +638,12 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
|
|
||||||
(long BufferPos, long BufferSize) = Context.Request.GetBufferType0x22();
|
(long BufferPos, long BufferSize) = Context.Request.GetBufferType0x22();
|
||||||
|
|
||||||
LinuxError Errno = LinuxError.EBADF;
|
LinuxError Errno = LinuxError.BadF;
|
||||||
BsdSocket Socket = RetrieveSocket(SocketFd);
|
BsdSocket Socket = RetrieveSocket(SocketFd);
|
||||||
|
|
||||||
if (Socket != null)
|
if (Socket != null)
|
||||||
{
|
{
|
||||||
Errno = LinuxError.SUCCESS;
|
Errno = LinuxError.Success;
|
||||||
|
|
||||||
Socket NewSocket = null;
|
Socket NewSocket = null;
|
||||||
|
|
||||||
|
@ -653,14 +653,14 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
}
|
}
|
||||||
catch (SocketException Exception)
|
catch (SocketException Exception)
|
||||||
{
|
{
|
||||||
Errno = ConvertError((WSAError)Exception.ErrorCode);
|
Errno = ConvertError((WsaError)Exception.ErrorCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NewSocket == null && Errno == LinuxError.SUCCESS)
|
if (NewSocket == null && Errno == LinuxError.Success)
|
||||||
{
|
{
|
||||||
Errno = LinuxError.EWOULDBLOCK;
|
Errno = LinuxError.WouldBlock;
|
||||||
}
|
}
|
||||||
else if (Errno == LinuxError.SUCCESS)
|
else if (Errno == LinuxError.Success)
|
||||||
{
|
{
|
||||||
BsdSocket NewBsdSocket = new BsdSocket
|
BsdSocket NewBsdSocket = new BsdSocket
|
||||||
{
|
{
|
||||||
|
@ -692,12 +692,12 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
|
|
||||||
(long BufferPos, long BufferSize) = Context.Request.GetBufferType0x21();
|
(long BufferPos, long BufferSize) = Context.Request.GetBufferType0x21();
|
||||||
|
|
||||||
LinuxError Errno = LinuxError.EBADF;
|
LinuxError Errno = LinuxError.BadF;
|
||||||
BsdSocket Socket = RetrieveSocket(SocketFd);
|
BsdSocket Socket = RetrieveSocket(SocketFd);
|
||||||
|
|
||||||
if (Socket != null)
|
if (Socket != null)
|
||||||
{
|
{
|
||||||
Errno = LinuxError.SUCCESS;
|
Errno = LinuxError.Success;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -707,7 +707,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
}
|
}
|
||||||
catch (SocketException Exception)
|
catch (SocketException Exception)
|
||||||
{
|
{
|
||||||
Errno = ConvertError((WSAError)Exception.ErrorCode);
|
Errno = ConvertError((WsaError)Exception.ErrorCode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -721,12 +721,12 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
|
|
||||||
(long BufferPos, long BufferSize) = Context.Request.GetBufferType0x21();
|
(long BufferPos, long BufferSize) = Context.Request.GetBufferType0x21();
|
||||||
|
|
||||||
LinuxError Errno = LinuxError.EBADF;
|
LinuxError Errno = LinuxError.BadF;
|
||||||
BsdSocket Socket = RetrieveSocket(SocketFd);
|
BsdSocket Socket = RetrieveSocket(SocketFd);
|
||||||
|
|
||||||
if (Socket != null)
|
if (Socket != null)
|
||||||
{
|
{
|
||||||
Errno = LinuxError.SUCCESS;
|
Errno = LinuxError.Success;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
IPEndPoint EndPoint = ParseSockAddr(Context, BufferPos, BufferSize);
|
IPEndPoint EndPoint = ParseSockAddr(Context, BufferPos, BufferSize);
|
||||||
|
@ -735,7 +735,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
}
|
}
|
||||||
catch (SocketException Exception)
|
catch (SocketException Exception)
|
||||||
{
|
{
|
||||||
Errno = ConvertError((WSAError)Exception.ErrorCode);
|
Errno = ConvertError((WsaError)Exception.ErrorCode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -749,12 +749,12 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
|
|
||||||
(long BufferPos, long BufferSize) = Context.Request.GetBufferType0x22();
|
(long BufferPos, long BufferSize) = Context.Request.GetBufferType0x22();
|
||||||
|
|
||||||
LinuxError Errno = LinuxError.EBADF;
|
LinuxError Errno = LinuxError.BadF;
|
||||||
BsdSocket Socket = RetrieveSocket(SocketFd);
|
BsdSocket Socket = RetrieveSocket(SocketFd);
|
||||||
|
|
||||||
if (Socket != null)
|
if (Socket != null)
|
||||||
{
|
{
|
||||||
Errno = LinuxError.SUCCESS;
|
Errno = LinuxError.Success;
|
||||||
|
|
||||||
WriteSockAddr(Context, BufferPos, Socket, true);
|
WriteSockAddr(Context, BufferPos, Socket, true);
|
||||||
WriteBsdResult(Context, 0, Errno);
|
WriteBsdResult(Context, 0, Errno);
|
||||||
|
@ -771,12 +771,12 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
|
|
||||||
(long BufferPos, long BufferSize) = Context.Request.GetBufferType0x22();
|
(long BufferPos, long BufferSize) = Context.Request.GetBufferType0x22();
|
||||||
|
|
||||||
LinuxError Errno = LinuxError.EBADF;
|
LinuxError Errno = LinuxError.BadF;
|
||||||
BsdSocket Socket = RetrieveSocket(SocketFd);
|
BsdSocket Socket = RetrieveSocket(SocketFd);
|
||||||
|
|
||||||
if (Socket != null)
|
if (Socket != null)
|
||||||
{
|
{
|
||||||
Errno = LinuxError.SUCCESS;
|
Errno = LinuxError.Success;
|
||||||
|
|
||||||
WriteSockAddr(Context, BufferPos, Socket, false);
|
WriteSockAddr(Context, BufferPos, Socket, false);
|
||||||
WriteBsdResult(Context, 0, Errno);
|
WriteBsdResult(Context, 0, Errno);
|
||||||
|
@ -795,12 +795,12 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
|
|
||||||
(long BufferPosition, long BufferSize) = Context.Request.GetBufferType0x22();
|
(long BufferPosition, long BufferSize) = Context.Request.GetBufferType0x22();
|
||||||
|
|
||||||
LinuxError Errno = LinuxError.EBADF;
|
LinuxError Errno = LinuxError.BadF;
|
||||||
BsdSocket Socket = RetrieveSocket(SocketFd);
|
BsdSocket Socket = RetrieveSocket(SocketFd);
|
||||||
|
|
||||||
if (Socket != null)
|
if (Socket != null)
|
||||||
{
|
{
|
||||||
Errno = LinuxError.ENOPROTOOPT;
|
Errno = LinuxError.NoProtoOpt;
|
||||||
|
|
||||||
if (Level == 0xFFFF)
|
if (Level == 0xFFFF)
|
||||||
{
|
{
|
||||||
|
@ -821,12 +821,12 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
int SocketFd = Context.RequestData.ReadInt32();
|
int SocketFd = Context.RequestData.ReadInt32();
|
||||||
int Backlog = Context.RequestData.ReadInt32();
|
int Backlog = Context.RequestData.ReadInt32();
|
||||||
|
|
||||||
LinuxError Errno = LinuxError.EBADF;
|
LinuxError Errno = LinuxError.BadF;
|
||||||
BsdSocket Socket = RetrieveSocket(SocketFd);
|
BsdSocket Socket = RetrieveSocket(SocketFd);
|
||||||
|
|
||||||
if (Socket != null)
|
if (Socket != null)
|
||||||
{
|
{
|
||||||
Errno = LinuxError.SUCCESS;
|
Errno = LinuxError.Success;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -834,7 +834,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
}
|
}
|
||||||
catch (SocketException Exception)
|
catch (SocketException Exception)
|
||||||
{
|
{
|
||||||
Errno = ConvertError((WSAError)Exception.ErrorCode);
|
Errno = ConvertError((WsaError)Exception.ErrorCode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -848,7 +848,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
BsdIoctl Cmd = (BsdIoctl)Context.RequestData.ReadInt32();
|
BsdIoctl Cmd = (BsdIoctl)Context.RequestData.ReadInt32();
|
||||||
int BufferCount = Context.RequestData.ReadInt32();
|
int BufferCount = Context.RequestData.ReadInt32();
|
||||||
|
|
||||||
LinuxError Errno = LinuxError.EBADF;
|
LinuxError Errno = LinuxError.BadF;
|
||||||
BsdSocket Socket = RetrieveSocket(SocketFd);
|
BsdSocket Socket = RetrieveSocket(SocketFd);
|
||||||
|
|
||||||
if (Socket != null)
|
if (Socket != null)
|
||||||
|
@ -856,7 +856,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
switch (Cmd)
|
switch (Cmd)
|
||||||
{
|
{
|
||||||
case BsdIoctl.AtMark:
|
case BsdIoctl.AtMark:
|
||||||
Errno = LinuxError.SUCCESS;
|
Errno = LinuxError.Success;
|
||||||
|
|
||||||
(long BufferPosition, long BufferSize) = Context.Request.GetBufferType0x22();
|
(long BufferPosition, long BufferSize) = Context.Request.GetBufferType0x22();
|
||||||
|
|
||||||
|
@ -865,7 +865,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Errno = LinuxError.EOPNOTSUPP;
|
Errno = LinuxError.OpNotSupp;
|
||||||
|
|
||||||
Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported Ioctl Cmd: {Cmd}");
|
Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported Ioctl Cmd: {Cmd}");
|
||||||
break;
|
break;
|
||||||
|
@ -883,12 +883,12 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
int Arg = Context.RequestData.ReadInt32();
|
int Arg = Context.RequestData.ReadInt32();
|
||||||
|
|
||||||
int Result = 0;
|
int Result = 0;
|
||||||
LinuxError Errno = LinuxError.EBADF;
|
LinuxError Errno = LinuxError.BadF;
|
||||||
BsdSocket Socket = RetrieveSocket(SocketFd);
|
BsdSocket Socket = RetrieveSocket(SocketFd);
|
||||||
|
|
||||||
if (Socket != null)
|
if (Socket != null)
|
||||||
{
|
{
|
||||||
Errno = LinuxError.SUCCESS;
|
Errno = LinuxError.Success;
|
||||||
|
|
||||||
if (Cmd == 0x3)
|
if (Cmd == 0x3)
|
||||||
{
|
{
|
||||||
|
@ -901,7 +901,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Errno = LinuxError.EOPNOTSUPP;
|
Errno = LinuxError.OpNotSupp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -931,23 +931,23 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
Socket.Handle.GetSocketOption(SocketOptionLevel.Socket, OptionName, OptionValue);
|
Socket.Handle.GetSocketOption(SocketOptionLevel.Socket, OptionName, OptionValue);
|
||||||
Context.Memory.WriteBytes(OptionValuePosition, OptionValue);
|
Context.Memory.WriteBytes(OptionValuePosition, OptionValue);
|
||||||
|
|
||||||
return LinuxError.SUCCESS;
|
return LinuxError.Success;
|
||||||
|
|
||||||
case (SocketOptionName)0x200:
|
case (SocketOptionName)0x200:
|
||||||
Socket.Handle.GetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, OptionValue);
|
Socket.Handle.GetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, OptionValue);
|
||||||
Context.Memory.WriteBytes(OptionValuePosition, OptionValue);
|
Context.Memory.WriteBytes(OptionValuePosition, OptionValue);
|
||||||
|
|
||||||
return LinuxError.SUCCESS;
|
return LinuxError.Success;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported SetSockOpt OptionName: {OptionName}");
|
Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported SetSockOpt OptionName: {OptionName}");
|
||||||
|
|
||||||
return LinuxError.EOPNOTSUPP;
|
return LinuxError.OpNotSupp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (SocketException Exception)
|
catch (SocketException Exception)
|
||||||
{
|
{
|
||||||
return ConvertError((WSAError)Exception.ErrorCode);
|
return ConvertError((WsaError)Exception.ErrorCode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -971,28 +971,28 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
case SocketOptionName.ReuseAddress:
|
case SocketOptionName.ReuseAddress:
|
||||||
Socket.Handle.SetSocketOption(SocketOptionLevel.Socket, OptionName, Context.Memory.ReadInt32(OptionValuePosition));
|
Socket.Handle.SetSocketOption(SocketOptionLevel.Socket, OptionName, Context.Memory.ReadInt32(OptionValuePosition));
|
||||||
|
|
||||||
return LinuxError.SUCCESS;
|
return LinuxError.Success;
|
||||||
|
|
||||||
case (SocketOptionName)0x200:
|
case (SocketOptionName)0x200:
|
||||||
Socket.Handle.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, Context.Memory.ReadInt32(OptionValuePosition));
|
Socket.Handle.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, Context.Memory.ReadInt32(OptionValuePosition));
|
||||||
|
|
||||||
return LinuxError.SUCCESS;
|
return LinuxError.Success;
|
||||||
|
|
||||||
case SocketOptionName.Linger:
|
case SocketOptionName.Linger:
|
||||||
Socket.Handle.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Linger,
|
Socket.Handle.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Linger,
|
||||||
new LingerOption(Context.Memory.ReadInt32(OptionValuePosition) != 0, Context.Memory.ReadInt32(OptionValuePosition + 4)));
|
new LingerOption(Context.Memory.ReadInt32(OptionValuePosition) != 0, Context.Memory.ReadInt32(OptionValuePosition + 4)));
|
||||||
|
|
||||||
return LinuxError.SUCCESS;
|
return LinuxError.Success;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported SetSockOpt OptionName: {OptionName}");
|
Logger.PrintWarning(LogClass.ServiceBsd, $"Unsupported SetSockOpt OptionName: {OptionName}");
|
||||||
|
|
||||||
return LinuxError.EOPNOTSUPP;
|
return LinuxError.OpNotSupp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (SocketException Exception)
|
catch (SocketException Exception)
|
||||||
{
|
{
|
||||||
return ConvertError((WSAError)Exception.ErrorCode);
|
return ConvertError((WsaError)Exception.ErrorCode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1005,12 +1005,12 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
|
|
||||||
(long BufferPos, long BufferSize) = Context.Request.GetBufferType0x21();
|
(long BufferPos, long BufferSize) = Context.Request.GetBufferType0x21();
|
||||||
|
|
||||||
LinuxError Errno = LinuxError.EBADF;
|
LinuxError Errno = LinuxError.BadF;
|
||||||
BsdSocket Socket = RetrieveSocket(SocketFd);
|
BsdSocket Socket = RetrieveSocket(SocketFd);
|
||||||
|
|
||||||
if (Socket != null)
|
if (Socket != null)
|
||||||
{
|
{
|
||||||
Errno = LinuxError.ENOPROTOOPT;
|
Errno = LinuxError.NoProtoOpt;
|
||||||
|
|
||||||
if (Level == 0xFFFF)
|
if (Level == 0xFFFF)
|
||||||
{
|
{
|
||||||
|
@ -1031,16 +1031,16 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
int SocketFd = Context.RequestData.ReadInt32();
|
int SocketFd = Context.RequestData.ReadInt32();
|
||||||
int How = Context.RequestData.ReadInt32();
|
int How = Context.RequestData.ReadInt32();
|
||||||
|
|
||||||
LinuxError Errno = LinuxError.EBADF;
|
LinuxError Errno = LinuxError.BadF;
|
||||||
BsdSocket Socket = RetrieveSocket(SocketFd);
|
BsdSocket Socket = RetrieveSocket(SocketFd);
|
||||||
|
|
||||||
if (Socket != null)
|
if (Socket != null)
|
||||||
{
|
{
|
||||||
Errno = LinuxError.EINVAL;
|
Errno = LinuxError.InVal;
|
||||||
|
|
||||||
if (How >= 0 && How <= 2)
|
if (How >= 0 && How <= 2)
|
||||||
{
|
{
|
||||||
Errno = LinuxError.SUCCESS;
|
Errno = LinuxError.Success;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -1048,7 +1048,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
}
|
}
|
||||||
catch (SocketException Exception)
|
catch (SocketException Exception)
|
||||||
{
|
{
|
||||||
Errno = ConvertError((WSAError)Exception.ErrorCode);
|
Errno = ConvertError((WsaError)Exception.ErrorCode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1061,11 +1061,11 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
{
|
{
|
||||||
int How = Context.RequestData.ReadInt32();
|
int How = Context.RequestData.ReadInt32();
|
||||||
|
|
||||||
LinuxError Errno = LinuxError.EINVAL;
|
LinuxError Errno = LinuxError.InVal;
|
||||||
|
|
||||||
if (How >= 0 && How <= 2)
|
if (How >= 0 && How <= 2)
|
||||||
{
|
{
|
||||||
Errno = LinuxError.SUCCESS;
|
Errno = LinuxError.Success;
|
||||||
|
|
||||||
foreach (BsdSocket Socket in Sockets)
|
foreach (BsdSocket Socket in Sockets)
|
||||||
{
|
{
|
||||||
|
@ -1077,7 +1077,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
}
|
}
|
||||||
catch (SocketException Exception)
|
catch (SocketException Exception)
|
||||||
{
|
{
|
||||||
Errno = ConvertError((WSAError)Exception.ErrorCode);
|
Errno = ConvertError((WsaError)Exception.ErrorCode);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1094,7 +1094,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
|
|
||||||
(long SendPosition, long SendSize) = Context.Request.GetBufferType0x21();
|
(long SendPosition, long SendSize) = Context.Request.GetBufferType0x21();
|
||||||
|
|
||||||
LinuxError Errno = LinuxError.EBADF;
|
LinuxError Errno = LinuxError.BadF;
|
||||||
BsdSocket Socket = RetrieveSocket(SocketFd);
|
BsdSocket Socket = RetrieveSocket(SocketFd);
|
||||||
int Result = -1;
|
int Result = -1;
|
||||||
|
|
||||||
|
@ -1109,7 +1109,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
}
|
}
|
||||||
catch (SocketException Exception)
|
catch (SocketException Exception)
|
||||||
{
|
{
|
||||||
Errno = ConvertError((WSAError)Exception.ErrorCode);
|
Errno = ConvertError((WsaError)Exception.ErrorCode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1123,7 +1123,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
|
|
||||||
(long ReceivePosition, long ReceiveLength) = Context.Request.GetBufferType0x22();
|
(long ReceivePosition, long ReceiveLength) = Context.Request.GetBufferType0x22();
|
||||||
|
|
||||||
LinuxError Errno = LinuxError.EBADF;
|
LinuxError Errno = LinuxError.BadF;
|
||||||
BsdSocket Socket = RetrieveSocket(SocketFd);
|
BsdSocket Socket = RetrieveSocket(SocketFd);
|
||||||
int Result = -1;
|
int Result = -1;
|
||||||
|
|
||||||
|
@ -1138,7 +1138,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
}
|
}
|
||||||
catch (SocketException Exception)
|
catch (SocketException Exception)
|
||||||
{
|
{
|
||||||
Errno = ConvertError((WSAError)Exception.ErrorCode);
|
Errno = ConvertError((WsaError)Exception.ErrorCode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1150,7 +1150,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
{
|
{
|
||||||
int SocketFd = Context.RequestData.ReadInt32();
|
int SocketFd = Context.RequestData.ReadInt32();
|
||||||
|
|
||||||
LinuxError Errno = LinuxError.EBADF;
|
LinuxError Errno = LinuxError.BadF;
|
||||||
BsdSocket Socket = RetrieveSocket(SocketFd);
|
BsdSocket Socket = RetrieveSocket(SocketFd);
|
||||||
|
|
||||||
if (Socket != null)
|
if (Socket != null)
|
||||||
|
@ -1159,7 +1159,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
|
|
||||||
Sockets[SocketFd] = null;
|
Sockets[SocketFd] = null;
|
||||||
|
|
||||||
Errno = LinuxError.SUCCESS;
|
Errno = LinuxError.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
return WriteBsdResult(Context, 0, Errno);
|
return WriteBsdResult(Context, 0, Errno);
|
||||||
|
@ -1171,12 +1171,12 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
int SocketFd = Context.RequestData.ReadInt32();
|
int SocketFd = Context.RequestData.ReadInt32();
|
||||||
ulong Reserved = Context.RequestData.ReadUInt64();
|
ulong Reserved = Context.RequestData.ReadUInt64();
|
||||||
|
|
||||||
LinuxError Errno = LinuxError.ENOENT;
|
LinuxError Errno = LinuxError.NoEnt;
|
||||||
int NewSockFd = -1;
|
int NewSockFd = -1;
|
||||||
|
|
||||||
if (IsPrivileged)
|
if (IsPrivileged)
|
||||||
{
|
{
|
||||||
Errno = LinuxError.EBADF;
|
Errno = LinuxError.BadF;
|
||||||
|
|
||||||
BsdSocket OldSocket = RetrieveSocket(SocketFd);
|
BsdSocket OldSocket = RetrieveSocket(SocketFd);
|
||||||
|
|
||||||
|
|
|
@ -1,72 +1,72 @@
|
||||||
namespace Ryujinx.HLE.Loaders.Elf
|
namespace Ryujinx.HLE.Loaders.Elf
|
||||||
{
|
{
|
||||||
enum ElfDynamicTag
|
internal enum ElfDynamicTag
|
||||||
{
|
{
|
||||||
DT_NULL = 0,
|
Null = 0,
|
||||||
DT_NEEDED = 1,
|
Needed = 1,
|
||||||
DT_PLTRELSZ = 2,
|
PltRelSz = 2,
|
||||||
DT_PLTGOT = 3,
|
PltGoz = 3,
|
||||||
DT_HASH = 4,
|
Hash = 4,
|
||||||
DT_STRTAB = 5,
|
StrTab = 5,
|
||||||
DT_SYMTAB = 6,
|
SymTab = 6,
|
||||||
DT_RELA = 7,
|
RelA = 7,
|
||||||
DT_RELASZ = 8,
|
RelASz = 8,
|
||||||
DT_RELAENT = 9,
|
RelAEnt = 9,
|
||||||
DT_STRSZ = 10,
|
StrSz = 10,
|
||||||
DT_SYMENT = 11,
|
SymEnt = 11,
|
||||||
DT_INIT = 12,
|
Init = 12,
|
||||||
DT_FINI = 13,
|
Fini = 13,
|
||||||
DT_SONAME = 14,
|
SoName = 14,
|
||||||
DT_RPATH = 15,
|
RPath = 15,
|
||||||
DT_SYMBOLIC = 16,
|
Symbolic = 16,
|
||||||
DT_REL = 17,
|
Rel = 17,
|
||||||
DT_RELSZ = 18,
|
RelSz = 18,
|
||||||
DT_RELENT = 19,
|
RelEnt = 19,
|
||||||
DT_PLTREL = 20,
|
PltRel = 20,
|
||||||
DT_DEBUG = 21,
|
Debug = 21,
|
||||||
DT_TEXTREL = 22,
|
TextRel = 22,
|
||||||
DT_JMPREL = 23,
|
JmpRel = 23,
|
||||||
DT_BIND_NOW = 24,
|
BindNow = 24,
|
||||||
DT_INIT_ARRAY = 25,
|
InitArray = 25,
|
||||||
DT_FINI_ARRAY = 26,
|
FiniArray = 26,
|
||||||
DT_INIT_ARRAYSZ = 27,
|
InitArraySz = 27,
|
||||||
DT_FINI_ARRAYSZ = 28,
|
FiniArraySz = 28,
|
||||||
DT_RUNPATH = 29,
|
RunPath = 29,
|
||||||
DT_FLAGS = 30,
|
Flags = 30,
|
||||||
DT_ENCODING = 32,
|
Encoding = 32,
|
||||||
DT_PREINIT_ARRAY = 32,
|
PreInitArray = 32,
|
||||||
DT_PREINIT_ARRAYSZ = 33,
|
PreInitArraySz = 33,
|
||||||
DT_GNU_PRELINKED = 0x6ffffdf5,
|
GnuPrelinked = 0x6ffffdf5,
|
||||||
DT_GNU_CONFLICTSZ = 0x6ffffdf6,
|
GnuConflictSz = 0x6ffffdf6,
|
||||||
DT_GNU_LIBLISTSZ = 0x6ffffdf7,
|
GnuLibListSz = 0x6ffffdf7,
|
||||||
DT_CHECKSUM = 0x6ffffdf8,
|
Checksum = 0x6ffffdf8,
|
||||||
DT_PLTPADSZ = 0x6ffffdf9,
|
PltPadSz = 0x6ffffdf9,
|
||||||
DT_MOVEENT = 0x6ffffdfa,
|
MoveEnt = 0x6ffffdfa,
|
||||||
DT_MOVESZ = 0x6ffffdfb,
|
MoveSz = 0x6ffffdfb,
|
||||||
DT_FEATURE_1 = 0x6ffffdfc,
|
Feature1 = 0x6ffffdfc,
|
||||||
DT_POSFLAG_1 = 0x6ffffdfd,
|
PosFlag1 = 0x6ffffdfd,
|
||||||
DT_SYMINSZ = 0x6ffffdfe,
|
SymInSz = 0x6ffffdfe,
|
||||||
DT_SYMINENT = 0x6ffffdff,
|
SymInEnt = 0x6ffffdff,
|
||||||
DT_GNU_HASH = 0x6ffffef5,
|
GnuHash = 0x6ffffef5,
|
||||||
DT_TLSDESC_PLT = 0x6ffffef6,
|
TlsDescPlt = 0x6ffffef6,
|
||||||
DT_TLSDESC_GOT = 0x6ffffef7,
|
TlsDescGot = 0x6ffffef7,
|
||||||
DT_GNU_CONFLICT = 0x6ffffef8,
|
GnuConflict = 0x6ffffef8,
|
||||||
DT_GNU_LIBLIST = 0x6ffffef9,
|
GnuLibList = 0x6ffffef9,
|
||||||
DT_CONFIG = 0x6ffffefa,
|
Config = 0x6ffffefa,
|
||||||
DT_DEPAUDIT = 0x6ffffefb,
|
DepAudit = 0x6ffffefb,
|
||||||
DT_AUDIT = 0x6ffffefc,
|
Audit = 0x6ffffefc,
|
||||||
DT_PLTPAD = 0x6ffffefd,
|
PltPad = 0x6ffffefd,
|
||||||
DT_MOVETAB = 0x6ffffefe,
|
MoveTab = 0x6ffffefe,
|
||||||
DT_SYMINFO = 0x6ffffeff,
|
SymInfo = 0x6ffffeff,
|
||||||
DT_VERSYM = 0x6ffffff0,
|
VerSym = 0x6ffffff0,
|
||||||
DT_RELACOUNT = 0x6ffffff9,
|
RelaCount = 0x6ffffff9,
|
||||||
DT_RELCOUNT = 0x6ffffffa,
|
RelCount = 0x6ffffffa,
|
||||||
DT_FLAGS_1 = 0x6ffffffb,
|
Flags1 = 0x6ffffffb,
|
||||||
DT_VERDEF = 0x6ffffffc,
|
VerDef = 0x6ffffffc,
|
||||||
DT_VERDEFNUM = 0x6ffffffd,
|
VerDefNum = 0x6ffffffd,
|
||||||
DT_VERNEED = 0x6ffffffe,
|
VerNeed = 0x6ffffffe,
|
||||||
DT_VERNEEDNUM = 0x6fffffff,
|
VerNeedNum = 0x6fffffff,
|
||||||
DT_AUXILIARY = 0x7ffffffd,
|
Auxiliary = 0x7ffffffd,
|
||||||
DT_FILTER = 0x7fffffff
|
Filter = 0x7fffffff
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,45 +1,45 @@
|
||||||
namespace Ryujinx.HLE.Utilities
|
namespace Ryujinx.HLE.Utilities
|
||||||
{
|
{
|
||||||
enum LinuxError
|
internal enum LinuxError
|
||||||
{
|
{
|
||||||
SUCCESS = 0,
|
Success = 0,
|
||||||
EPERM = 1 /* Operation not permitted */,
|
Perm = 1 /* Operation not permitted */,
|
||||||
ENOENT = 2 /* No such file or directory */,
|
NoEnt = 2 /* No such file or directory */,
|
||||||
ESRCH = 3 /* No such process */,
|
Srch = 3 /* No such process */,
|
||||||
EINTR = 4 /* Interrupted system call */,
|
Intr = 4 /* Interrupted system call */,
|
||||||
EIO = 5 /* I/O error */,
|
Io = 5 /* I/O error */,
|
||||||
ENXIO = 6 /* No such device or address */,
|
NxIo = 6 /* No such device or address */,
|
||||||
E2BIG = 7 /* Argument list too long */,
|
TooBig = 7 /* Argument list too long */,
|
||||||
ENOEXEC = 8 /* Exec format error */,
|
NoExec = 8 /* Exec format error */,
|
||||||
EBADF = 9 /* Bad file number */,
|
BadF = 9 /* Bad file number */,
|
||||||
ECHILD = 10 /* No child processes */,
|
Child = 10 /* No child processes */,
|
||||||
EAGAIN = 11 /* Try again */,
|
Again = 11 /* Try again */,
|
||||||
ENOMEM = 12 /* Out of memory */,
|
NoMem = 12 /* Out of memory */,
|
||||||
EACCES = 13 /* Permission denied */,
|
Acces = 13 /* Permission denied */,
|
||||||
EFAULT = 14 /* Bad address */,
|
Fault = 14 /* Bad address */,
|
||||||
ENOTBLK = 15 /* Block device required */,
|
NotBlk = 15 /* Block device required */,
|
||||||
EBUSY = 16 /* Device or resource busy */,
|
Busy = 16 /* Device or resource busy */,
|
||||||
EEXIST = 17 /* File exists */,
|
Exist = 17 /* File exists */,
|
||||||
EXDEV = 18 /* Cross-device link */,
|
XDev = 18 /* Cross-device link */,
|
||||||
ENODEV = 19 /* No such device */,
|
NoDev = 19 /* No such device */,
|
||||||
ENOTDIR = 20 /* Not a directory */,
|
NotDir = 20 /* Not a directory */,
|
||||||
EISDIR = 21 /* Is a directory */,
|
IsDir = 21 /* Is a directory */,
|
||||||
EINVAL = 22 /* Invalid argument */,
|
InVal = 22 /* Invalid argument */,
|
||||||
ENFILE = 23 /* File table overflow */,
|
NFile = 23 /* File table overflow */,
|
||||||
EMFILE = 24 /* Too many open files */,
|
MFile = 24 /* Too many open files */,
|
||||||
ENOTTY = 25 /* Not a typewriter */,
|
NoTty = 25 /* Not a typewriter */,
|
||||||
ETXTBSY = 26 /* Text file busy */,
|
TxtBsy = 26 /* Text file busy */,
|
||||||
EFBIG = 27 /* File too large */,
|
FBig = 27 /* File too large */,
|
||||||
ENOSPC = 28 /* No space left on device */,
|
NoSpc = 28 /* No space left on device */,
|
||||||
ESPIPE = 29 /* Illegal seek */,
|
SPipe = 29 /* Illegal seek */,
|
||||||
EROFS = 30 /* Read-only file system */,
|
RoFs = 30 /* Read-only file system */,
|
||||||
EMLINK = 31 /* Too many links */,
|
MLink = 31 /* Too many links */,
|
||||||
EPIPE = 32 /* Broken pipe */,
|
Pipe = 32 /* Broken pipe */,
|
||||||
EDOM = 33 /* Math argument out of domain of func */,
|
Dom = 33 /* Math argument out of domain of func */,
|
||||||
ERANGE = 34 /* Math result not representable */,
|
Range = 34 /* Math result not representable */,
|
||||||
EDEADLK = 35 /* Resource deadlock would occur */,
|
DeadLk = 35 /* Resource deadlock would occur */,
|
||||||
ENAMETOOLONG = 36 /* File name too long */,
|
NameTooLong = 36 /* File name too long */,
|
||||||
ENOLCK = 37 /* No record locks available */,
|
NoLck = 37 /* No record locks available */,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This error code is special: arch syscall entry code will return
|
* This error code is special: arch syscall entry code will return
|
||||||
|
@ -48,105 +48,105 @@ namespace Ryujinx.HLE.Utilities
|
||||||
* failures due to attempts to use a nonexistent syscall, syscall
|
* failures due to attempts to use a nonexistent syscall, syscall
|
||||||
* implementations should refrain from returning -ENOSYS.
|
* implementations should refrain from returning -ENOSYS.
|
||||||
*/
|
*/
|
||||||
ENOSYS = 38 /* Invalid system call number */,
|
NoSys = 38 /* Invalid system call number */,
|
||||||
ENOTEMPTY = 39 /* Directory not empty */,
|
NotEmpty = 39 /* Directory not empty */,
|
||||||
ELOOP = 40 /* Too many symbolic links encountered */,
|
Loop = 40 /* Too many symbolic links encountered */,
|
||||||
EWOULDBLOCK = EAGAIN /* Operation would block */,
|
WouldBlock = Again /* Operation would block */,
|
||||||
ENOMSG = 42 /* No message of desired type */,
|
NoMsg = 42 /* No message of desired type */,
|
||||||
EIDRM = 43 /* Identifier removed */,
|
IdRm = 43 /* Identifier removed */,
|
||||||
ECHRNG = 44 /* Channel number out of range */,
|
ChRng = 44 /* Channel number out of range */,
|
||||||
EL2NSYNC = 45 /* Level 2 not synchronized */,
|
L2NSync = 45 /* Level 2 not synchronized */,
|
||||||
EL3HLT = 46 /* Level 3 halted */,
|
L3Hlt = 46 /* Level 3 halted */,
|
||||||
EL3RST = 47 /* Level 3 reset */,
|
L3Rst = 47 /* Level 3 reset */,
|
||||||
ELNRNG = 48 /* Link number out of range */,
|
LnRng = 48 /* Link number out of range */,
|
||||||
EUNATCH = 49 /* Protocol driver not attached */,
|
UnAtch = 49 /* Protocol driver not attached */,
|
||||||
ENOCSI = 50 /* No CSI structure available */,
|
NoCsi = 50 /* No CSI structure available */,
|
||||||
EL2HLT = 51 /* Level 2 halted */,
|
L2Hlt = 51 /* Level 2 halted */,
|
||||||
EBADE = 52 /* Invalid exchange */,
|
BadE = 52 /* Invalid exchange */,
|
||||||
EBADR = 53 /* Invalid request descriptor */,
|
BadR = 53 /* Invalid request descriptor */,
|
||||||
EXFULL = 54 /* Exchange full */,
|
XFull = 54 /* Exchange full */,
|
||||||
ENOANO = 55 /* No anode */,
|
NoAno = 55 /* No anode */,
|
||||||
EBADRQC = 56 /* Invalid request code */,
|
BadRqC = 56 /* Invalid request code */,
|
||||||
EBADSLT = 57 /* Invalid slot */,
|
BadSlt = 57 /* Invalid slot */,
|
||||||
EDEADLOCK = EDEADLK,
|
DeadLock = DeadLk,
|
||||||
EBFONT = 59 /* Bad font file format */,
|
BFont = 59 /* Bad font file format */,
|
||||||
ENOSTR = 60 /* Device not a stream */,
|
NoStr = 60 /* Device not a stream */,
|
||||||
ENODATA = 61 /* No data available */,
|
NoData = 61 /* No data available */,
|
||||||
ETIME = 62 /* Timer expired */,
|
Time = 62 /* Timer expired */,
|
||||||
ENOSR = 63 /* Out of streams resources */,
|
NoSr = 63 /* Out of streams resources */,
|
||||||
ENONET = 64 /* Machine is not on the network */,
|
NoNet = 64 /* Machine is not on the network */,
|
||||||
ENOPKG = 65 /* Package not installed */,
|
NoPkg = 65 /* Package not installed */,
|
||||||
EREMOTE = 66 /* Object is remote */,
|
Remote = 66 /* Object is remote */,
|
||||||
ENOLINK = 67 /* Link has been severed */,
|
NoLink = 67 /* Link has been severed */,
|
||||||
EADV = 68 /* Advertise error */,
|
Adv = 68 /* Advertise error */,
|
||||||
ESRMNT = 69 /* Srmount error */,
|
Stmnt = 69 /* Srmount error */,
|
||||||
ECOMM = 70 /* Communication error on send */,
|
Comm = 70 /* Communication error on send */,
|
||||||
EPROTO = 71 /* Protocol error */,
|
Proto = 71 /* Protocol error */,
|
||||||
EMULTIHOP = 72 /* Multihop attempted */,
|
Multihop = 72 /* Multihop attempted */,
|
||||||
EDOTDOT = 73 /* RFS specific error */,
|
DotDot = 73 /* RFS specific error */,
|
||||||
EBADMSG = 74 /* Not a data message */,
|
BadMsg = 74 /* Not a data message */,
|
||||||
EOVERFLOW = 75 /* Value too large for defined data type */,
|
Overflow = 75 /* Value too large for defined data type */,
|
||||||
ENOTUNIQ = 76 /* Name not unique on network */,
|
NotUniq = 76 /* Name not unique on network */,
|
||||||
EBADFD = 77 /* File descriptor in bad state */,
|
BadFd = 77 /* File descriptor in bad state */,
|
||||||
EREMCHG = 78 /* Remote address changed */,
|
RemChg = 78 /* Remote address changed */,
|
||||||
ELIBACC = 79 /* Can not access a needed shared library */,
|
LibAcc = 79 /* Can not access a needed shared library */,
|
||||||
ELIBBAD = 80 /* Accessing a corrupted shared library */,
|
LibBad = 80 /* Accessing a corrupted shared library */,
|
||||||
ELIBSCN = 81 /* .lib section in a.out corrupted */,
|
LibScn = 81 /* .lib section in a.out corrupted */,
|
||||||
ELIBMAX = 82 /* Attempting to link in too many shared libraries */,
|
LibMax = 82 /* Attempting to link in too many shared libraries */,
|
||||||
ELIBEXEC = 83 /* Cannot exec a shared library directly */,
|
LibExec = 83 /* Cannot exec a shared library directly */,
|
||||||
EILSEQ = 84 /* Illegal byte sequence */,
|
IlSeq = 84 /* Illegal byte sequence */,
|
||||||
ERESTART = 85 /* Interrupted system call should be restarted */,
|
Restart = 85 /* Interrupted system call should be restarted */,
|
||||||
ESTRPIPE = 86 /* Streams pipe error */,
|
StrPipe = 86 /* Streams pipe error */,
|
||||||
EUSERS = 87 /* Too many users */,
|
Users = 87 /* Too many users */,
|
||||||
ENOTSOCK = 88 /* Socket operation on non-socket */,
|
NotSock = 88 /* Socket operation on non-socket */,
|
||||||
EDESTADDRREQ = 89 /* Destination address required */,
|
DestAddrReq = 89 /* Destination address required */,
|
||||||
EMSGSIZE = 90 /* Message too long */,
|
MsgSize = 90 /* Message too long */,
|
||||||
EPROTOTYPE = 91 /* Protocol wrong type for socket */,
|
ProtoType = 91 /* Protocol wrong type for socket */,
|
||||||
ENOPROTOOPT = 92 /* Protocol not available */,
|
NoProtoOpt = 92 /* Protocol not available */,
|
||||||
EPROTONOSUPPORT = 93 /* Protocol not supported */,
|
ProtoNoSupport = 93 /* Protocol not supported */,
|
||||||
ESOCKTNOSUPPORT = 94 /* Socket type not supported */,
|
SocktNoSupport = 94 /* Socket type not supported */,
|
||||||
EOPNOTSUPP = 95 /* Operation not supported on transport endpoint */,
|
OpNotSupp = 95 /* Operation not supported on transport endpoint */,
|
||||||
EPFNOSUPPORT = 96 /* Protocol family not supported */,
|
PfNoSupport = 96 /* Protocol family not supported */,
|
||||||
EAFNOSUPPORT = 97 /* Address family not supported by protocol */,
|
AfNoSupport = 97 /* Address family not supported by protocol */,
|
||||||
EADDRINUSE = 98 /* Address already in use */,
|
AddrInUse = 98 /* Address already in use */,
|
||||||
EADDRNOTAVAIL = 99 /* Cannot assign requested address */,
|
AddrNotAvail = 99 /* Cannot assign requested address */,
|
||||||
ENETDOWN = 100 /* Network is down */,
|
NetDown = 100 /* Network is down */,
|
||||||
ENETUNREACH = 101 /* Network is unreachable */,
|
NetUnReach = 101 /* Network is unreachable */,
|
||||||
ENETRESET = 102 /* Network dropped connection because of reset */,
|
NetReset = 102 /* Network dropped connection because of reset */,
|
||||||
ECONNABORTED = 103 /* Software caused connection abort */,
|
ConnAborted = 103 /* Software caused connection abort */,
|
||||||
ECONNRESET = 104 /* Connection reset by peer */,
|
ConnReset = 104 /* Connection reset by peer */,
|
||||||
ENOBUFS = 105 /* No buffer space available */,
|
NoBufs = 105 /* No buffer space available */,
|
||||||
EISCONN = 106 /* Transport endpoint is already connected */,
|
IsConn = 106 /* Transport endpoint is already connected */,
|
||||||
ENOTCONN = 107 /* Transport endpoint is not connected */,
|
NotConn = 107 /* Transport endpoint is not connected */,
|
||||||
ESHUTDOWN = 108 /* Cannot send after transport endpoint shutdown */,
|
Shutdown = 108 /* Cannot send after transport endpoint shutdown */,
|
||||||
ETOOMANYREFS = 109 /* Too many references: cannot splice */,
|
TooManyRefs = 109 /* Too many references: cannot splice */,
|
||||||
ETIMEDOUT = 110 /* Connection timed out */,
|
TimedOut = 110 /* Connection timed out */,
|
||||||
ECONNREFUSED = 111 /* Connection refused */,
|
ConnRefused = 111 /* Connection refused */,
|
||||||
EHOSTDOWN = 112 /* Host is down */,
|
HostDown = 112 /* Host is down */,
|
||||||
EHOSTUNREACH = 113 /* No route to host */,
|
HostUnReach = 113 /* No route to host */,
|
||||||
EALREADY = 114 /* Operation already in progress */,
|
Already = 114 /* Operation already in progress */,
|
||||||
EINPROGRESS = 115 /* Operation now in progress */,
|
InProgress = 115 /* Operation now in progress */,
|
||||||
ESTALE = 116 /* Stale file handle */,
|
Stale = 116 /* Stale file handle */,
|
||||||
EUCLEAN = 117 /* Structure needs cleaning */,
|
UClean = 117 /* Structure needs cleaning */,
|
||||||
ENOTNAM = 118 /* Not a XENIX named type file */,
|
NotNam = 118 /* Not a XENIX named type file */,
|
||||||
ENAVAIL = 119 /* No XENIX semaphores available */,
|
NAvail = 119 /* No XENIX semaphores available */,
|
||||||
EISNAM = 120 /* Is a named type file */,
|
IsNam = 120 /* Is a named type file */,
|
||||||
EREMOTEIO = 121 /* Remote I/O error */,
|
RemoteIo = 121 /* Remote I/O error */,
|
||||||
EDQUOT = 122 /* Quota exceeded */,
|
DQuot = 122 /* Quota exceeded */,
|
||||||
ENOMEDIUM = 123 /* No medium found */,
|
NoMedium = 123 /* No medium found */,
|
||||||
EMEDIUMTYPE = 124 /* Wrong medium type */,
|
MediumType = 124 /* Wrong medium type */,
|
||||||
ECANCELED = 125 /* Operation Canceled */,
|
Canceled = 125 /* Operation Canceled */,
|
||||||
ENOKEY = 126 /* Required key not available */,
|
NoKey = 126 /* Required key not available */,
|
||||||
EKEYEXPIRED = 127 /* Key has expired */,
|
KeyExpired = 127 /* Key has expired */,
|
||||||
EKEYREVOKED = 128 /* Key has been revoked */,
|
KeyRevoked = 128 /* Key has been revoked */,
|
||||||
EKEYREJECTED = 129 /* Key was rejected by service */,
|
KeyRejected = 129 /* Key was rejected by service */,
|
||||||
|
|
||||||
/* for robust mutexes */
|
/* for robust mutexes */
|
||||||
EOWNERDEAD = 130 /* Owner died */,
|
OwnerDead = 130 /* Owner died */,
|
||||||
ENOTRECOVERABLE = 131 /* State not recoverable */,
|
NotRecoverable = 131 /* State not recoverable */,
|
||||||
|
|
||||||
ERFKILL = 132 /* Operation not possible due to RF-kill */,
|
RfKill = 132 /* Operation not possible due to RF-kill */,
|
||||||
|
|
||||||
EHWPOISON = 133 /* Memory page has hardware error */,
|
HwPoison = 133 /* Memory page has hardware error */,
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,82 +1,82 @@
|
||||||
namespace Ryujinx.HLE.Utilities
|
namespace Ryujinx.HLE.Utilities
|
||||||
{
|
{
|
||||||
enum WSAError
|
internal enum WsaError
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* All Windows Sockets error constants are biased by WSABASEERR from
|
* All Windows Sockets error constants are biased by WSABASEERR from
|
||||||
* the "normal"
|
* the "normal"
|
||||||
*/
|
*/
|
||||||
WSABASEERR = 10000,
|
BaseError = 10000,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Windows Sockets definitions of regular Microsoft C error constants
|
* Windows Sockets definitions of regular Microsoft C error constants
|
||||||
*/
|
*/
|
||||||
WSAEINTR = (WSABASEERR + 4),
|
Interrupted = (BaseError + 4),
|
||||||
WSAEBADF = (WSABASEERR + 9),
|
BadFileHandle = (BaseError + 9),
|
||||||
WSAEACCES = (WSABASEERR + 13),
|
AccessDenied = (BaseError + 13),
|
||||||
WSAEFAULT = (WSABASEERR + 14),
|
Fault = (BaseError + 14),
|
||||||
WSAEINVAL = (WSABASEERR + 22),
|
InvalidArgument = (BaseError + 22),
|
||||||
WSAEMFILE = (WSABASEERR + 24),
|
TooManyOpenSockets = (BaseError + 24),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Windows Sockets definitions of regular Berkeley error constants
|
* Windows Sockets definitions of regular Berkeley error constants
|
||||||
*/
|
*/
|
||||||
WSAEWOULDBLOCK = (WSABASEERR + 35),
|
WouldBlock = (BaseError + 35),
|
||||||
WSAEINPROGRESS = (WSABASEERR + 36),
|
InProgress = (BaseError + 36),
|
||||||
WSAEALREADY = (WSABASEERR + 37),
|
AlreadyInProgress = (BaseError + 37),
|
||||||
WSAENOTSOCK = (WSABASEERR + 38),
|
NotSocket = (BaseError + 38),
|
||||||
WSAEDESTADDRREQ = (WSABASEERR + 39),
|
DestinationAddressRequired = (BaseError + 39),
|
||||||
WSAEMSGSIZE = (WSABASEERR + 40),
|
MessageSize = (BaseError + 40),
|
||||||
WSAEPROTOTYPE = (WSABASEERR + 41),
|
ProtocolType = (BaseError + 41),
|
||||||
WSAENOPROTOOPT = (WSABASEERR + 42),
|
ProtocolOption = (BaseError + 42),
|
||||||
WSAEPROTONOSUPPORT = (WSABASEERR + 43),
|
ProtocolNotSupported = (BaseError + 43),
|
||||||
WSAESOCKTNOSUPPORT = (WSABASEERR + 44),
|
SocketNotSupported = (BaseError + 44),
|
||||||
WSAEOPNOTSUPP = (WSABASEERR + 45),
|
OperationNotSupported = (BaseError + 45),
|
||||||
WSAEPFNOSUPPORT = (WSABASEERR + 46),
|
ProtocolFamilyNotSupported = (BaseError + 46),
|
||||||
WSAEAFNOSUPPORT = (WSABASEERR + 47),
|
AddressFamilyNotSupported = (BaseError + 47),
|
||||||
WSAEADDRINUSE = (WSABASEERR + 48),
|
AddressAlreadyInUse = (BaseError + 48),
|
||||||
WSAEADDRNOTAVAIL = (WSABASEERR + 49),
|
AddressNotAvailable = (BaseError + 49),
|
||||||
WSAENETDOWN = (WSABASEERR + 50),
|
NetworkDown = (BaseError + 50),
|
||||||
WSAENETUNREACH = (WSABASEERR + 51),
|
NetworkUnreachable = (BaseError + 51),
|
||||||
WSAENETRESET = (WSABASEERR + 52),
|
NetworkReset = (BaseError + 52),
|
||||||
WSAECONNABORTED = (WSABASEERR + 53),
|
ConnectionAborted = (BaseError + 53),
|
||||||
WSAECONNRESET = (WSABASEERR + 54),
|
ConnectionReset = (BaseError + 54),
|
||||||
WSAENOBUFS = (WSABASEERR + 55),
|
NoBufferSpaceAvailable = (BaseError + 55),
|
||||||
WSAEISCONN = (WSABASEERR + 56),
|
IsConnected = (BaseError + 56),
|
||||||
WSAENOTCONN = (WSABASEERR + 57),
|
NotConnected = (BaseError + 57),
|
||||||
WSAESHUTDOWN = (WSABASEERR + 58),
|
Shutdown = (BaseError + 58),
|
||||||
WSAETOOMANYREFS = (WSABASEERR + 59),
|
TooManyReferences = (BaseError + 59),
|
||||||
WSAETIMEDOUT = (WSABASEERR + 60),
|
TimedOut = (BaseError + 60),
|
||||||
WSAECONNREFUSED = (WSABASEERR + 61),
|
ConnectionRefused = (BaseError + 61),
|
||||||
WSAELOOP = (WSABASEERR + 62),
|
Loop = (BaseError + 62),
|
||||||
WSAENAMETOOLONG = (WSABASEERR + 63),
|
NameTooLong = (BaseError + 63),
|
||||||
WSAEHOSTDOWN = (WSABASEERR + 64),
|
HostDown = (BaseError + 64),
|
||||||
WSAEHOSTUNREACH = (WSABASEERR + 65),
|
HostUnreachable = (BaseError + 65),
|
||||||
WSAENOTEMPTY = (WSABASEERR + 66),
|
NotEmpty = (BaseError + 66),
|
||||||
WSAEPROCLIM = (WSABASEERR + 67),
|
ProcessLimit = (BaseError + 67),
|
||||||
WSAEUSERS = (WSABASEERR + 68),
|
UserQuota = (BaseError + 68),
|
||||||
WSAEDQUOT = (WSABASEERR + 69),
|
DiskQuota = (BaseError + 69),
|
||||||
WSAESTALE = (WSABASEERR + 70),
|
Stale = (BaseError + 70),
|
||||||
WSAEREMOTE = (WSABASEERR + 71),
|
Remote = (BaseError + 71),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Extended Windows Sockets error constant definitions
|
* Extended Windows Sockets error constant definitions
|
||||||
*/
|
*/
|
||||||
WSASYSNOTREADY = (WSABASEERR + 91),
|
SystemNotReady = (BaseError + 91),
|
||||||
WSAVERNOTSUPPORTED = (WSABASEERR + 92),
|
VersionNotSupported = (BaseError + 92),
|
||||||
WSANOTINITIALISED = (WSABASEERR + 93),
|
NotInitialized = (BaseError + 93),
|
||||||
WSAEDISCON = (WSABASEERR + 101),
|
Disconnecting = (BaseError + 101),
|
||||||
WSAENOMORE = (WSABASEERR + 102),
|
NoMoreResultsOld = (BaseError + 102),
|
||||||
WSAECANCELLED = (WSABASEERR + 103),
|
CancelledOld = (BaseError + 103),
|
||||||
WSAEINVALIDPROCTABLE = (WSABASEERR + 104),
|
InvalidProcedureCallTable = (BaseError + 104),
|
||||||
WSAEINVALIDPROVIDER = (WSABASEERR + 105),
|
InvalidProvider = (BaseError + 105),
|
||||||
WSAEPROVIDERFAILEDINIT = (WSABASEERR + 106),
|
ProviderFailedInit = (BaseError + 106),
|
||||||
WSASYSCALLFAILURE = (WSABASEERR + 107),
|
SysCallFailure = (BaseError + 107),
|
||||||
WSASERVICE_NOT_FOUND = (WSABASEERR + 108),
|
ServiceNotFound = (BaseError + 108),
|
||||||
WSATYPE_NOT_FOUND = (WSABASEERR + 109),
|
TypeNotFound = (BaseError + 109),
|
||||||
WSA_E_NO_MORE = (WSABASEERR + 110),
|
NoMoreResults = (BaseError + 110),
|
||||||
WSA_E_CANCELLED = (WSABASEERR + 111),
|
Cancelled = (BaseError + 111),
|
||||||
WSAEREFUSED = (WSABASEERR + 112),
|
Refused = (BaseError + 112),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Error return codes from gethostbyname() and gethostbyaddr()
|
* Error return codes from gethostbyname() and gethostbyaddr()
|
||||||
|
@ -90,42 +90,42 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Authoritative Answer: Host not found */
|
/* Authoritative Answer: Host not found */
|
||||||
WSAHOST_NOT_FOUND = (WSABASEERR + 1001),
|
HostNotFound = (BaseError + 1001),
|
||||||
|
|
||||||
/* Non-Authoritative: Host not found, or SERVERFAIL */
|
/* Non-Authoritative: Host not found, or SERVERFAIL */
|
||||||
WSATRY_AGAIN = (WSABASEERR + 1002),
|
TryAgain = (BaseError + 1002),
|
||||||
|
|
||||||
/* Non-recoverable errors, FORMERR, REFUSED, NOTIMP */
|
/* Non-recoverable errors, FORMERR, REFUSED, NOTIMP */
|
||||||
WSANO_RECOVERY = (WSABASEERR + 1003),
|
NoRecovery = (BaseError + 1003),
|
||||||
|
|
||||||
/* Valid name, no data record of requested type */
|
/* Valid name, no data record of requested type */
|
||||||
WSANO_DATA = (WSABASEERR + 1004),
|
NoData = (BaseError + 1004),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Define QOS related error return codes
|
* Define QOS related error return codes
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
WSA_QOS_RECEIVERS = (WSABASEERR + 1005),
|
QosReceivers = (BaseError + 1005),
|
||||||
/* at least one Reserve has arrived */
|
/* at least one Reserve has arrived */
|
||||||
WSA_QOS_SENDERS = (WSABASEERR + 1006),
|
QosSenders = (BaseError + 1006),
|
||||||
/* at least one Path has arrived */
|
/* at least one Path has arrived */
|
||||||
WSA_QOS_NO_SENDERS = (WSABASEERR + 1007),
|
QosNoSenders = (BaseError + 1007),
|
||||||
/* there are no senders */
|
/* there are no senders */
|
||||||
WSA_QOS_NO_RECEIVERS = (WSABASEERR + 1008),
|
QosNoReceivers = (BaseError + 1008),
|
||||||
/* there are no receivers */
|
/* there are no receivers */
|
||||||
WSA_QOS_REQUEST_CONFIRMED = (WSABASEERR + 1009),
|
QosRequestConfirmed = (BaseError + 1009),
|
||||||
/* Reserve has been confirmed */
|
/* Reserve has been confirmed */
|
||||||
WSA_QOS_ADMISSION_FAILURE = (WSABASEERR + 1010),
|
QosAdmissionFailure = (BaseError + 1010),
|
||||||
/* error due to lack of resources */
|
/* error due to lack of resources */
|
||||||
WSA_QOS_POLICY_FAILURE = (WSABASEERR + 1011),
|
QosPolicyFailure = (BaseError + 1011),
|
||||||
/* rejected for administrative reasons - bad credentials */
|
/* rejected for administrative reasons - bad credentials */
|
||||||
WSA_QOS_BAD_STYLE = (WSABASEERR + 1012),
|
QosBadStyle = (BaseError + 1012),
|
||||||
/* unknown or conflicting style */
|
/* unknown or conflicting style */
|
||||||
WSA_QOS_BAD_OBJECT = (WSABASEERR + 1013),
|
QosBadObject = (BaseError + 1013),
|
||||||
/* problem with some part of the filterspec or providerspecific
|
/* problem with some part of the filterspec or providerspecific
|
||||||
* buffer in general */
|
* buffer in general */
|
||||||
WSA_QOS_TRAFFIC_CTRL_ERROR = (WSABASEERR + 1014),
|
QosTrafficCtrlError = (BaseError + 1014),
|
||||||
/* problem with some part of the flowspec */
|
/* problem with some part of the flowspec */
|
||||||
WSA_QOS_GENERIC_ERROR = (WSABASEERR + 1015),
|
QosGenericError = (BaseError + 1015),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue