]> Savannah Git Hosting - gnulib.git/commit
file-has-acl: no need for struct stat
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 3 Oct 2024 00:40:34 +0000 (17:40 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 3 Oct 2024 00:41:28 +0000 (17:41 -0700)
commit8682f4d3c2aa0daff2c39935f4a3938d3db108d2
tree14aa8eac380d93107297a525a66ecb75cbda37bf
parenta6de9f388441c4389e2ee3a8e98486f195d67198
file-has-acl: no need for struct stat

Change the API of the new file_has_aclinfo function so that it no
longer needs a struct stat *.  In some cases this can help GNU ls
avoid an unnecessary ‘stat’ call for each file it lists, which
can be a significant win.
* lib/acl.h (ACL_SYMLINK_NOFOLLOW): Change from 1 to UCHAR_MAX+1
so that it can be ORed with any d_type value.
* lib/file-has-acl.c: Include dirent.h, for the DT_* macros.
Check that ACL_SYMLINK_NOFOLLOW is outside unsigned char range.
(file_has_aclinfo): Change API so that struct stat is no longer
needed.  Instead, the file type (if known) is passed as part of
the flags.  All callers changed.  Simplify NFSv4 code.
* modules/file-has-acl (Depends-on): Add assert-h for static_assert,
and dirent for DT_* macros.
* tests/test-file-has-acl.c: Include dirent.h.
(main): Adjust to file_has_aclinfo API change.
Briefly test ACL_SYMLINK_FOLLOW.
ChangeLog
NEWS
lib/acl.h
lib/file-has-acl.c
modules/file-has-acl
tests/test-file-has-acl.c