A statx(2) Linux system Python wrapper
github.com
github.com
Possible self-answer: that wrapper only exists on glibc >= 2.28.
The statx(2) system call was added in Linux 4.11, released on 2017-04-30.
The statx(3) libc wrapper was added in GNU libc 2.28, released on 2018-08-01.
Just write the wrapper as a C extension module, and in the module make the system call with proper library call.
like in the following code:
https://github.com/torvalds/linux/blob/master/samples/vfs/te...
This way it will be portable!
A couple of weeks ago, I just made for our OS's system calls. It's only a first draft, but works fine.
You could also parse the C header for constant values.
(Actually, I wrote a python script to generate the C extension for the system calls also, not just for the constants)
I think it's a bit too early to show this to HN…
Maybe it's just general ignorance of the statx syscall's existence or utility on Linux?
https://man7.org/linux/man-pages/man2/statx.2.html
It's just stat but it accepts a mask for what info you want and returns a couple of extra fields.