git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.
Previous: Kyle EvansNext: Kyle Evans
Message 2 of 6 in “fread reading directories”
  1. Kyle EvansJun 6, 2020
  2. Junio C HamanoJun 7, 2020
  3. Kyle EvansJun 7, 2020
  4. Junio C HamanoJun 8, 2020
  5. Brandon CaseyJun 8, 2020
  6. Randall S. BeckerJun 8, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.