0
0
mirror of https://github.com/hufrea/byedpi.git synced 2025-07-01 02:53:03 +00:00

Don't enable fake support for NetBSD

This commit is contained in:
dartvader316 2024-08-17 15:38:28 +03:00
parent 0cb8abc889
commit 07ebe38bf6
2 changed files with 1 additions and 21 deletions

View File

@ -203,26 +203,6 @@ ssize_t send_fake(int sfd, char *buffer,
uniperror("sendfile");
break;
}
#else
// https://mail-index.netbsd.org/tech-kern/2008/11/25/msg003672.html
#warning "no sendfile"
#ifdef __linux__
#define MAP_FILE 0
#endif
void *p2 = mmap(NULL, pos, PROT_READ | PROT_WRITE, MAP_FILE | MAP_SHARED, ffd, 0);
if (p2 == MAP_FAILED) {
uniperror("mmap ffd");
break;
}
len = send(sfd, p2, pos, 0);
if (len < 0) {
uniperror("send sfd");
break;
}
if (munmap(p2, pos) == -1) {
uniperror("munmap");
break;
}
#endif
wait_send(sfd);
memcpy(p, buffer, pos);

View File

@ -15,7 +15,7 @@
#include <sys/socket.h>
#endif
#if defined(__linux__) || defined(__NetBSD__) || defined(_WIN32)
#if defined(__linux__) || defined(_WIN32)
#define FAKE_SUPPORT 1
#define TIMEOUT_SUPPORT 1
#endif