sunfishcode / mustang

Rust programs written entirely in Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

incompatible pointee types in c-scape signatures

nivkner opened this issue · comments

as mentioned in #94, the following types and their libc counterparts do not match in layout in some architectures, and so should not used as is in pointers passed by the caller:

  • rustix::fs::Stat: mismatch with libc::stat in i686
  • SocketAddrStorage: mismatch with libc::sockaddr in i686
  • PthreadAttrT: mismatch with libc::pthread_attr_t in aarch64
  • PthreadMutexT: mismatch with libc::pthread_mutex_t in aarch64
  • PthreadMutexattrT: mismatch with libc::pthread_mutexattr_t in aarch64

#120 fixes the pthread and sockaddr issues. That still leaves timespec/timeval and stat/stat64 on 32-bit platforms.

And the stat types were fixed in #104.