X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcommon%2Ffs-handle-internal.h;fp=src%2Fcommon%2Ffs-handle-internal.h;h=0fe3f8c63398c8a22e76929fc32945bcc262acbe;hb=f5ea02416c656bba136e742788f2d5ae12b98278;hp=0000000000000000000000000000000000000000;hpb=b13a2b17db29cbc8808e8bb149de1692b94729d3;p=lttng-tools.git diff --git a/src/common/fs-handle-internal.h b/src/common/fs-handle-internal.h new file mode 100644 index 000000000..0fe3f8c63 --- /dev/null +++ b/src/common/fs-handle-internal.h @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2020 - Jérémie Galarneau + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation; version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef FS_HANDLE_INTERNAL_H +#define FS_HANDLE_INTERNAL_H + +struct fs_handle; + +/* + * Multiple internal APIs return fs_handles. For the moment, this internal + * interface allows the use of different fs_handle implementations in different + * daemons. For instance, the trace chunk interface returns fs_handles that + * behave diffently depending on whether or not the trace chunk was configured + * to use an fd-tracker. + */ + +typedef int (*fs_handle_get_fd_cb)(struct fs_handle *); +typedef void (*fs_handle_put_fd_cb)(struct fs_handle *); +typedef int (*fs_handle_unlink_cb)(struct fs_handle *); +typedef int (*fs_handle_close_cb)(struct fs_handle *); + +struct fs_handle { + fs_handle_get_fd_cb get_fd; + fs_handle_put_fd_cb put_fd; + fs_handle_unlink_cb unlink; + fs_handle_close_cb close; +}; + +#endif /* FS_HANDLE_INTERNAL_H */