mirror of
https://github.com/hufrea/byedpi.git
synced 2024-12-22 14:25:44 +00:00
Remove flag from memfd_create, remove replacement with tmpfile
This commit is contained in:
parent
e203aacc2c
commit
e02921db22
8
desync.c
8
desync.c
@ -17,14 +17,8 @@
|
|||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <sys/sendfile.h>
|
#include <sys/sendfile.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
||||||
|
|
||||||
#ifdef MFD_CLOEXEC
|
|
||||||
#include <sys/syscall.h>
|
#include <sys/syscall.h>
|
||||||
#define memfd_create(name, flags) syscall(__NR_memfd_create, name, flags);
|
#define memfd_create(name, flags) syscall(__NR_memfd_create, name, flags);
|
||||||
#else
|
|
||||||
#define memfd_create(name, flags) fileno(tmpfile())
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
@ -141,7 +135,7 @@ ssize_t send_fake(int sfd, char *buffer,
|
|||||||
}
|
}
|
||||||
size_t psz = pkt.size;
|
size_t psz = pkt.size;
|
||||||
|
|
||||||
int ffd = memfd_create("name", O_RDWR);
|
int ffd = memfd_create("name", 0);
|
||||||
if (ffd < 0) {
|
if (ffd < 0) {
|
||||||
uniperror("memfd_create");
|
uniperror("memfd_create");
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user