src/core/hle/service/sockets/sfdnsres.cpp: In function 'Service::Sockets::NetDbError Service::Sockets::AddrInfoErrorToNetDbError(s32)':
src/core/hle/service/sockets/sfdnsres.cpp:66:10: error: 'EAI_NODATA' was not declared in this scope; did you mean 'EAI_NONAME'?
66 | case EAI_NODATA:
| ^~~~~~~~~~
| EAI_NONAME
src/core/hle/service/sockets/sfdnsres.cpp: In function 'std::vector<unsigned char> Service::Sockets::SerializeAddrInfo(const addrinfo*, s32, std::string_view)':
src/core/hle/service/sockets/sfdnsres.cpp:127:53: error: 'sockaddr_in' does not name a type; did you mean 'SockAddrIn'?
127 | const auto addr = *reinterpret_cast<sockaddr_in*>(current->ai_addr);
| ^~~~~~~~~~~
| SockAddrIn
src/core/hle/service/sockets/sfdnsres.cpp:127:64: error: expected '>' before '*' token
127 | const auto addr = *reinterpret_cast<sockaddr_in*>(current->ai_addr);
| ^
src/core/hle/service/sockets/sfdnsres.cpp:127:64: error: expected '(' before '*' token
127 | const auto addr = *reinterpret_cast<sockaddr_in*>(current->ai_addr);
| ^
| (
src/core/hle/service/sockets/sfdnsres.cpp:127:65: error: expected primary-expression before '>' token
127 | const auto addr = *reinterpret_cast<sockaddr_in*>(current->ai_addr);
| ^
src/core/hle/service/sockets/sfdnsres.cpp:127:84: error: expected ')' before ';' token
127 | const auto addr = *reinterpret_cast<sockaddr_in*>(current->ai_addr);
| ^
| )
src/core/hle/service/sockets/sfdnsres.cpp:148:53: error: 'sockaddr_in6' does not name a type; did you mean 'SockAddrIn6'?
148 | const auto addr = *reinterpret_cast<sockaddr_in6*>(current->ai_addr);
| ^~~~~~~~~~~~
| SockAddrIn6
src/core/hle/service/sockets/sfdnsres.cpp:148:65: error: expected '>' before '*' token
148 | const auto addr = *reinterpret_cast<sockaddr_in6*>(current->ai_addr);
| ^
src/core/hle/service/sockets/sfdnsres.cpp:148:65: error: expected '(' before '*' token
148 | const auto addr = *reinterpret_cast<sockaddr_in6*>(current->ai_addr);
| ^
| (
src/core/hle/service/sockets/sfdnsres.cpp:148:66: error: expected primary-expression before '>' token
148 | const auto addr = *reinterpret_cast<sockaddr_in6*>(current->ai_addr);
| ^
src/core/hle/service/sockets/sfdnsres.cpp:148:85: error: expected ')' before ';' token
148 | const auto addr = *reinterpret_cast<sockaddr_in6*>(current->ai_addr);
| ^
| )
`return distribution(gen)` is a data race between a read and a write in
two threads, reported by TSan. Remove static random number generators so
they aren't using the same generator.
TSan reported a race between thread 36 and thread 34, a read at :225 and
a write at :225 respectively. Make total_proces_running_time_ticks
atomic to avoid this race.
TSan reports a race between the main thread and T37 during
IsLockedByCurrentThread and when it's set at the end of Lock(),
respectively. Set owner_thread to an atomic pointer to fix it.
Co-authored-by: bunnei <bunneidev@gmail.com>