Update of /cvsroot/libsysio/libsysio/include
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23911/include
Modified Files:
file.h sysio.h
Log Message:
Fixed to properly support fcntl locking with relative offsets.
Index: file.h
===================================================================
RCS file: /cvsroot/libsysio/libsysio/include/file.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -w -b -B -p -r1.11 -r1.12
--- file.h 16 Jun 2005 21:14:39 -0000 1.11
+++ file.h 28 Oct 2005 17:59:31 -0000 1.12
@@ -9,7 +9,7 @@
* terms of the GNU Lesser General Public License
* (see cit/LGPL or http://www.gnu.org/licenses/lgpl.html)
*
- * Cplant(TM) Copyright 1998-2003 Sandia Corporation.
+ * Cplant(TM) Copyright 1998-2005 Sandia Corporation.
* Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
* license for use of this work by or on behalf of the US Government.
* Export of this program may require a license from the United States
@@ -46,6 +46,28 @@
*/
/*
+ * Test whether large file support on this file.
+ */
+#ifdef O_LARGEFILE
+#define _F_LARGEFILE(fil) \
+ ((fil)->f_flags & O_LARGEFILE)
+#else
+#define _F_LARGEFILE(fil) \
+ (1)
+#endif
+/*
+ * Return max seek value for this file.
+ */
+#define _SEEK_MAX(fil) \
+ (_F_LARGEFILE(fil) ? _SYSIO_OFF_T_MAX : LONG_MAX)
+
+#if _LARGEFILE64_SOURCE
+#define _SYSIO_FLOCK flock64
+#else
+#define _SYSIO_FLOCK flock
+#endif
+
+/*
* A file record is maintained for each open file in the system. It holds
* all the info necessary to track the context and parameters for the
* operations that may be performed.
@@ -106,3 +128,7 @@ extern int _sysio_fd_close_all(void);
#if ZERO_SUM_MEMORY
extern void _sysio_fd_shutdown(void);
#endif
+extern _SYSIO_OFF_T _sysio_lseek_prepare(struct file *fil,
+ _SYSIO_OFF_T offset,
+ int whence,
+ _SYSIO_OFF_T max);
Index: sysio.h
===================================================================
RCS file: /cvsroot/libsysio/libsysio/include/sysio.h,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -w -b -B -p -r1.34 -r1.35
--- sysio.h 23 Feb 2005 01:43:08 -0000 1.34
+++ sysio.h 28 Oct 2005 17:59:31 -0000 1.35
@@ -171,6 +171,7 @@ extern int SYSIO_INTERFACE_NAME(close)(i
extern int SYSIO_INTERFACE_NAME(dup)(int oldfd);
extern int SYSIO_INTERFACE_NAME(dup2)(int oldfd, int newfd);
extern int SYSIO_INTERFACE_NAME(fcntl)(int fd, int cmd, ...);
+extern int SYSIO_INTERFACE_NAME(fcntl64)(int fd, int cmd, ...);
extern int SYSIO_INTERFACE_NAME(fstat)(int fd, struct stat *buf);
#if _LARGEFILE64_SOURCE
extern int SYSIO_INTERFACE_NAME(fstat64)(int fd, struct stat64 *buf);
|