Add wrappers for pipe
authorDavid Goulet <dgoulet@efficios.com>
Fri, 10 May 2013 16:02:37 +0000 (12:02 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Fri, 17 May 2013 18:11:26 +0000 (14:11 -0400)
commit9fd926379bd4c6c17f2b3c39a5bbf9879bc74e14
treef78c743cb8afc8dd896f26e6715c42e5f8c16d9b
parentb31398bb2b3fa91a53dea3b36fd693da4b50e0d3
Add wrappers for pipe

This is to help use pipes in a way where partial read/write and EINTR
are handled in one single call site.

Two new files are created, pipe.c/.h which are part of libcommon. The
open, close, read_close, write_close, read and write calls are
implemented using a custom lttng_pipe data structure and protected by
operation's mutex. A destroy function is also available to cleanup
memory once done with a pipe.

The motivation behind this patch is for some upcoming fixes that deals
with a race condition between read and write on a pipe in the consumer.

Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/common/Makefile.am
src/common/pipe.c [new file with mode: 0644]
src/common/pipe.h [new file with mode: 0644]
This page took 0.033292 seconds and 4 git commands to generate.