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

Re: read() MAX_IO_SIZE bytes, more than SSIZE_MAX?

From
Joachim Schmitz <jojo@schmitz-digital.de>
Date
Feb 8, 2015, 12:05 UTC
Message-ID
<loom.20150208T125055-287@post.gmane.org>
In-Reply-To
<CAPc5daXD_7XZD5Vag51BjrSZ0q1r9eMswhLmnpUFqqjrc9oSTw@mail.gmail.com>
Junio C Hamano <gitster <at> pobox.com> writes:
<snip>
Show 14 quoted lines
> >
> > something like this:
> >
> > /* allow overwriting from e.g. Makefile */
> > #if !defined(MAX_IO_SIZE)
> > # define MAX_IO_SIZE (8*1024*1024)
> > #endif
> > /* for plattforms that have SSIZE and have it smaller */
> > #if defined(SSIZE_MAX && (SSIZE_MAX < MAX_IO_SIZE)
> > # undef MAX_IO_SIZE /* avoid warning */
> > # define MAX_IO_SIZE SSIZE_MAX
> > #endif
> 
> No, not like that. If you do (1), that is only so that the Makefile can 
override
Show 6 quoted lines
> a broken definition a platform may give to SSIZE_MAX.  So
> 
>  (1) if Makefile gives one, use it without second-guessing with SSIZE_MAX.
>  (2) if SSIZE_MAX is defined, and if it is smaller than our internal
> default, use it.
>  (3) all other cases, us our internal default.
oops, yes, of course
/* allow overwriting from e.g. Makefile */
#ifndef(MAX_IO_SIZE)
# define MAX_IO_SIZE (8*1024*1024)
  /* for plattforms that have SSIZE and have it smaller */
# if defined(SSIZE_MAX) && (SSIZE_MAX < MAX_IO_SIZE)
#  undef MAX_IO_SIZE /* avoid warning */
#  define MAX_IO_SIZE SSIZE_MAX
# endif
#endif
Previous: Randall S. BeckerNext: Eric Sunshine
Message 11 of 20 in “read() MAX_IO_SIZE bytes, more than SSIZE_MAX?”
  1. Joachim SchmitzFeb 7, 2015
  2. Joachim SchmitzFeb 7, 2015
  3. Torsten BögershausenFeb 7, 2015
  4. Joachim SchmitzFeb 7, 2015
  5. Joachim SchmitzFeb 7, 2015
  6. Torsten BögershausenFeb 7, 2015
  7. Junio C HamanoFeb 7, 2015
  8. Joachim SchmitzFeb 7, 2015
  9. Junio C HamanoFeb 8, 2015
  10. Randall S. BeckerFeb 8, 2015
  11. Joachim SchmitzFeb 8, 2015
  12. Eric SunshineFeb 8, 2015
  13. Junio C HamanoFeb 11, 2015
  14. Joachim SchmitzFeb 11, 2015
  15. Joachim SchmitzFeb 11, 2015
  16. Junio C HamanoFeb 11, 2015
  17. Randall S. BeckerFeb 7, 2015
  18. Randall S. BeckerFeb 7, 2015
  19. Joachim SchmitzFeb 7, 2015
  20. Joachim SchmitzFeb 7, 2015

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.