[Libsysio-commit] RedStorm: libsysio/include sysio.h
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2003-09-27 23:37:57
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1:/tmp/cvs-serv11329/include Modified Files: Tag: RedStorm sysio.h Log Message: Incorporating the head dragged in a whole bunch of symbols. Mostly, improperly defined. They were functions instead of aliases :-( Fixed that... Along the way, base everything around __USE_LARGEFILE64 from the glibc headers when trying to get the xxxx64() entry-points. If this isn't being compiled under glibc then __USE_LARGEFILE64 is defined to be 0. Which means that the internal offset, stat, statvfs, etc types all become the defaults from the system and everything is considered to be "natural". This is a very intrusive change. Everybody should retest. Index: sysio.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio.h,v retrieving revision 1.7.6.3 retrieving revision 1.7.6.4 diff -u -w -b -B -p -r1.7.6.3 -r1.7.6.4 --- sysio.h 27 Sep 2003 20:20:40 -0000 1.7.6.3 +++ sysio.h 27 Sep 2003 23:01:23 -0000 1.7.6.4 @@ -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,7 +110,7 @@ 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 @@ -111,7 +118,7 @@ struct dirent; struct stat; #ifdef _HAVE_STATVFS -#ifdef _LARGEFILE64_SOURCE +#if __USE_LARGEFILE64 #define intnl_statvfs statvfs64 #else #define intnl_statvfs statvfs @@ -123,6 +130,8 @@ struct iovec; struct utimbuf; +struct stat64; + struct pnode; extern struct pnode *_sysio_cwd; @@ -149,24 +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 ssize_t 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); +#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); @@ -179,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, |