X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fust-fd.h;fp=src%2Fcommon%2Fust-fd.h;h=ddebaa91affed11018a8a7dba95da981364021f6;hb=9d315d6d74aac2986b10d708c864d152a0febec7;hp=0000000000000000000000000000000000000000;hpb=74e79a0da99992c182da26abf45447722eaa400d;p=lttng-ust.git diff --git a/src/common/ust-fd.h b/src/common/ust-fd.h new file mode 100644 index 00000000..ddebaa91 --- /dev/null +++ b/src/common/ust-fd.h @@ -0,0 +1,28 @@ +/* + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (C) 2016 Mathieu Desnoyers + */ + +#ifndef _LTTNG_UST_FD_H +#define _LTTNG_UST_FD_H + +/* + * The fd tracker feature is part of the ABI and used by liblttng-ust-fd. + * However, some test code and documentation needs to be written before it is + * exposed to users with a public header. + */ + +#include + +void lttng_ust_init_fd_tracker(void); +int lttng_ust_add_fd_to_tracker(int fd); +void lttng_ust_delete_fd_from_tracker(int fd); +void lttng_ust_lock_fd_tracker(void); +void lttng_ust_unlock_fd_tracker(void); + +int lttng_ust_safe_close_fd(int fd, int (*close_cb)(int)); +int lttng_ust_safe_fclose_stream(FILE *stream, int (*fclose_cb)(FILE *stream)); +int lttng_ust_safe_closefrom_fd(int lowfd, int (*close_cb)(int)); + +#endif /* _LTTNG_UST_FD_H */