[Libsysio-commit] RedStorm_merge: libsysio/include cplant-yod.h dev.h inode.h sysio.h
Brought to you by:
lward
|
From: Sonja T. <so...@us...> - 2003-10-09 15:04:19
|
Update of /cvsroot/libsysio/libsysio/include
In directory sc8-pr-cvs1:/tmp/cvs-serv7240/include
Modified Files:
Tag: RedStorm_merge
dev.h inode.h sysio.h
Added Files:
Tag: RedStorm_merge
cplant-yod.h
Log Message:
Merging redstorm changes
--- NEW FILE ---
/*
* This Cplant(TM) source code is the property of Sandia National
* Laboratories.
*
* This Cplant(TM) source code is copyrighted by Sandia National
* Laboratories.
*
* The redistribution of this Cplant(TM) source code is subject to the
* 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.
* 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
* Government.
*/
/*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Questions or comments about this library should be sent to:
*
* Lee Ward
* Sandia National Laboratories, New Mexico
* P.O. Box 5800
* Albuquerque, NM 87185-1110
*
* le...@sa...
*/
/*
* cplant yod I/O functions
*/
extern int chmod_yod(const char* path, mode_t);
extern int chown_yod(const char* path, uid_t, gid_t);
extern int stat_yod(const char *path, struct stat *sbuf);
extern int fstat_yod(int fd, struct stat *buf);
extern int statfs_yod(const char *path, struct statfs *sbuf);
extern int fstatfs_yod(int fd, struct statfs *buf);
extern int mkdir_yod(const char *path, mode_t mode);
extern int rmdir_yod(const char *path);
extern int getdirentries_yod(int fd, char *buf, size_t nbytes, loff_t *basep);
extern int link_yod(const char *path1, const char *path2);
extern int unlink_yod(const char *path);
extern int symlink_yod(const char *path1, const char *path2 );
extern int open_yod(const char *fname, int flags, mode_t mode);
extern int close_yod(int);
extern ssize_t write_yod(int fd, const void *buff, size_t nbytes);
extern ssize_t read_yod(int fd, void *buff, size_t nbytes);
extern int fsync_yod(int fd);
extern int truncate_yod(const char *path, off_t length);
extern int ftruncate_yod(int fd, long length);
extern off_t lseek_yod(int fd, off_t offset, int whence);
Index: dev.h
===================================================================
RCS file: /cvsroot/libsysio/libsysio/include/dev.h,v
retrieving revision 1.2.6.1
retrieving revision 1.2.6.1.2.1
diff -u -w -b -B -p -r1.2.6.1 -r1.2.6.1.2.1
--- dev.h 12 May 2003 11:48:45 -0000 1.2.6.1
+++ dev.h 9 Oct 2003 15:04:09 -0000 1.2.6.1.2.1
@@ -70,73 +70,75 @@ extern const struct inode_ops _sysio_nod
(int (*)(struct pnode *, \
struct inode **, \
struct intent *, \
- const char *))_sysio_dev_e_notdir
+ const char *))_sysio_dev_illop
#define _sysio_nodev_inop_getattr \
(int (*)(struct pnode *, \
struct inode *, \
- struct intnl_stat *))_sysio_dev_e_badf
+ struct intnl_stat *))_sysio_dev_illop
#define _sysio_nodev_inop_setattr \
(int (*)(struct pnode *, \
struct inode *, \
unsigned , \
- struct intnl_stat *))_sysio_dev_e_badf
+ struct intnl_stat *))_sysio_dev_illop
#define _sysio_nodev_getdirentries \
(ssize_t (*)(struct inode *, \
char *, \
size_t , \
- _SYSIO_OFF_T *))_sysio_dev_e_notdir
+ _SYSIO_OFF_T *))_sysio_dev_illop
#define _sysio_nodev_inop_mkdir \
(int (*)(struct pnode *, \
- mode_t))_sysio_dev_e_notdir
+ mode_t))_sysio_dev_illop
#define _sysio_nodev_inop_rmdir \
- (int (*)(struct pnode *))_sysio_dev_e_notdir
+ (int (*)(struct pnode *))_sysio_dev_illop
#define _sysio_nodev_inop_symlink \
(int (*)(struct pnode *, \
- const char *))_sysio_dev_e_notdir
+ const char *))_sysio_dev_illop
#define _sysio_nodev_inop_readlink \
(int (*)(struct pnode *, \
char *, \
- size_t))_sysio_dev_e_inval
+ size_t))_sysio_dev_illop
#define _sysio_nodev_inop_open \
(int (*)(struct pnode *, \
int, \
- mode_t))_sysio_dev_e_nxio
+ mode_t))_sysio_dev_illop
#define _sysio_nodev_inop_close \
- (int (*)(struct inode *))_sysio_dev_e_badf
+ (int (*)(struct inode *))_sysio_dev_illop
+#define _sysio_nodev_inop_link \
+ (int (*)(struct pnode *, struct pnode *))_sysio_dev_illop
#define _sysio_nodev_inop_unlink \
- (int (*)(struct pnode *))_sysio_dev_e_notdir
+ (int (*)(struct pnode *))_sysio_dev_illop
+#define _sysio_nodev_inop_rename \
+ (int (*)(struct pnode *, struct pnode *))_sysio_dev_illop
#define _sysio_nodev_inop_ipreadv \
(int (*)(struct inode *, \
struct io_arguments *, \
- struct ioctx **))_sysio_dev_e_inval
+ struct ioctx **))_sysio_dev_illop
#define _sysio_nodev_inop_ipwritev \
(int (*)(struct inode *, \
struct io_arguments *, \
- struct ioctx **))_sysio_dev_e_inval
+ struct ioctx **))_sysio_dev_illop
#define _sysio_nodev_inop_iodone \
- (int (*)(struct ioctx *))_sysio_dev_e_illop
+ (int (*)(struct ioctx *))_sysio_dev_illop
#define _sysio_nodev_inop_fcntl \
(int (*)(struct inode *, \
int, \
- va_list))_sysio_dev_e_inval
+ va_list))_sysio_dev_illop
#define _sysio_nodev_inop_sync \
- (int (*)(struct inode *))_sysio_dev_e_inval
+ (int (*)(struct inode *))_sysio_dev_illop
#define _sysio_nodev_inop_datasync \
- (int (*)(struct inode *))_sysio_dev_e_inval
+ (int (*)(struct inode *))_sysio_dev_illop
#define _sysio_nodev_inop_ioctl \
(int (*)(struct inode *, \
unsigned long int, \
- va_list))_sysio_dev_e_notty
+ va_list))_sysio_dev_illop
#define _sysio_nodev_inop_mknod \
(int (*)(struct pnode *, \
mode_t, \
- dev_t))_sysio_dev_e_notdir
-#ifdef _HAVE_STATVFS
+ dev_t))_sysio_dev_illop
#define _sysio_nodev_inop_statvfs \
(int (*)(struct pnode *, \
struct inode *, \
- struct intnl_statvfs *))_sysio_dev_e_inval
-#endif
+ struct intnl_statvfs *))_sysio_dev_illop
#define _sysio_nodev_inop_gone \
(void (*)(struct inode *ino))_sysio_dev_noop
@@ -146,10 +148,5 @@ extern struct inode_ops *_sysio_dev_look
extern int _sysio_char_dev_register(int major,
const char *name,
struct inode_ops *ops);
-extern int _sysio_dev_e_notdir(void);
-extern int _sysio_dev_e_badf(void);
-extern int _sysio_dev_e_inval(void);
-extern int _sysio_dev_e_nxio(void);
-extern int _sysio_dev_e_illop(void);
-extern int _sysio_dev_e_notty(void);
+extern int _sysio_dev_illop(void);
extern void _sysio_dev_noop(void);
Index: inode.h
===================================================================
RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v
retrieving revision 1.6.4.2
retrieving revision 1.6.4.2.2.1
diff -u -w -b -B -p -r1.6.4.2 -r1.6.4.2.2.1
--- inode.h 29 Jul 2003 19:05:08 -0000 1.6.4.2
+++ inode.h 9 Oct 2003 15:04:09 -0000 1.6.4.2.2.1
@@ -63,9 +63,7 @@ struct inode;
struct intent;
struct intnl_dirent;
struct intnl_stat;
-#ifdef _HAVE_STATVFS
struct intnl_statvfs;
-#endif
struct io_arguments;
struct ioctx;
@@ -96,7 +94,9 @@ struct inode_ops {
int (*inop_readlink)(struct pnode *pno, char *buf, size_t bufsiz);
int (*inop_open)(struct pnode *pno, int flags, mode_t mode);
int (*inop_close)(struct inode *ino);
+ int (*inop_link)(struct pnode *old, struct pnode *new);
int (*inop_unlink)(struct pnode *pno);
+ int (*inop_rename)(struct pnode *old, struct pnode *new);
int (*inop_ipreadv)(struct inode *ino,
struct io_arguments *ioargs,
struct ioctx **ioctxp);
@@ -109,11 +109,9 @@ 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);
};
@@ -132,8 +130,9 @@ struct inode_ops {
*/
struct inode {
LIST_ENTRY(inode) i_link; /* FS i-nodes link */
- unsigned i_immune : 1; /* immune from GC */
- unsigned i_zombie : 1; /* stale inode */
+ unsigned
+ i_immune : 1, /* immune from GC */
+ i_zombie : 1; /* stale inode */
unsigned i_ref; /* soft ref counter */
ino_t i_num; /* i-num (deprecate!) */
mode_t i_mode; /* mode (see stat.h) */
@@ -444,6 +443,7 @@ extern int _sysio_namei(struct pnode *pn
unsigned flags,
struct intent *intnt,
struct pnode **pnop);
+extern int _sysio_p_chdir(struct pnode *pno);
extern int _sysio_ioctx_init(void);
extern struct ioctx *_sysio_ioctx_new(struct inode *ino,
struct io_arguments *ioargs);
Index: sysio.h
===================================================================
RCS file: /cvsroot/libsysio/libsysio/include/sysio.h,v
retrieving revision 1.7.6.2
retrieving revision 1.7.6.2.2.1
diff -u -w -b -B -p -r1.7.6.2 -r1.7.6.2.2.1
--- sysio.h 29 Jul 2003 20:17:22 -0000 1.7.6.2
+++ sysio.h 9 Oct 2003 15:04:09 -0000 1.7.6.2.2.1
@@ -79,10 +79,17 @@ 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.
*/
-#ifdef _LARGEFILE64_SOURCE
+#if __USE_LARGEFILE64
#define _SYSIO_OFF_T off64_t
#else
#define _SYSIO_OFF_T off_t
@@ -92,7 +99,7 @@ typedef void *ioid_t;
* 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
@@ -103,16 +110,16 @@ 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 _HAVE_STATVFS
-#ifdef _LARGEFILE64_SOURCE
+#if __USE_LARGEFILE64
#define intnl_statvfs statvfs64
+struct statvfs64;
#else
#define intnl_statvfs statvfs
#define INTNL_STATVFS_IS_NATURAL 1
@@ -117,10 +124,14 @@ struct stat;
#define intnl_statvfs statvfs
#define INTNL_STATVFS_IS_NATURAL 1
#endif
+
struct statvfs;
-#endif
struct iovec;
+struct utimbuf;
+
+struct stat64;
+
struct pnode;
extern struct pnode *_sysio_cwd;
@@ -138,34 +149,65 @@ extern void _sysio_shutdown(void);
extern int access(const char *path, int amode);
extern int chdir(const char *path);
extern int chmod(const char *path, mode_t mode);
+extern int fchmod(int fd, mode_t mode);
extern int chown(const char *path, uid_t owner, gid_t group);
+extern int fchown(int fd, uid_t owner, gid_t group);
extern int close(int d);
extern int dup(int oldfd);
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 ssize_t getdirentries(int fd, char *buf, int nbytes , long *basep);
+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);
-#ifdef _HAVE_STATVFS
+#if __USE_LARGEFILE64
+extern int stat64(const char *path, struct stat64 *buf);
+#endif
extern int statvfs(const char *path, struct statvfs *buf);
+#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
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);
extern int unlink(const char *path);
+extern int rename(const char *oldpath, const char *newpath);
extern int fdatasync(int fd);
extern int ioctl(int fd, unsigned long request, ...);
extern mode_t umask(mode_t mask);
@@ -173,28 +215,47 @@ 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);
+#if defined(BSD) || defined(REDSTORM)
+extern int mount(const char *type, const char *dir,
+ int flags, void *data);
+#else
extern int mount(const char *source, const char *target,
const char *filesystemtype,
unsigned long mountflags,
const void *data);
+#endif
+extern int utime(const char *path, const struct utimbuf *buf);
extern int umount(const char *target);
|