Re: fread reading directories
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 7, 2020, 17:05 UTC
- Message-ID
- <xmqqd06an6wf.fsf@gitster.c.googlers.com>
- In-Reply-To
- <CACNAnaG19QD1PbVS93nFm3XY70CZCrRosmVq-_3j+puAKSPj9Q@mail.gmail.com>
Kyle Evans <kevans@freebsd.org> writes:
> 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 thought we saw this mentioned recently? I do not recall if any concrete improvement came out of it.
The Makefile defines the macro as such:
# Define FREAD_READS_DIRECTORIES if you are on a system which succeeds # when attempting to read from an fopen'ed directory (or even to fopen # it at all).
So, the macro is expected to be set if a platform gives back FILE * on a directory, whether it allows fread() on it or not.
If it is a good idea is entirely different story, though.