diff options
author | Bernd Schubert <bernd@bsbernd.com> | 2024-12-28 14:01:04 +0100 |
---|---|---|
committer | Bernd Schubert <bernd@bsbernd.com> | 2024-12-30 23:04:11 +0100 |
commit | b646fa9195ea15efa9303dbe0b39cb542a2cc796 (patch) | |
tree | ea48bf8745519b29c71f9ab06ffc3446321f690b /include | |
parent | 15d924c450eb8346607e5fba24d3b60e842e365b (diff) | |
download | libfuse-b646fa9195ea15efa9303dbe0b39cb542a2cc796.tar.gz |
struct fuse_file_info extension
Add a flags and reserved fields to struct fuse_file_info
and add a static assert on the size.
Also add another static assert for 'struct fuse_conn_info'
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/fuse_common.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/include/fuse_common.h b/include/fuse_common.h index ee3c4e6..1999eaa 100644 --- a/include/fuse_common.h +++ b/include/fuse_common.h @@ -25,10 +25,19 @@ #include "fuse_log.h" #include <stdint.h> #include <sys/types.h> +#include <assert.h> #define FUSE_MAKE_VERSION(maj, min) ((maj) * 100 + (min)) #define FUSE_VERSION FUSE_MAKE_VERSION(FUSE_MAJOR_VERSION, FUSE_MINOR_VERSION) +#if (defined(__cplusplus) && __cplusplus >= 201103L) || \ + (!defined(__cplusplus) && defined(__STDC_VERSION__) && \ + __STDC_VERSION__ >= 201112L) +#define fuse_static_assert(condition, message) static_assert(condition, message) +#else +#define fuse_static_assert(condition, message) +#endif + #ifdef __cplusplus extern "C" { #endif @@ -116,9 +125,14 @@ struct fuse_file_info { * create and open. It is used to create a passthrough connection * between FUSE file and backing file. */ int32_t backing_id; -}; + /** struct fuse_file_info api and abi flags */ + uint64_t compat_flags; + uint64_t reserved[2]; +}; +fuse_static_assert(sizeof(struct fuse_file_info) == 64, + "fuse_file_info size mismatch"); /** * Configuration parameters passed to fuse_session_loop_mt() and @@ -670,6 +684,8 @@ struct fuse_conn_info { */ uint32_t reserved[20]; }; +fuse_static_assert(sizeof(struct fuse_conn_info) == 128, + "Size of struct fuse_conn_info must be 128 bytes"); struct fuse_session; struct fuse_pollhandle; |