[Libsysio-commit] strided-io: libsysio/include inode.h sysio.h
Brought to you by:
lward
|
From: Lee W. <lw...@us...> - 2004-01-26 21:41:20
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1014/include Modified Files: Tag: strided-io inode.h sysio.h Log Message: Use O_LARGEFILE or we don't get 64-bit file address space. Fix lots of seek/position checks. Add artificial limit check to _sysio_validx and remove the test for overflow of INT_MAX there. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.13.6.1 retrieving revision 1.13.6.2 diff -u -w -b -B -p -r1.13.6.1 -r1.13.6.2 --- inode.h 23 Jan 2004 15:20:10 -0000 1.13.6.1 +++ inode.h 26 Jan 2004 07:10:57 -0000 1.13.6.2 @@ -463,7 +463,8 @@ extern struct ioctx *_sysio_ioctx_find(i extern ssize_t _sysio_ioctx_wait(struct ioctx *ioctx); extern void _sysio_ioctx_complete(struct ioctx *ioctx); extern ssize_t _sysio_validx(const struct intnl_xtvec *xtv, size_t xtvlen, - const struct iovec *iov, size_t iovlen); + const struct iovec *iov, size_t iovlen, + _SYSIO_OFF_T limit); extern ssize_t _sysio_enumerate_extents(const struct intnl_xtvec *xtv, size_t xtvlen, const struct iovec *iov, Index: sysio.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio.h,v retrieving revision 1.14.6.1 retrieving revision 1.14.6.2 diff -u -w -b -B -p -r1.14.6.1 -r1.14.6.2 --- sysio.h 23 Jan 2004 15:20:37 -0000 1.14.6.1 +++ sysio.h 26 Jan 2004 07:10:57 -0000 1.14.6.2 @@ -45,6 +45,7 @@ * System IO common information. */ +#include <limits.h> #include <stdarg.h> #ifndef _IOID_T_DEFINED @@ -81,7 +82,7 @@ typedef void *ioid_t; #ifndef _LARGEFILE64_SOURCE /* - * Not glibc. Define this ourselves. + * Not glibc I guess. Define this ourselves. */ #define _LARGEFILE64_SOURCE 0 #endif @@ -91,10 +92,17 @@ typedef void *ioid_t; */ #if _LARGEFILE64_SOURCE #define _SYSIO_OFF_T off64_t -#define _SYSIO_OFF_T_MAX (9223372036854775807LL - 1) +#ifdef LLONG_MAX +#define _SYSIO_OFF_T_MAX (LLONG_MAX) +#else +/* + * Don't have LLONG_MAX before C99. We'll need to define it ourselves. + */ +#define _SYSIO_OFF_T_MAX (9223372036854775807LL) +#endif #else #define _SYSIO_OFF_T off_t -#define _SYSIO_OFF_T_MAX (2147483647L - 1) +#define _SYSIO_OFF_T_MAX LONG_MAX #endif /* |