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

Re: [PATCH v3] compat: Fix read() of 2GB and more on Mac OS X

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Aug 19, 2013, 13:59 UTC
Message-ID
<CAPig+cTr_B+vtN4sFzepWeW4TpRPD9eKnjy08yJ2pf3KfVU1XA@mail.gmail.com>
In-Reply-To
<1376900499-662-1-git-send-email-prohaska@zib.de>
On Mon, Aug 19, 2013 at 4:21 AM, Steffen Prohaska <prohaska@zib.de> wrote:
Show 35 quoted lines
> Previously, filtering 2GB or more through an external filter (see test)
> failed on Mac OS X 10.8.4 (12E55) for a 64-bit executable with:
>
>     error: read from external filter cat failed
>     error: cannot feed the input to external filter cat
>     error: cat died of signal 13
>     error: external filter cat failed 141
>     error: external filter cat failed
>
>
> Signed-off-by: Steffen Prohaska <prohaska@zib.de>
> ---
>  Makefile              |  8 ++++++++
>  builtin/var.c         |  1 +
>  compat/clipped-read.c | 13 +++++++++++++
>  config.mak.uname      |  1 +
>  git-compat-util.h     |  5 +++++
>  streaming.c           |  1 +
>  t/t0021-conversion.sh | 14 ++++++++++++++
>  7 files changed, 43 insertions(+)
>  create mode 100644 compat/clipped-read.c
>
> diff --git a/Makefile b/Makefile
> index 3588ca1..0f69e24 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -69,6 +69,9 @@ all::
>  # Define NO_MSGFMT_EXTENDED_OPTIONS if your implementation of msgfmt
>  # doesn't support GNU extensions like --check and --statistics
>  #
> +# Define NEEDS_CLIPPED_READ if your read(2) cannot read more than
> +# INT_MAX bytes at once (e.g. MacOS X).
> +#
>  # Define NEEDS_CLIPPED_WRITE if your write(2) cannot write more than
>  # INT_MAX bytes at once (e.g. MacOS X).

Is it likely that we would see a platform requiring only one or the other CLIPPED? Would it make sense to combine these into a single NEEDS_CLIPPED_IO?

Show 20 quoted lines
>  #
> @@ -1493,6 +1496,11 @@ ifndef NO_MSGFMT_EXTENDED_OPTIONS
>         MSGFMT += --check --statistics
>  endif
>
> +ifdef NEEDS_CLIPPED_READ
> +       BASIC_CFLAGS += -DNEEDS_CLIPPED_READ
> +       COMPAT_OBJS += compat/clipped-read.o
> +endif
> +
>  ifdef NEEDS_CLIPPED_WRITE
>         BASIC_CFLAGS += -DNEEDS_CLIPPED_WRITE
>         COMPAT_OBJS += compat/clipped-write.o
> diff --git a/builtin/var.c b/builtin/var.c
> index aedbb53..e59f5ba 100644
> --- a/builtin/var.c
> +++ b/builtin/var.c
> @@ -38,6 +38,7 @@ static struct git_var git_vars[] = {
>         { "", NULL },
>  };
Previous: Steffen ProhaskaNext: Junio C Hamano
Message 16 of 37 in “xread(): Fix read error when filtering >= 2GB on Mac OS X”
  1. xread(): Fix read error when filtering >= 2GB on Mac OS XSteffen Prohaska, Aug 17, 2013
  2. John KeepingAug 17, 2013
  3. Torsten BögershausenAug 17, 2013
  4. Johannes SixtAug 17, 2013
  5. Jonathan NiederAug 17, 2013
  6. Kyle J. McKayAug 17, 2013
  7. Jonathan NiederAug 17, 2013
  8. compat: Fix read() of 2GB and more on Mac OS XSteffen Prohaska, Aug 19, 2013
  9. John KeepingAug 19, 2013
  10. Steffen ProhaskaAug 19, 2013
  11. Johannes SixtAug 19, 2013
  12. Stefan BellerAug 19, 2013
  13. Johannes SixtAug 19, 2013
  14. Steffen ProhaskaAug 19, 2013
  15. compat: Fix read() of 2GB and more on Mac OS XSteffen Prohaska, Aug 19, 2013
  16. Eric SunshineAug 19, 2013
  17. Junio C HamanoAug 19, 2013
  18. compat: Fix read() of 2GB and more on Mac OS XSteffen Prohaska, Aug 19, 2013
  19. Linus TorvaldsAug 19, 2013
  20. Steffen ProhaskaAug 19, 2013
  21. Junio C HamanoAug 19, 2013
  22. Junio C HamanoAug 19, 2013
  23. Linus TorvaldsAug 19, 2013
  24. Kyle J. McKayAug 19, 2013
  25. Linus TorvaldsAug 19, 2013
  26. Junio C HamanoAug 27, 2013
  27. 0/2 Fix IO of >=2GB on Mac OS X by limiting IO chunksSteffen Prohaska, Aug 20, 2013
  28. 1/2 xread, xwrite: Limit size of IO, fixing IO of 2GB and more on Mac OS XSteffen Prohaska, Aug 20, 2013
  29. Junio C HamanoAug 20, 2013
  30. Torsten BögershausenAug 21, 2013
  31. 2/2 Revert "compate/clipped-write.c: large write(2) fails on Mac OS X/XNU"Steffen Prohaska, Aug 20, 2013
  32. 0/2 Fix IO >= 2GB on Mac, fixed typoSteffen Prohaska, Aug 21, 2013
  33. 1/2 xread, xwrite: Limit size of IO, fixing IO of 2GB and more on Mac OS XSteffen Prohaska, Aug 21, 2013
  34. 2/2 Revert "compate/clipped-write.c: large write(2) fails on Mac OS X/XNU"Steffen Prohaska, Aug 21, 2013
  35. Junio C HamanoAug 21, 2013
  36. Johannes SixtAug 19, 2013
  37. Torsten BögershausenAug 19, 2013

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.