[Libsysio-commit] HEAD: libsysio/include dev.h file.h inode.h sysio.h
Brought to you by:
lward
|
From: Lee W. <lw...@us...> - 2003-10-10 18:52:03
|
Update of /cvsroot/libsysio/libsysio/include
In directory sc8-pr-cvs1:/tmp/cvs-serv14350/include
Modified Files:
dev.h file.h inode.h sysio.h
Log Message:
Red Storm branch mega-merge. Please, no more changes to any of the
Red Storm branches. We'll keep them for reference for awhile but then,
they go away. Finally!
Index: dev.h
===================================================================
RCS file: /cvsroot/libsysio/libsysio/include/dev.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -b -B -p -r1.3 -r1.4
--- dev.h 27 Sep 2003 19:42:02 -0000 1.3
+++ dev.h 10 Oct 2003 18:50:31 -0000 1.4
@@ -84,7 +84,7 @@ extern const struct inode_ops _sysio_nod
(ssize_t (*)(struct inode *, \
char *, \
size_t , \
- off64_t *))_sysio_dev_illop
+ _SYSIO_OFF_T *))_sysio_dev_illop
#define _sysio_nodev_inop_mkdir \
(int (*)(struct pnode *, \
mode_t))_sysio_dev_illop
@@ -135,10 +135,12 @@ extern const struct inode_ops _sysio_nod
(int (*)(struct pnode *, \
mode_t, \
dev_t))_sysio_dev_illop
+#ifdef _HAVE_STATVFS
#define _sysio_nodev_inop_statvfs \
(int (*)(struct pnode *, \
struct inode *, \
struct intnl_statvfs *))_sysio_dev_illop
+#endif
#define _sysio_nodev_inop_gone \
(void (*)(struct inode *ino))_sysio_dev_noop
Index: file.h
===================================================================
RCS file: /cvsroot/libsysio/libsysio/include/file.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -b -B -p -r1.5 -r1.6
--- file.h 24 Mar 2003 22:09:05 -0000 1.5
+++ file.h 10 Oct 2003 18:50:31 -0000 1.6
@@ -52,7 +52,7 @@
*/
struct file {
struct inode *f_ino; /* path node */
- off64_t f_pos; /* current stream pos */
+ _SYSIO_OFF_T f_pos; /* current stream pos */
unsigned f_ref; /* ref count */
int f_flags; /* open/fcntl flags */
};
Index: inode.h
===================================================================
RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -b -B -p -r1.9 -r1.10
--- inode.h 27 Sep 2003 19:42:02 -0000 1.9
+++ inode.h 10 Oct 2003 18:50:31 -0000 1.10
@@ -63,7 +63,9 @@ struct inode;
struct intent;
struct intnl_dirent;
struct intnl_stat;
+#ifdef _HAVE_STATVFS
struct intnl_statvfs;
+#endif
struct io_arguments;
struct ioctx;
@@ -87,7 +89,7 @@ struct inode_ops {
ssize_t (*inop_getdirentries)(struct inode *ino,
char *buf,
size_t nbytes,
- off64_t *basep);
+ _SYSIO_OFF_T *basep);
int (*inop_mkdir)(struct pnode *pno, mode_t mode);
int (*inop_rmdir)(struct pnode *pno);
int (*inop_symlink)(struct pnode *pno, const char *data);
@@ -109,9 +111,11 @@ struct inode_ops {
int (*inop_datasync)(struct inode *ino);
int (*inop_ioctl)(struct inode *ino, unsigned long int request, va_list ap);
int (*inop_mknod)(struct pnode *pno, mode_t mode, dev_t dev);
+#ifdef _HAVE_STATVFS
int (*inop_statvfs)(struct pnode *pno,
struct inode *ino,
struct intnl_statvfs *buf);
+#endif
void (*inop_gone)(struct inode *ino);
};
@@ -348,7 +352,7 @@ struct nameidata {
struct io_arguments {
const struct iovec *ioarg_iovec; /* io vector */
size_t ioarg_iovlen; /* iovec length */
- off64_t ioarg_offset; /* beginning offset */
+ _SYSIO_OFF_T ioarg_offset; /* beginning offset */
void (*ioarg_completion)(void *); /* callback */
void *ioarg_completion_arg; /* callback data */
};
@@ -375,7 +379,7 @@ struct ioctx {
struct inode *ioctx_ino; /* i-node */
const struct iovec *ioctx_iovec; /* scatter/gather vec */
size_t ioctx_iovlen; /* iovec length */
- off64_t ioctx_offset; /* file offset */
+ _SYSIO_OFF_T ioctx_offset; /* file offset */
ssize_t ioctx_cc; /* rtn char count */
int ioctx_errno; /* error number */
void (*ioctx_cb)(void *); /* callback */
Index: sysio.h
===================================================================
RCS file: /cvsroot/libsysio/libsysio/include/sysio.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -b -B -p -r1.9 -r1.10
--- sysio.h 27 Sep 2003 19:42:02 -0000 1.9
+++ sysio.h 10 Oct 2003 18:50:31 -0000 1.10
@@ -79,11 +79,27 @@ typedef void *ioid_t;
#define MAX_SYMLINK 250
#endif
+#ifndef __USE_LARGEFILE64
+/*
+ * Not glibc. Define this ourselves.
+ */
+#define __USE_LARGEFILE64 0
+#endif
+
+/*
+ * Define internal file-offset type.
+ */
+#if __USE_LARGEFILE64
+#define _SYSIO_OFF_T off64_t
+#else
+#define _SYSIO_OFF_T off_t
+#endif
+
/*
* Internally, all directory entries are carried in the 64-bit capable
* structure.
*/
-#ifdef _LARGEFILE64_SOURCE
+#if __USE_LARGEFILE64
#define intnl_dirent dirent64
#else
#define intnl_dirent dirent
@@ -94,24 +110,28 @@ struct dirent;
* Internally, all file status is carried in the 64-bit capable
* structure.
*/
-#ifdef _LARGEFILE64_SOURCE
+#if __USE_LARGEFILE64
#define intnl_stat stat64
#else
#define intnl_stat stat
#endif
struct stat;
-#ifdef _LARGEFILE64_SOURCE
+#ifdef _HAVE_STATVFS
+#if __USE_LARGEFILE64
#define intnl_statvfs statvfs64
#else
#define intnl_statvfs statvfs
#define INTNL_STATVFS_IS_NATURAL 1
#endif
struct statvfs;
+#endif
struct iovec;
struct utimbuf;
+struct intnl_stat;
+
struct pnode;
extern struct pnode *_sysio_cwd;
@@ -138,18 +158,53 @@ extern int dup2(int oldfd, int newfd);
extern int fcntl(int fd, int cmd, ...);
extern int fstat(int fd, struct stat *buf);
extern int fsync(int fd);
-extern int ftruncate(int fd, off_t length);
extern char *getcwd(char *buf, size_t size);
-extern off_t lseek(int fd, off_t offset, int whence);
+#if __USE_LARGEFILE64
+extern off64_t lseek64(int fd, off64_t offset, int whence);
+#endif
extern int lstat(const char *path, struct stat *buf);
+#if defined(BSD) || defined(REDSTORM)
+extern int getdirentries(int fd, char *buf, int nbytes , long *basep);
+#else
extern ssize_t getdirentries(int fd, char *buf, size_t nbytes , off_t *basep);
+#if __USE_LARGEFILE64
+extern ssize_t getdirentries64(int fd,
+ char *buf,
+ size_t nbytes,
+ off64_t *basep);
+#endif
+#endif
extern int mkdir(const char *path, mode_t mode);
extern int open(const char *path, int flag, ...);
+#if __USE_LARGEFILE64
+extern int open64(const char *path, int flag, ...);
+#endif
extern int creat(const char *path, mode_t mode);
+#if __USE_LARGEFILE64
+extern int creat64(const char *path, mode_t mode);
+#endif
extern int stat(const char *path, struct stat *buf);
+#if __USE_LARGEFILE64
+extern int stat64(const char *path, struct stat64 *buf);
+#endif
+#ifdef _HAVE_STATVFS
extern int statvfs(const char *path, struct statvfs *buf);
-extern int truncate(const char *path, off_t length);
+#if __USE_LARGEFILE64
+extern int statvfs64(const char *path, struct statvfs64 *buf);
+#endif
extern int fstatvfs(int fd, struct statvfs *buf);
+#if __USE_LARGEFILE64
+extern int fstatvfs64(int fd, struct statvfs64 *buf);
+#endif
+#endif
+extern int truncate(const char *path, off_t length);
+#if __USE_LARGEFILE64
+extern int truncate64(const char *path, off64_t length);
+#endif
+extern int ftruncate(int fd, off_t length);
+#if __USE_LARGEFILE64
+extern int ftruncate64(int fd, off64_t length);
+#endif
extern int rmdir(const char *path);
extern int symlink(const char *path1, const char *path2);
extern int link(const char *oldpath, const char *newpath);
@@ -162,25 +217,38 @@ extern int iodone(ioid_t ioid);
extern ssize_t iowait(ioid_t ioid);
extern int iodone(ioid_t ioid);
extern ioid_t ipreadv(int fd, const struct iovec *iov, size_t count,
- off_t offset);
-extern ioid_t ipread(int fd, void *buf, size_t count, off_t offset);
+ _SYSIO_OFF_T offset);
+extern ioid_t ipread(int fd, void *buf, size_t count, _SYSIO_OFF_T offset);
extern ssize_t preadv(int fd, const struct iovec *iov, size_t count,
- off_t offset);
+ _SYSIO_OFF_T offset);
extern ssize_t pread(int fd, void *buf, size_t count, off_t offset);
+#if __USE_LARGEFILE64
+extern ssize_t pread64(int fd, void *buf, size_t count, off64_t offset);
+#endif
extern ioid_t ireadv(int fd, const struct iovec *iov, int count);
extern ioid_t iread(int fd, void *buf, size_t count);
extern ssize_t readv(int fd, const struct iovec *iov, int count);
extern ssize_t read(int fd, void *buf, size_t count);
+#if __USE_LARGEFILE64
+extern ssize_t read64(int fd, void *buf, size_t count);
+#endif
extern ioid_t ipwritev(int fd, const struct iovec *iov, size_t count,
- off_t offset);
-extern ioid_t ipwrite(int fd, const void *buf, size_t count, off_t offset);
+ _SYSIO_OFF_T offset);
+extern ioid_t ipwrite(int fd, const void *buf, size_t count,
+ _SYSIO_OFF_T offset);
extern ssize_t pwritev(int fd, const struct iovec *iov, size_t count,
- off_t offset);
+ _SYSIO_OFF_T offset);
extern ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset);
+#if __USE_LARGEFILE64
+extern ssize_t pwrite64(int fd, const void *buf, size_t count, off64_t offset);
+#endif
extern ioid_t iwritev(int fd, const struct iovec *iov, int count);
extern ioid_t iwrite(int fd, const void *buf, size_t count);
extern ssize_t writev(int fd, const struct iovec *iov, int count);
extern ssize_t write(int fd, const void *buf, size_t count);
+#if __USE_LARGEFILE64
+extern ssize_t write64(int fd, const void *buf, size_t count);
+#endif
extern int mknod(const char *path, mode_t mode, dev_t dev);
extern int utime(const char *path, const struct utimbuf *buf);
extern int mount(const char *source, const char *target,
|