glocalfileinfo: Add statx() support

This currently just implements the same functionality as the existing
`stat()`/`fstat()`/`fstatat()`/`lstat()` calls, although where a reduced
field set is requested it may return faster.

Helps: #1970
This commit is contained in:
Andre Miranda
2020-08-14 16:04:37 +01:00
committed by Philip Withnall
parent 622806d5cf
commit 60eefd4de9
4 changed files with 151 additions and 0 deletions

View File

@@ -99,12 +99,17 @@ test_validity (void)
thumbnail_path = g_test_get_filename (G_TEST_DIST, "thumbnails",
tests[i].filename, NULL);
file_uri = g_strconcat ("file:///tmp/", tests[i].filename, NULL);
#ifdef HAVE_STATX
stat_buf.stx_mtime.tv_sec = tests[i].mtime;
stat_buf.stx_size = tests[i].size;
#else
#ifdef G_OS_WIN32
stat_buf.st_mtim.tv_sec = tests[i].mtime;
#else
stat_buf.st_mtime = tests[i].mtime;
#endif
stat_buf.st_size = tests[i].size;
#endif
result = thumbnail_verify (thumbnail_path, file_uri, &stat_buf);