[Gluster-devel] TMP_MAX on Linux vs OSX

Justin Clift jclift at redhat.com
Mon Mar 11 15:07:26 UTC 2013


Hi Kaleb,

Just following up your review for the TMP_MAX thing. :)

  http://review.gluster.org/4654

I'm happy to go with using TMP_MAX from stdio.h by
#including that instead.  The only thing that's making
me unsure about it, is they're very very different values
on Linux vs OSX.

Code snippet from RHEL 6.x stdio.h -> <bits/stdio_lim.h>:
(stdio.h includes it from stdio_lim.h)
  # define TMP_MAX 238328

Code snippet from OSX 10.7 stdio.h:

  /* System V/ANSI C; this is the wrong way to do this, do *not* use these. */
  #ifndef _ANSI_SOURCE
  #define P_tmpdir "/var/tmp/"
  #endif
  #define L_tmpnam 1024 /* XXX must be == PATH_MAX */
  #define TMP_MAX  308915776

The version of TMP_MAX is about 1300x the size of
the Linux one.  Strongly suspecting that'd lead to
incorrect behaviour, though I have no real idea here.
:)

What do you reckon?

Regards and best wishes,

Justin Clift

--
Open Source and Standards @ Red Hat

twitter.com/realjustinclift





More information about the Gluster-devel mailing list