Skip to content

Commit

Permalink
STATX_BTIME return statx buffer mask convert to boolean explicitly, a…
Browse files Browse the repository at this point in the history
…nd add comment to explain why get STATX_BTIME bit
  • Loading branch information
sendaoYan committed Sep 7, 2024
1 parent be64c32 commit 1ca8dd0
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ EXPORT bool linuxIsCreationTimeSupported(char* file) {
if (ret != 0) {
return false;
}
if (stx.stx_mask & STATX_BTIME)
// On some systems where statx is available but birth time might still not
// be supported as it's file system specific. The only reliable way to
// check for supported or not is looking at the filled in STATX_BTIME bit
// in the returned statx buffer mask.
if ((stx.stx_mask & STATX_BTIME) != 0)
return true;
return false;
#else
Expand Down

0 comments on commit 1ca8dd0

Please sign in to comment.