fread reading directories

From: Kyle Evans <hidden>
Date: 2020-06-06 22:37:15

Hi,

I was looking at FREAD_READS_DIRECTORIES to measure some performance
differences, then stumbled upon [0] that dropped fread() from the
autoconf test that causes git to use its git_fopen shim [1] even on
Linux.

I've read the commit message a couple of times, but I'm really not
seeing the rationale for *why* git wants this knob to be set on Linux.

Unless I'm missing something, this would seem to regress the almost
certainly much-more-common case of fopen() a file and fread() it with
an unconditional fstat() from grep_fopen(), rather than just using two
syscalls at all times (directories and non-directories) and letting it
get rejected in fread().

Thoughts?

Thanks,

Kyle Evans

[0] https://github.com/git/git/commit/3adf9fdecfb0cd31a83ef3af1d8d631a1acd392b
[1] https://github.com/git/git/blob/master/compat/fopen.c
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help