The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / lttng-babeltrace / 0001-no-posix-fallocate-in-uclibc.patch
1 Do not call posix_fallocate() on uClibc
2
3 uClibc does not implement posix_fallocate(), and posix_fallocate() is
4 mostly only an hint to the kernel that we will need such or such
5 amount of space inside a file. So we just don't call posix_fallocate()
6 when building against uClibc.
7
8 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
9 [Peter: add #include <features.h>
10 ---
11  formats/ctf/ctf.c |    3 +++
12  1 file changed, 3 insertions(+)
13
14 Index: lttng-babeltrace-0.8/formats/ctf/ctf.c
15 ===================================================================
16 --- lttng-babeltrace-0.8.orig/formats/ctf/ctf.c
17 +++ lttng-babeltrace-0.8/formats/ctf/ctf.c
18 @@ -32,6 +32,7 @@
19  #include <sys/stat.h>
20  #include <fcntl.h>
21  #include <dirent.h>
22 +#include <features.h>
23  #include <glib.h>
24  #include <unistd.h>
25  #include <stdlib.h>
26 @@ -384,9 +385,11 @@
27                 }
28                 pos->content_size = -1U;        /* Unknown at this point */
29                 pos->packet_size = WRITE_PACKET_LEN;
30 +#ifndef __UCLIBC__
31                 off = posix_fallocate(pos->fd, pos->mmap_offset,
32                                       pos->packet_size / CHAR_BIT);
33                 assert(off >= 0);
34 +#endif
35                 pos->offset = 0;
36         } else {
37         read_next_packet: