This commit is contained in:
ruti 2024-08-22 17:53:17 +03:00
parent bd2eb4e4e1
commit 7700791053
2 changed files with 10 additions and 13 deletions

View File

@ -174,13 +174,11 @@ ssize_t send_fake(int sfd, char *buffer,
else pkt.size = 0;
}
#ifdef __linux__
int ffd = memfd_create("name", 0);
if (ffd < 0) {
uniperror("memfd_create");
return -1;
}
#endif
char *p = 0;
ssize_t len = -1;
@ -221,13 +219,12 @@ ssize_t send_fake(int sfd, char *buffer,
uniperror("setsockopt IP_OPTIONS");
break;
}
#ifdef __linux__
len = sendfile(sfd, ffd, 0, pos);
if (len < 0) {
uniperror("sendfile");
break;
}
#endif
wait_send(sfd);
memcpy(p, buffer, pos);