Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 May 2011 11:55:39 -0400 (EDT)
From:      Rick Macklem <rmacklem@uoguelph.ca>
To:        Jeremy Chadwick <freebsd@jdc.parodius.com>
Cc:        rmacklem@freebsd.org, fs@freebsd.org
Subject:   Re: newnfs client and statfs
Message-ID:  <1298790394.829218.1304265339603.JavaMail.root@erie.cs.uoguelph.ca>
In-Reply-To: <20110501153500.GA99593@icarus.home.lan>

next in thread | previous in thread | raw e-mail | index | archive | help
> >
> > - 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1298790394.829218.1304265339603.JavaMail.root>