#include "mountpoint-util.h"
#include "parse-util.h"
#include "path-util.h"
+#include "stat-util.h"
#include "stdio-util.h"
#include "strv.h"
_cleanup_free_ struct file_handle *h = NULL, *h_parent = NULL;
int mount_id = -1, mount_id_parent = -1;
bool nosupp = false, check_st_dev = true;
+ STRUCT_STATX_DEFINE(sx);
struct stat a, b;
- struct statx sx
-#if HAS_FEATURE_MEMORY_SANITIZER
- = {}
-# warning "Explicitly initializing struct statx, to work around msan limitation. Please remove as soon as msan has been updated to not require this."
-#endif
- ;
int r;
assert(fd >= 0);
}
int path_get_mnt_id(const char *path, int *ret) {
- union {
- struct statx sx;
- struct new_statx nsx;
- } buf
-#if HAS_FEATURE_MEMORY_SANITIZER
- = {}
-# warning "Explicitly initializing struct statx, to work around msan limitation. Please remove as soon as msan has been updated to not require this."
-#endif
- ;
+ STRUCT_NEW_STATX_DEFINE(buf);
int r;
if (statx(AT_FDCWD, path, AT_SYMLINK_NOFOLLOW|AT_NO_AUTOMOUNT, STATX_MNT_ID, &buf.sx) < 0) {
int proc_mounted(void);
bool stat_inode_unmodified(const struct stat *a, const struct stat *b);
+
+#if HAS_FEATURE_MEMORY_SANITIZER
+# warning "Explicitly initializing struct statx, to work around msan limitation. Please remove as soon as msan has been updated to not require this."
+# define STRUCT_STATX_DEFINE(var) \
+ struct statx var = {}
+# define STRUCT_NEW_STATX_DEFINE(var) \
+ union { \
+ struct statx sx; \
+ struct new_statx nsx; \
+ } var = {}
+#else
+# define STRUCT_STATX_DEFINE(var) \
+ struct statx var
+# define STRUCT_NEW_STATX_DEFINE(var) \
+ union { \
+ struct statx sx; \
+ struct new_statx nsx; \
+ } var
+#endif
#include "macro.h"
#include "missing_syscall.h"
#include "sparse-endian.h"
+#include "stat-util.h"
#include "stdio-util.h"
#include "string-util.h"
#include "time-util.h"
}
int fd_getcrtime_at(int dirfd, const char *name, usec_t *ret, int flags) {
- struct_statx sx
-#if HAS_FEATURE_MEMORY_SANITIZER
- = {}
-# warning "Explicitly initializing struct statx, to work around msan limitation. Please remove as soon as msan has been updated to not require this."
-#endif
- ;
+ STRUCT_STATX_DEFINE(sx);
usec_t a, b;
le64_t le;
size_t n;
* file systems such as overlayfs better where each file is originating from a
* different st_dev. */
- struct statx sx
-#if HAS_FEATURE_MEMORY_SANITIZER
- = {}
-# warning "Explicitly initializing struct statx, to work around msan limitation. Please remove as soon as msan has been updated to not require this."
-#endif
- ;
+ STRUCT_STATX_DEFINE(sx);
if (statx(dirfd(d), dent->d_name,
AT_SYMLINK_NOFOLLOW|AT_NO_AUTOMOUNT,
_cleanup_closedir_ DIR *d = NULL;
uint32_t dev_major, dev_minor;
nsec_t atime_nsec, mtime_nsec;
+ STRUCT_STATX_DEFINE(sx);
int mountpoint = -1;
usec_t cutoff, n;
uint64_t ino;
- struct statx sx
-#if HAS_FEATURE_MEMORY_SANITIZER
- = {}
-# warning "Explicitly initializing struct statx, to work around msan limitation. Please remove as soon as msan has been updated to not require this."
-#endif
- ;
-
assert(i);
if (!i->age_set)