[lttng-dev] [PATCH 1/2] Do not call posix_fallocate() on uClibc

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Tue May 28 09:50:00 EDT 2013


* Thomas Petazzoni (thomas.petazzoni at free-electrons.com) wrote:
> uClibc does not implement posix_fallocate(), and posix_fallocate() is
> mostly only an hint to the kernel that we will need such or such
> amount of space inside a file. So we just don't call posix_fallocate()
> when building against uClibc.

please implement separately in a wrapper header, within a compat or
wrapper directory.

Thanks,

Mathieu

> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
> ---
>  formats/ctf/ctf.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c
> index bb94e52..77aef28 100644
> --- a/formats/ctf/ctf.c
> +++ b/formats/ctf/ctf.c
> @@ -43,6 +43,7 @@
>  #include <sys/stat.h>
>  #include <fcntl.h>
>  #include <dirent.h>
> +#include <features.h>
>  #include <glib.h>
>  #include <unistd.h>
>  #include <stdlib.h>
> @@ -723,9 +724,11 @@ void ctf_packet_seek(struct bt_stream_pos *stream_pos, size_t index, int whence)
>  		}
>  		pos->content_size = -1U;	/* Unknown at this point */
>  		pos->packet_size = WRITE_PACKET_LEN;
> +#ifndef __UCLIBC__
>  		off = posix_fallocate(pos->fd, pos->mmap_offset,
>  				      pos->packet_size / CHAR_BIT);
>  		assert(off >= 0);
> +#endif
>  		pos->offset = 0;
>  	} else {
>  	read_next_packet:
> -- 
> 1.7.9.5
> 
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list