Cygwin: Introduce new LTTNG_UST_STREAM_PIPE command to open wakeup pipe
authorChristian Babeux <christian.babeux@efficios.com>
Mon, 3 Dec 2012 01:41:43 +0000 (20:41 -0500)
committerChristian Babeux <christian.babeux@efficios.com>
Fri, 7 Dec 2012 20:17:55 +0000 (15:17 -0500)
commit840a73344734b584f7033a2b76628b28c2fa57bf
treee0e5278ad8b2fe03d82eb60f8a445d4227647c96
parent6684bfa4a76f566ff024d4f2159f59f2e783d8c2
Cygwin: Introduce new LTTNG_UST_STREAM_PIPE command to open wakeup pipe

Normally, the userspace tracer open the wakeup pipe, and the resulting
fd is passed to the consumer via the session daemon. Since we can't pass
fds via UNIX socket, the pipe need to be opened separately in the tracer
and in the consumer. The only way to open the write side of a named pipe
*before* the read side without blocking is to open it in read/write mode.
This is supported on Linux, but POSIX leave this behavior undefined [1].

The Cygwin named pipe implementation doesn't seem to allow multiple
readers/writers on a named pipe. Opening a pipe in RW mode in the tracer
and then opening the read side in the consumer won't work because the
consumer will get a "Device or ressource busy" error. Thus arise the need
to open the named pipe read side *before* the write side.

In order to accomplish this task, a new command must be introduced to signal
to the tracer that a specific named pipe should be opened in write mode.

Proper care must be taken to issue this command *after* the named pipe paths
have been sent to the consumer or else the sessiond or tracer will block
indefinitely.

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
src/bin/lttng-sessiond/lttng-ust-abi.h
src/bin/lttng-sessiond/lttng-ust-ctl.h
src/bin/lttng-sessiond/ust-app.c
This page took 0.025147 seconds and 4 git commands to generate.