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)
commit6548fca464f68be5ded73be6b9a479daf08e62d6
treec2b29afaba47c2819839d62318b0ec23e13edd22
parent451d66b27efb332bd16f79dcee374b6a2c85186f
Introduce file descriptor tracker

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>
include/Makefile.am
include/lttng/ust-events.h
include/ust-fd.h [new file with mode: 0644]
liblttng-ust-comm/Makefile.am
liblttng-ust-comm/lttng-ust-comm.c
liblttng-ust-comm/lttng-ust-fd-tracker.c [new file with mode: 0644]
liblttng-ust/lttng-ust-abi.c
liblttng-ust/lttng-ust-comm.c
libringbuffer/ring_buffer_frontend.c
libringbuffer/shm.c
libringbuffer/shm.h
This page took 0.025502 seconds and 4 git commands to generate.