Sangeetha Elumalai
2025-Apr-28 12:56 UTC
[klibc] Problem with struct statx in usr/klibc/fstatat.c (klibc-2.0.14)
Hi, I am facing a build error in klibc-2.0.14. In `usr/klibc/fstatat.c`, there is a line: struct statx xbuf; Ref: https://git.kernel.org/pub/scm/libs/klibc/klibc.git/tree/usr/klibc/fstatat.c#n16 But during compilation, I get: ``` usr/klibc/fstatat.c:24:15: error: storage size of 'xbuf' isn't known ``` It looks like `struct statx` is not available: - `struct statx` was added in Linux kernel 4.11. Ref: https://github.com/torvalds/linux/commit/a528d35e8bfcc521d7cb70aaf03e1bd296c8493f#diff-64bab5a0a3fcb55e1a6ad77b1dfab89d2c9c71a770a07ecf44e6b82aae76a03aR102 Since klibc-2.0.14 supports older kernels (2.6.x). My questions are: 1. Does klibc-2.0.14 work with older kernels like 2.6.x, or is it only for newer kernels (4.11+)? 2. If klibc-2.0.14 does support older kernels, should the code in `fstatat.c` be changed to avoid `struct statx` and use something else like `struct stat`? Please let me know if this needs a fix or if there are any version requirements I missed. Thanks, -Sangeetha -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://lists.zytor.com/archives/klibc/attachments/20250428/17fc943b/attachment.htm>
Ben Hutchings
2025-Apr-28 14:08 UTC
[klibc] Problem with struct statx in usr/klibc/fstatat.c (klibc-2.0.14)
On Mon, 2025-04-28 at 18:26 +0530, Sangeetha Elumalai wrote:> Hi, > > I am facing a build error in klibc-2.0.14. > > In `usr/klibc/fstatat.c`, there is a line: > > struct statx xbuf; > > Ref: > https://git.kernel.org/pub/scm/libs/klibc/klibc.git/tree/usr/klibc/fstatat.c#n16 > > But during compilation, I get: > ``` > usr/klibc/fstatat.c:24:15: error: storage size of 'xbuf' isn't known > ``` > > It looks like `struct statx` is not available: > - `struct statx` was added in Linux kernel 4.11. > > Ref: > https://github.com/torvalds/linux/commit/a528d35e8bfcc521d7cb70aaf03e1bd296c8493f#diff-64bab5a0a3fcb55e1a6ad77b1dfab89d2c9c71a770a07ecf44e6b82aae76a03aR102 > > Since klibc-2.0.14 supports older kernels (2.6.x). > My questions are: > 1. Does klibc-2.0.14 work with older kernels like 2.6.x, or is it only for > newer kernels (4.11+)?[...] We don't have an explicit policy for this, but in general we are only interested in supporting kernel versions from recent years. If I have a choice between a simpler implementation and supporting a >5 year old kernel version I will choose the simpler implementation. The switch to using statx was necessary to be able to support 64-bit time on all architectures (preparation for Y2038). I did not attempt to implement a fallback for older kernel versions. Ben. -- Ben Hutchings Kids! Bringing about Armageddon can be dangerous. Do not attempt it in your own home. - Terry Pratchett and Neil Gaiman, `Good Omens' -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: This is a digitally signed message part URL: <https://lists.zytor.com/archives/klibc/attachments/20250428/dce4ec6a/attachment.sig>
Sangeetha Elumalai
2025-Jul-11 09:13 UTC
[klibc] Problem with struct statx in usr/klibc/fstatat.c (klibc-2.0.14)
Hi, Any update on this? Thanks, -Sangeetha On Mon, Apr 28, 2025 at 6:26?PM Sangeetha Elumalai < sangeethaeng2017 at gmail.com> wrote:> Hi, > > I am facing a build error in klibc-2.0.14. > > In `usr/klibc/fstatat.c`, there is a line: > > struct statx xbuf; > > Ref: > > https://git.kernel.org/pub/scm/libs/klibc/klibc.git/tree/usr/klibc/fstatat.c#n16 > > But during compilation, I get: > ``` > usr/klibc/fstatat.c:24:15: error: storage size of 'xbuf' isn't known > ``` > > It looks like `struct statx` is not available: > - `struct statx` was added in Linux kernel 4.11. > > Ref: > > https://github.com/torvalds/linux/commit/a528d35e8bfcc521d7cb70aaf03e1bd296c8493f#diff-64bab5a0a3fcb55e1a6ad77b1dfab89d2c9c71a770a07ecf44e6b82aae76a03aR102 > > Since klibc-2.0.14 supports older kernels (2.6.x). > > My questions are: > 1. Does klibc-2.0.14 work with older kernels like 2.6.x, or is it only for > newer kernels (4.11+)? > 2. If klibc-2.0.14 does support older kernels, should the code in > `fstatat.c` be changed to avoid `struct statx` and use something else like > `struct stat`? > > Please let me know if this needs a fix or if there are any version > requirements I missed. > > Thanks, > -Sangeetha >-------------- next part -------------- An HTML attachment was scrubbed... URL: <https://lists.zytor.com/archives/klibc/attachments/20250711/69e14c32/attachment.htm>