pal_networking.cpp 833 B

12345678910111213141516171819202122232425262728293031323334
  1. #include "il2cpp-config.h"
  2. #include "pal_platform.h"
  3. #if IL2CPP_USES_POSIX_CLASS_LIBRARY_PAL
  4. #if IL2CPP_HAVE_SYS_UN
  5. #include <sys/un.h>
  6. #endif
  7. extern "C"
  8. {
  9. IL2CPP_EXPORT void SystemNative_GetDomainSocketSizes(int32_t* pathOffset, int32_t* pathSize, int32_t* addressSize);
  10. }
  11. void SystemNative_GetDomainSocketSizes(int32_t* pathOffset, int32_t* pathSize, int32_t* addressSize)
  12. {
  13. IL2CPP_ASSERT(pathOffset != NULL);
  14. IL2CPP_ASSERT(pathSize != NULL);
  15. IL2CPP_ASSERT(addressSize != NULL);
  16. #if IL2CPP_HAVE_SYS_UN
  17. struct sockaddr_un domainSocket;
  18. *pathOffset = offsetof(struct sockaddr_un, sun_path);
  19. *pathSize = sizeof(domainSocket.sun_path);
  20. *addressSize = sizeof(domainSocket);
  21. #else
  22. *pathOffset = 0;
  23. *pathSize = 0;
  24. *addressSize = 0;
  25. #endif
  26. }
  27. #endif // IL2CPP_USES_POSIX_CLASS_LIBRARY_PAL