-
Notifications
You must be signed in to change notification settings - Fork 29
add btime for linux #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
times_linux.go
Outdated
func Stat(name string) (Timespec, error) { | ||
var statx unix.Statx_t | ||
|
||
err := unix.Statx(unix.AT_FDCWD, name, unix.AT_EMPTY_PATH|unix.AT_STATX_SYNC_AS_STAT, unix.STATX_ATIME|unix.STATX_MTIME|unix.STATX_CTIME|unix.STATX_BTIME, &statx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at AT_EMPTY_PATH does this mimic the behavior of the Stat command by default? Just curious.
I replaced the Fd() with SyscallConn(), because the Fd() sets the fd to blocking mode, but It increases the allocation count.
After:
|
I came here via the mentioned Navidrome PR. Thank you for maintaining this library and thank you for this PR. 👍🏽 How are chances to see a merge of this PR? :) |
@gildesmarais Merged, I'll do some testing and maybe some minor refactoring before marking it as a release. |
Cool - will that be v1.6.0? |
It should be, it still needs testing with Linux with btime available I believe to verify it works. I haven't had a chance to try it yet. |
I verified that I did get btime in a linux codespace :) |
It adds btime support for linux using statx syscall.