move cpu affinity code to g3-compat

This commit is contained in:
Zhang Jingqiang 2023-05-28 21:01:18 +08:00 committed by Zhang Jingqiang Working
parent 13b6aa346a
commit 3e84294b0c
13 changed files with 136 additions and 30 deletions

View file

@ -0,0 +1,21 @@
#include <stdlib.h>
#ifdef __GLIBC__
#if !__GLIBC_PREREQ(2, 27)
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
extern int memfd_create(const char *name, unsigned int flags);
int memfd_create(const char* name, unsigned int flags)
{
return syscall(SYS_memfd_create, name, flags);
}
#endif
#endif