| 1 | /* |
| 2 | * SPDX-License-Identifier: LGPL-2.1-only |
| 3 | * |
| 4 | * Copyright (C) 2016 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
| 5 | */ |
| 6 | |
| 7 | #ifndef _LTTNG_UST_FD_H |
| 8 | #define _LTTNG_UST_FD_H |
| 9 | |
| 10 | /* |
| 11 | * The fd tracker feature is part of the ABI and used by liblttng-ust-fd. |
| 12 | * However, some test code and documentation needs to be written before it is |
| 13 | * exposed to users with a public header. |
| 14 | * |
| 15 | * These symbols are provided by 'liblttng-ust-common'. |
| 16 | */ |
| 17 | |
| 18 | #include <stdio.h> |
| 19 | |
| 20 | int lttng_ust_add_fd_to_tracker(int fd); |
| 21 | void lttng_ust_delete_fd_from_tracker(int fd); |
| 22 | void lttng_ust_lock_fd_tracker(void); |
| 23 | void lttng_ust_unlock_fd_tracker(void); |
| 24 | |
| 25 | int lttng_ust_safe_close_fd(int fd, int (*close_cb)(int)); |
| 26 | int lttng_ust_safe_fclose_stream(FILE *stream, int (*fclose_cb)(FILE *stream)); |
| 27 | int lttng_ust_safe_closefrom_fd(int lowfd, int (*close_cb)(int)); |
| 28 | int lttng_ust_safe_close_range_fd(unsigned int first, unsigned int last, int flags, |
| 29 | int (*close_range_cb)(unsigned int, unsigned int, int)); |
| 30 | |
| 31 | #endif /* _LTTNG_UST_FD_H */ |