PATCH: export XATTR_{NAME,SIZE,LIST}_MAX

Philippe Cerfon philcerf@gmail.com
Tue May 30 11:25:38 GMT 2023


Hey there.

Linux exports XATTR_{NAME,SIZE,LIST}_MAX in it's linux/limits.h and
e.g. the CPython interpreter uses them for it's XATTRs functions.

I made a corresponding PR at CPython
https://github.com/python/cpython/pull/105075 to get the code built
for Cygwin, but right now this would fail due to the missing
XATTR_*_MAX symbols.

The attached patch below would add them to cygwin/limits.h.

But beware, I'm absolutely no Windows/Cygwin expert ^^ - so whether
the values I've chosen are actually correct, is more guesswork rather
than definite knowledge.

As written in the commit message, I think:
- XATTR_NAME_MAX corresponds to MAX_EA_NAME_LEN
and
- XATTR_SIZE_MAX to MAX_EA_VALUE_LEN

though I have no idea, whether these are just lower boundaries used by
Cygwin, while e.g. Windows itself might set longer names or value
lenghts, and thus - when Cygwin would try to read such - it might get
into troubles (or rather e.g. CPython, as it's buffers wouldn't
suffice to read the EA respectively XATTR.

Neither to i have an idea about XATTR_LIST_MAX. I'm not even 100% sure
what it means (I guess the max number of XATTRs per file). Not to
speak about whether there's such maximum for Windows EAs,
And again - as above - what would happen if Windows itself would set
more than that limit and within Cygwin one would try to read/list all.

Thanks,
Philippe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-export-XATTR_-NAME-SIZE-LIST-_MAX.patch
Type: text/x-patch
Size: 1250 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/newlib/attachments/20230530/edb15c41/attachment.bin>


More information about the Newlib mailing list