SSIZE_MAX on ia64
Jes Sorensen
jes@trained-monkey.org
Fri Aug 2 14:28:00 GMT 2002
>>>>> "Roland" == Roland McGrath <roland@frob.com> writes:
Roland> SSIZE_MAX must accurately reflect the ssize_t type. It is
Roland> presently incorrect on all 64-bit platforms. On every
Roland> platform I am aware of, ssize_t == long int (i.e. 32 bits
Roland> where long is 32 and 64 bits where long is 64). So it would
Roland> not hurt to generically use LONG_MAX, and that would be
Roland> simpler. I think it is a valid assumption at the moment that
Roland> long == wordsize. If not, we could also have SSIZE_MAX
Roland> defined conditional on __WORDSIZE, which is still simpler than
Roland> adding a specific definition for particular platforms.
Hi Roland
That sounds good to me, what about the following patch then? The good
thing is that this way we still allow an architecture to override it
if necessary.
Jes
2002-08-02 Jes Sorensen <jes@trained-monkey.org>
* posix/bits/posix1_lim.h: #define SSIZE_MAX based on the
definition of __WORDSIZE.
--- posix/bits/posix1_lim.h~ Mon Jul 9 19:18:00 2001
+++ posix/bits/posix1_lim.h Fri Aug 2 18:57:24 2002
@@ -127,8 +127,13 @@
#ifndef SSIZE_MAX
+#include <bits/wordsize.h>
+#if __WORDSIZE == 64
+# define SSIZE_MAX LONG_MAX
+#else
# define SSIZE_MAX INT_MAX
#endif
+#endif
/* This value is a guaranteed minimum maximum.
More information about the Libc-hacker
mailing list