mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-18 09:04:23 -04:00
strat: add windows socket api, linux/macos TODO
This commit is contained in:
parent
1bef1b58d4
commit
c0d5140ef0
17 changed files with 2258 additions and 28 deletions
|
@ -505,6 +505,28 @@ namespace ams::socket::impl {
|
|||
return result;
|
||||
}
|
||||
|
||||
s32 Connect(s32 desc, const SockAddr *address, SockLenT len) {
|
||||
/* Check pre-conditions. */
|
||||
AMS_ABORT_UNLESS(IsInitialized());
|
||||
|
||||
/* Check input. */
|
||||
if (address == nullptr || len == 0) {
|
||||
socket::impl::SetLastError(Errno::EInval);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Perform the call. */
|
||||
Errno error = Errno::ESuccess;
|
||||
int result = ::bsdConnect(desc, ConvertForLibnx(address), len);
|
||||
TranslateResultToBsdError(error, result);
|
||||
|
||||
if (result < 0) {
|
||||
socket::impl::SetLastError(error);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
s32 GetSockName(s32 desc, SockAddr *out_address, SockLenT *out_addr_len) {
|
||||
/* Check pre-conditions. */
|
||||
AMS_ABORT_UNLESS(IsInitialized());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue