The NetBSD kernel's futex implementation is not a public interface at the moment -- not recommended to use it until it is actually exposed as a libc stub with a type declaration that will catch mistakes.
But if you really do want to use the syscall via the untyped syscall(SYS___futex) entry, it has to use the actual NetBSD struct timespec which is
struct timespec {
time_t tv_sec; /* seconds */
long tv_nsec; /* and nanoseconds */
};
In particular, tv_sec is time_t, not long. long may be 32-bit or 64-bit depending on platform, but time_t is always 64-bit.
The struct FutexTimespec used here won't work on LP32 platforms:
The NetBSD kernel's futex implementation is not a public interface at the moment -- not recommended to use it until it is actually exposed as a libc stub with a type declaration that will catch mistakes.
But if you really do want to use the syscall via the untyped syscall(SYS___futex) entry, it has to use the actual NetBSD
struct timespec
which isIn particular, tv_sec is time_t, not long. long may be 32-bit or 64-bit depending on platform, but time_t is always 64-bit.
The
struct FutexTimespec
used here won't work on LP32 platforms:https://github.com/actboy168/bee.lua/blob/edd93ca5f2436a9cda3e288a5e6abcfdebaaf82f/bee/thread/atomic_sync.cpp#L42-L45