Introduce file descriptor tracker
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 13 Sep 2016 20:17:40 +0000 (16:17 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 3 Oct 2016 16:00:32 +0000 (12:00 -0400)
Introduce a tracker for file descriptors used by lttng-ust. It exposes
a new API in an internal header lttng_ust_safe_close_fd(), which is
meant to be used by a LD_PRELOADed library overriding close() and
closefrom() (BSD).

This takes care of bugs caused by applications doing bulk close() or
closefrom() of file descriptors soon after forking.

We need to hold the ust_lock() to protect the fd tracker lock against
fork. Since the fd tracker is needed across connect() (which allocates a
file descriptor), we need to hold the ust_lock across connect().

Fixes: #253
Fixes: #626
Suggested-by: Aravind HT <aravind.ht@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>

No differences found
This page took 0.024992 seconds and 5 git commands to generate.