Skip to content
Snippets Groups Projects
Commit 9f405aa4 authored by Florian Fischer's avatar Florian Fischer
Browse files

Merge branch 'fix-glibc-2.35-futex_waitv' into 'master'

do not define futex_waitv if already done in linux/futex.h

See merge request !345
parents 6d2608c9 1d164e81
No related branches found
No related tags found
1 merge request!345do not define futex_waitv if already done in linux/futex.h
Pipeline #77769 passed
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <cerrno> #include <cerrno>
#include "Worker.hpp" #include "Worker.hpp"
#include "emper-config.h"
#ifndef SYS_futex_waitv #ifndef SYS_futex_waitv
#define SYS_futex_waitv 449 #define SYS_futex_waitv 449
...@@ -19,18 +20,21 @@ ...@@ -19,18 +20,21 @@
#define FUTEX_32 2 #define FUTEX_32 2
#endif #endif
#ifdef EMPER_DEFINE_FUTEX_WAITV
struct futex_waitv { struct futex_waitv {
uint64_t val; uint64_t val;
uint64_t uaddr; uint64_t uaddr;
uint32_t flags; uint32_t flags;
uint32_t _reserved; // NOLINTNEXTLINE(bugprone-reserved-identifier)
uint32_t __reserved;
}; };
#endif
static void init_futex_waitv(struct futex_waitv* waiter, uint64_t val, void* uaddr) { static void init_futex_waitv(struct futex_waitv* waiter, uint64_t val, void* uaddr) {
waiter->val = val; waiter->val = val;
waiter->uaddr = reinterpret_cast<uintptr_t>(uaddr); waiter->uaddr = reinterpret_cast<uintptr_t>(uaddr);
waiter->flags = FUTEX_PRIVATE_FLAG | FUTEX_32; waiter->flags = FUTEX_PRIVATE_FLAG | FUTEX_32;
waiter->_reserved = 0; waiter->__reserved = 0;
} }
namespace emper::lib::sync { namespace emper::lib::sync {
......
if not cpp_compiler.has_member('struct futex_waitv', 'val',
prefix: '#include <linux/futex.h>')
conf_data.set('EMPER_DEFINE_FUTEX_WAITV', true)
endif
emper_cpp_sources += files( emper_cpp_sources += files(
'SpuriousFutex2Semaphore.cpp', 'SpuriousFutex2Semaphore.cpp',
) )
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment