From 6deb631b20b7e212d9a350759e472fa60f9e92e4 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Thu, 25 May 2000 03:34:34 +0000 Subject: [PATCH] 208. [func] Added ISC_OFFSET_MAXIMUM for the maximum value of an isc_offset_t. --- CHANGES | 3 +++ lib/isc/unix/include/isc/offset.h | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index ea262145f2..1df6bba112 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ + 208. [func] Added ISC_OFFSET_MAXIMUM for the maximum value + of an isc_offset_t. + 207. [func] The dnssec tools properly use the logging subsystem. 206. [cleanup] dst now stores the key name as a dns_name_t, not diff --git a/lib/isc/unix/include/isc/offset.h b/lib/isc/unix/include/isc/offset.h index 5f2b76462e..19d1f18164 100644 --- a/lib/isc/unix/include/isc/offset.h +++ b/lib/isc/unix/include/isc/offset.h @@ -15,7 +15,7 @@ * SOFTWARE. */ -/* $Id: offset.h,v 1.3 2000/04/28 22:13:15 tale Exp $ */ +/* $Id: offset.h,v 1.4 2000/05/25 03:34:34 tale Exp $ */ #ifndef ISC_OFFSET_H #define ISC_OFFSET_H 1 @@ -23,9 +23,15 @@ /* * File offsets are operating-system dependent. */ - +#include #include typedef off_t isc_offset_t; +/* + * POSIX says "Additionally, blkcnt_t and off_t are extended signed integral + * types", so the maximum value is all 1s except for the high bit. + */ +#define ISC_OFFSET_MAXIMUM (~((off_t)1 << (sizeof(off_t) * CHAR_BIT - 1))) + #endif /* ISC_OFFSET_H */