]> git.ipfire.org Git - thirdparty/systemd.git/commit
stat-util: optimize dir_is_empty_at() a bit, by using getdents64()
authorLennart Poettering <lennart@poettering.net>
Fri, 22 Oct 2021 22:30:14 +0000 (00:30 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 25 Oct 2021 19:51:37 +0000 (21:51 +0200)
commita068aceafbffcba85398cce636c25d659265087a
tree49fd3b3bb3de7030bade9b43752688d44e9c361b
parenta4e70ef7ba3b5e2c050cce5ed2bbf58807505596
stat-util: optimize dir_is_empty_at() a bit, by using getdents64()

That way we have a single syscall only for it, instead of the multiple
readdir() and friends do. And we can operate entirely on the stack, no
malloc() implicit.
src/basic/dirent-util.h
src/basic/stat-util.c