newnfs client and statfs

Rick Macklem rmacklem at uoguelph.ca
Sun May 1 15:55:40 UTC 2011


> >
> > - except there isn't a UINT64_MAX, INT64_MAX defined in sys/*.h as
> >   far as I can see. How do I express these constants? Do I have to
> >   convert 0x7ffffffffffffff to decimal and use that?
> 
> Aren't these effectively defined in <sys/limits.h> as UQUAD_MAX and
> QUAD_MAX? These get translated/pulled in from <machine/_limits.h>,
> which varies per architecture. This looks like the translation based
> on
> looking at the respective include files per arch:
> 
> i386: UQUAD_MAX == __UQUAD_MAX == __ULLONG_MAX ==
> 0xffffffffffffffffULL
> i386: QUAD_MAX == __QUAD_MAX == __LLONG_MAX == 0x7fffffffffffffffLL
> 
> amd64: UQUAD_MAX == __UQUAD_MAX == __ULONG_MAX == 0xffffffffffffffffUL
> amd64: QUAD_MAX == __QUAD_MAX == __LONG_MAX == 0x7fffffffffffffffL
> 
> There are some #ifdef's in <sys/limits.h> around some of these
> declarations which I don't understand (like __BSD_VISIBLE), but I
> would
> imagine the above declarations would do what you want.
> 
Yep. And as far as I can see, OFF_MAX is defined exactly the same way
for all arches. The only difference is the comments:
  /* max value for a quad_t */
vs
  /* max value for an off_t */

The post seemed to indicate that OFF_MAX wasn't the correct type and,
later in it, that u_quad_t (the comment would presumably also apply
to quad_t?) shouldn't be assumed the same as uint64_t.

I'm happy to use anything that works, so if QUAD_MAX is preferable to
OFF_MAX, I'll happily use it, rick


More information about the freebsd-fs mailing list