aboutsummaryrefslogtreecommitdiff
path: root/net/beanstalkd/patches/902-replace-posix_fallocate.patch
blob: 3371ff438aa61d768ebbc9177a6786f2d7bdfc46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
--- a/linux.c
+++ b/linux.c
@@ -1,4 +1,6 @@
 #define _XOPEN_SOURCE 600
+#include <unistd.h>
+#include <sys/types.h>
 #include <stdint.h>
 #include <fcntl.h>
 #include <stdlib.h>
@@ -19,7 +21,7 @@ static int epfd;
 int
 rawfalloc(int fd, int len)
 {
-    return posix_fallocate(fd, 0, len);
+    return ftruncate(fd, len);
 }