diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2017-07-02 14:57:21 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2017-08-08 21:48:20 +0000 |
commit | d3393ce25833c0afd7f0fa6b85fd6f3bd7ad520a (patch) | |
tree | c8dc63ecc5dfe4784c7327000be0b3c6e8127a26 /src/corelib/io/qfilesystemmetadata_p.h | |
parent | 874837b4cc76b79a9b0f54f5c221c95d2a309c9d (diff) |
Add support for statx(2) on Linux
This system call, new in Linux 4.11, gives us the file birth time. It's
also extensible, representing the fourth generation of stat(2) on Linux
(the original sys_stat(), sys_newstat(), sys_stat64() and now
sys_statx()), not to be confused with glibc's __xstat function, which
wraps a call to stat64. Anyway, the new one is designed to be extensible.
Now we get birth times on ext[34] on Linux too:
Name: .
Path: . (/home/tjmaciei/src/qt)
Size: 4096 Type: Directory
Attrs: readable writable executable hidden nativepath
Mode: drwxr-xr-x
Owner: tjmaciei (1000) Group: users (100)
Access: 2017-07-02T14:47:49.608
Birth: 2016-05-02T13:20:33.097
Change: 2017-07-01T13:37:08.737
Modified: 2017-07-01T13:37:08.737
It's not supported in any other filesystems I have (Linux sources show
xfs has the feature too). Even on ext4, it depends on whether the
filesystem was created with 256-byte inodes, which my /boot fs wasn't.
Change-Id: I8d96dea9955d4c749b99fffd14cda23ed60d5e72
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/corelib/io/qfilesystemmetadata_p.h')
-rw-r--r-- | src/corelib/io/qfilesystemmetadata_p.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/corelib/io/qfilesystemmetadata_p.h b/src/corelib/io/qfilesystemmetadata_p.h index c4e1312c1d..55e44d52c7 100644 --- a/src/corelib/io/qfilesystemmetadata_p.h +++ b/src/corelib/io/qfilesystemmetadata_p.h @@ -220,6 +220,7 @@ public: uint ownerId(QAbstractFileEngine::FileOwner owner) const; #ifdef Q_OS_UNIX + void fillFromStatxBuf(const struct statx &statBuffer); void fillFromStatBuf(const QT_STATBUF &statBuffer); void fillFromDirEnt(const QT_DIRENT &statBuffer); #endif |