mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 00:03:58 +01:00
Disk (Linux): replace statx(2) call to syscall(2)
This commit is contained in:
@@ -10,6 +10,10 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/statvfs.h>
|
||||
|
||||
#ifdef STATX_BTIME
|
||||
#include <sys/syscall.h>
|
||||
#endif
|
||||
|
||||
#ifdef __USE_LARGEFILE64
|
||||
#define stat stat64
|
||||
#define statvfs statvfs64
|
||||
@@ -263,9 +267,9 @@ static void detectStats(FFDisk* disk)
|
||||
}
|
||||
|
||||
disk->createTime = 0;
|
||||
#ifdef FF_HAVE_STATX
|
||||
#ifdef SYS_statx
|
||||
struct statx stx;
|
||||
if (statx(0, disk->mountpoint.chars, 0, STATX_BTIME, &stx) == 0 && (stx.stx_mask & STATX_BTIME))
|
||||
if (syscall(SYS_statx, 0, disk->mountpoint.chars, 0, STATX_BTIME, &stx) == 0 && (stx.stx_mask & STATX_BTIME))
|
||||
disk->createTime = (uint64_t)((stx.stx_btime.tv_sec * 1000) + (stx.stx_btime.tv_nsec / 1000000));
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user