Programming => Operating Systems => Linux => Topic started by: mai on October 21, 2017, 01:52:22 pm

Title: new kernel function fstatx() in Kern 4.11
Post by: mai on October 21, 2017, 01:52:22 pm
dudes... the kernel dudes added an enhanced fstat() , named fstatx() in 4.11   :-X

there is a C sample with kernl src and example 28  demos fstat() in Pascal.

I was trying out stuff and thought about making a GUI for the new function which - however - may not be supported on all file systems yet. Sooner or later FP will have to offer fstatx() in the RTL of course. Seems not to be that much sweat though, I'd say.  8-)

what u think ?   8)

both C & Pascal src are easy to use , they beg to make a lil GUI showing the new ULTRA HI RES timestamps and the new mode bits !

sample test-stax.c does not build: ( ( (
Title: Re: new kernel function fstatx() in Kern 4.11
Post by: marcov on October 21, 2017, 02:20:51 pm
Sounds to me as a Linux specific, special purpose call, though I don't really understand why they did this. Specially the stx_ prefix of fields seems to indicate that this really isn't meant as a compatible stat.

You can call syscalls over the syscall unit, but what do you really need that compatible cross-unix stat/baseunix.fpstat doesn't give?

To me this reeks of the horrors of stat32/stat64 that needed linux specific ifdefs for a decade.

The only thing one commonly would need is higher resolution timestamps, but applying this to the compatible (fp)(f)stat has been delayed, see point 8 here:

All the other features seem to be for  specific cases like network daemons (nfsd,smbd), and management tools of newer FS.

But maybe it is logical to first test the waters with an extra call, and only later go through the massive undertaking of updating the portable call.
Title: Re: new kernel function fstatx() in Kern 4.11
Post by: mai on November 07, 2017, 04:18:44 pm
use statx in bash: (

$ xstat  xstat

  File: xstat
  Size: 4984            Blocks: 16         IO Block: 4096   regular file
Device: 804h/2052d      Inode: 21093276    Links: 1
Access: (0755/-rwxr-xr-x)  Uid: ( 1000/      abc)   Gid: ( 1001/      abc)
Access: 2017-11-20 18:27:26.592431702 +0100
Modify: 2017-11-20 18:27:26.592431702 +0100
Change: 2017-11-20 18:29:19.859787498 +0100
 Birth: 1970-01-01 01:00:00.000000000 +0100

"Birth" is kinda incorrect since though kernl 4.14. is in use, old functions were used to create the file.
TinyPortal © 2005-2018