libsysio-commit Mailing List for libsysio (Page 28)
Brought to you by:
lward
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
(25) |
May
(28) |
Jun
(25) |
Jul
(30) |
Aug
(60) |
Sep
(52) |
Oct
(100) |
Nov
(15) |
Dec
(34) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(89) |
Feb
(48) |
Mar
(22) |
Apr
(59) |
May
(16) |
Jun
(15) |
Jul
(50) |
Aug
(26) |
Sep
(40) |
Oct
(27) |
Nov
(12) |
Dec
|
2005 |
Jan
(24) |
Feb
(11) |
Mar
|
Apr
|
May
(3) |
Jun
(6) |
Jul
|
Aug
(14) |
Sep
(21) |
Oct
(10) |
Nov
|
Dec
|
2006 |
Jan
(8) |
Feb
(5) |
Mar
(2) |
Apr
(6) |
May
(11) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(3) |
2007 |
Jan
(3) |
Feb
(5) |
Mar
(20) |
Apr
(41) |
May
(21) |
Jun
(3) |
Jul
(5) |
Aug
(12) |
Sep
(21) |
Oct
(5) |
Nov
(16) |
Dec
|
2008 |
Jan
|
Feb
(2) |
Mar
(4) |
Apr
(23) |
May
|
Jun
(22) |
Jul
(13) |
Aug
|
Sep
|
Oct
(9) |
Nov
(3) |
Dec
(13) |
2009 |
Jan
(14) |
Feb
(10) |
Mar
(2) |
Apr
(11) |
May
(7) |
Jun
(1) |
Jul
(1) |
Aug
(36) |
Sep
(12) |
Oct
|
Nov
|
Dec
(10) |
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: Ruth K. <rk...@us...> - 2004-04-27 22:40:32
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26597 Modified Files: lseek.c Log Message: fix swapped value in lseek return Index: lseek.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/lseek.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -w -b -B -p -r1.16 -r1.17 --- lseek.c 27 Apr 2004 22:10:55 -0000 1.16 +++ lseek.c 27 Apr 2004 22:40:20 -0000 1.17 @@ -107,10 +107,9 @@ _sysio_lseek(int fd, _SYSIO_OFF_T offset #endif pos = (fil->f_ino->i_ops.inop_pos)(fil->f_ino, pos); if (pos < 0) - return pos; + SYSIO_INTERFACE_RETURN(pos, pos); fil->f_pos = pos; - - SYSIO_INTERFACE_RETURN(pos, -1); + SYSIO_INTERFACE_RETURN(pos, 0); } #if _LARGEFILE64_SOURCE |
From: Ruth K. <rk...@us...> - 2004-04-27 22:31:40
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24720 Modified Files: open.c Log Message: add missing interface name macro Index: open.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/open.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -w -b -B -p -r1.17 -r1.18 --- open.c 27 Apr 2004 22:10:55 -0000 1.17 +++ open.c 27 Apr 2004 22:31:31 -0000 1.18 @@ -223,7 +223,7 @@ error: #undef __open sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(open), __open) #undef open64 -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(open), open64) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(open), SYSIO_INTERFACE_NAME(open64)) #undef __open64 sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(open), __open64) #endif @@ -272,7 +272,7 @@ SYSIO_INTERFACE_NAME(creat)(const char * #undef __creat sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(creat), __creat) #undef creat64 -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(creat), creat64) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(creat), SYSIO_INTERFACE_NAME(creat64)) #undef __creat64 sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(creat), __creat64) #endif |
From: Ruth K. <rk...@us...> - 2004-04-27 22:13:11
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19741 Modified Files: sysio-symbols.h sysio.h xtio.h Log Message: From Cray 728488 MAJOR ERRNO=2/"NO SUCH FILE OR DIRECTORY" INSTEAD OF SUCCESS ON CREATE OPERATIONS Added macros to preserve the initial errno value across all successful calls. Also added macros to allow compile time construction of interface names unique to sysio library. This facility can be turned on by setting SYSIO_LABEL_NAMES to 1 in sysio.h. Index: sysio-symbols.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio-symbols.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -b -B -p -r1.2 -r1.3 --- sysio-symbols.h 7 Mar 2003 03:31:36 -0000 1.2 +++ sysio-symbols.h 27 Apr 2004 22:13:01 -0000 1.3 @@ -2,11 +2,13 @@ #define HAVE_WEAK_SYMBOLS #endif +#define STRINGOF(x) #x + /* * Define alias, asym, as a strong alias for symbol, sym. */ #define sysio_sym_strong_alias(sym, asym) \ - extern __typeof(sym) asym __attribute__((alias(#sym))); + extern __typeof(sym) asym __attribute__((alias(STRINGOF(sym)))); #ifdef HAVE_WEAK_SYMBOLS @@ -14,7 +16,7 @@ * Define alias, asym, as a strong alias for symbol, sym. */ #define sysio_sym_weak_alias(sym, asym) \ - extern __typeof(sym) asym __attribute__((weak, alias(#sym))); + extern __typeof(sym) asym __attribute__((weak, alias(STRINGOF(sym)))); #else /* !defined(HAVE_ASM_WEAK_DIRECTIVE) */ /* Index: sysio.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -w -b -B -p -r1.19 -r1.20 --- sysio.h 31 Mar 2004 17:43:17 -0000 1.19 +++ sysio.h 27 Apr 2004 22:13:01 -0000 1.20 @@ -166,136 +166,170 @@ extern void _sysio_shutdown(void); extern int _sysio_boot(const char *buf); /* + * SYSIO name label macros + */ +#define XPREPEND(p,x) p ## x +#define PREPEND(p,x) XPREPEND(p,x) +#define SYSIO_LABEL_NAMES 0 +#if SYSIO_LABEL_NAMES +#define SYSIO_INTERFACE_NAME(x) PREPEND(sysio__,x) +#else +#define SYSIO_INTERFACE_NAME(x) x +#endif + +/* * The following should be defined by the system includes, and probably are, * but it's not illegal to have multiple externs, so long as they are the * same. It helps when building the library in a standalone fashion. */ -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 char *getcwd(char *buf, size_t size); -extern off_t lseek(int fd, off_t offset, int whence); +extern int SYSIO_INTERFACE_NAME(access)(const char *path, int amode); +extern int SYSIO_INTERFACE_NAME(chdir)(const char *path); +extern int SYSIO_INTERFACE_NAME(chmod)(const char *path, mode_t mode); +extern int SYSIO_INTERFACE_NAME(fchmod)(int fd, mode_t mode); +extern int SYSIO_INTERFACE_NAME(chown)(const char *path, uid_t owner, + gid_t group); +extern int SYSIO_INTERFACE_NAME(fchown)(int fd, uid_t owner, gid_t group); +extern int SYSIO_INTERFACE_NAME(close)(int d); +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(fstat)(int fd, struct stat *buf); +extern int SYSIO_INTERFACE_NAME(fsync)(int fd); +extern char *SYSIO_INTERFACE_NAME(getcwd)(char *buf, size_t size); +extern off_t SYSIO_INTERFACE_NAME(lseek)(int fd, off_t offset, int whence); #if _LARGEFILE64_SOURCE -extern off64_t lseek64(int fd, off64_t offset, int whence); +extern off64_t SYSIO_INTERFACE_NAME(lseek64)(int fd, off64_t offset, + int whence); #endif -extern int lstat(const char *path, struct stat *buf); +extern int SYSIO_INTERFACE_NAME(lstat)(const char *path, struct stat *buf); #ifdef BSD -extern int getdirentries(int fd, char *buf, int nbytes , long *basep); +extern int SYSIO_INTERFACE_NAME(getdirentries)(int fd, char *buf, int nbytes , + long *basep); #else -extern ssize_t getdirentries(int fd, char *buf, size_t nbytes, off_t *basep); +extern ssize_t SYSIO_INTERFACE_NAME(getdirentries)(int fd, char *buf, + size_t nbytes, off_t *basep); #if _LARGEFILE64_SOURCE -extern ssize_t getdirentries64(int fd, +extern ssize_t SYSIO_INTERFACE_NAME(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, ...); +extern int SYSIO_INTERFACE_NAME(mkdir)(const char *path, mode_t mode); +extern int SYSIO_INTERFACE_NAME(open)(const char *path, int flag, ...); #if _LARGEFILE64_SOURCE -extern int open64(const char *path, int flag, ...); +extern int SYSIO_INTERFACE_NAME(open64)(const char *path, int flag, ...); #endif -extern int creat(const char *path, mode_t mode); +extern int SYSIO_INTERFACE_NAME(creat)(const char *path, mode_t mode); #if _LARGEFILE64_SOURCE -extern int creat64(const char *path, mode_t mode); +extern int SYSIO_INTERFACE_NAME(creat64)(const char *path, mode_t mode); #endif -extern int stat(const char *path, struct stat *buf); +extern int SYSIO_INTERFACE_NAME(stat)(const char *path, struct stat *buf); #if _LARGEFILE64_SOURCE -extern int stat64(const char *path, struct stat64 *buf); +extern int SYSIO_INTERFACE_NAME(stat64)(const char *path, struct stat64 *buf); #endif #ifdef _HAVE_STATVFS -extern int statvfs(const char *path, struct statvfs *buf); +extern int SYSIO_INTERFACE_NAME(statvfs)(const char *path, struct statvfs *buf); #if _LARGEFILE64_SOURCE -extern int statvfs64(const char *path, struct statvfs64 *buf); +extern int SYSIO_INTERFACE_NAME(statvfs64)(const char *path, + struct statvfs64 *buf); #endif -extern int fstatvfs(int fd, struct statvfs *buf); +extern int SYSIO_INTERFACE_NAME(fstatvfs)(int fd, struct statvfs *buf); #if _LARGEFILE64_SOURCE -extern int fstatvfs64(int fd, struct statvfs64 *buf); -#endif +extern int SYSIO_INTERFACE_NAME(fstatvfs64)(int fd, struct statvfs64 *buf); #endif -extern int truncate(const char *path, off_t length); -#if _LARGEFILE64_SOURCE -extern int truncate64(const char *path, off64_t length); -#endif -extern int ftruncate(int fd, off_t length); -#if _LARGEFILE64_SOURCE -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); -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); -#if _LARGEFILE64_SOURCE -extern ioid_t ipread64v(int fd, const struct iovec *iov, size_t count, - off64_t offset); #endif -extern ioid_t ipread(int fd, void *buf, size_t count, off_t offset); +extern int SYSIO_INTERFACE_NAME(truncate)(const char *path, off_t length); #if _LARGEFILE64_SOURCE -extern ioid_t ipread64(int fd, void *buf, size_t count, off64_t offset); +extern int SYSIO_INTERFACE_NAME(truncate64)(const char *path, off64_t length); #endif -extern ssize_t preadv(int fd, const struct iovec *iov, size_t count, - off_t offset); +extern int SYSIO_INTERFACE_NAME(ftruncate)(int fd, off_t length); #if _LARGEFILE64_SOURCE -extern ssize_t pread64v(int fd, const struct iovec *iov, size_t count, - off64_t offset); +extern int SYSIO_INTERFACE_NAME(ftruncate64)(int fd, off64_t length); #endif -extern ssize_t pread(int fd, void *buf, size_t count, off_t offset); +extern int SYSIO_INTERFACE_NAME(rmdir)(const char *path); +extern int SYSIO_INTERFACE_NAME(symlink)(const char *path1, const char *path2); +extern int SYSIO_INTERFACE_NAME(link)(const char *oldpath, const char *newpath); +extern int SYSIO_INTERFACE_NAME(unlink)(const char *path); +extern int SYSIO_INTERFACE_NAME(rename)(const char *oldpath, + const char *newpath); +extern int SYSIO_INTERFACE_NAME(fdatasync)(int fd); +extern int SYSIO_INTERFACE_NAME(ioctl)(int fd, unsigned long request, ...); +extern mode_t SYSIO_INTERFACE_NAME(umask)(mode_t mask); +extern int SYSIO_INTERFACE_NAME(iodone)(ioid_t ioid); +extern ssize_t SYSIO_INTERFACE_NAME(iowait)(ioid_t ioid); +extern ioid_t SYSIO_INTERFACE_NAME(ipreadv)(int fd, const struct iovec *iov, + size_t count, off_t offset); #if _LARGEFILE64_SOURCE -extern ssize_t pread64(int fd, void *buf, size_t count, off64_t offset); +extern ioid_t SYSIO_INTERFACE_NAME(ipread64v)(int fd, const struct iovec *iov, + 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); -extern ioid_t ipwritev(int fd, const struct iovec *iov, size_t count, +extern ioid_t SYSIO_INTERFACE_NAME(ipread)(int fd, void *buf, size_t count, off_t offset); #if _LARGEFILE64_SOURCE -extern ioid_t ipwrite64v(int fd, const struct iovec *iov, size_t count, +extern ioid_t SYSIO_INTERFACE_NAME(ipread64)(int fd, void *buf, size_t count, off64_t offset); #endif -extern ioid_t ipwrite(int fd, const void *buf, size_t count, off_t offset); +extern ssize_t SYSIO_INTERFACE_NAME(preadv)(int fd, const struct iovec *iov, + size_t count, off_t offset); #if _LARGEFILE64_SOURCE -extern ioid_t ipwrite64(int fd, const void *buf, size_t count, off64_t offset); +extern ssize_t SYSIO_INTERFACE_NAME(pread64v)(int fd, const struct iovec *iov, + size_t count, off64_t offset); #endif -extern ssize_t pwritev(int fd, const struct iovec *iov, size_t count, +extern ssize_t SYSIO_INTERFACE_NAME(pread)(int fd, void *buf, size_t count, off_t offset); #if _LARGEFILE64_SOURCE -extern ssize_t pwrite64v(int fd, const struct iovec *iov, size_t count, +extern ssize_t SYSIO_INTERFACE_NAME(pread64)(int fd, void *buf, size_t count, off64_t offset); #endif -extern ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset); -#if _LARGEFILE64_SOURCE -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); -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, +extern ioid_t SYSIO_INTERFACE_NAME(ireadv)(int fd, const struct iovec *iov, + int count); +extern ioid_t SYSIO_INTERFACE_NAME(iread)(int fd, void *buf, size_t count); +extern ssize_t SYSIO_INTERFACE_NAME(readv)(int fd, const struct iovec *iov, + int count); +extern ssize_t SYSIO_INTERFACE_NAME(read)(int fd, void *buf, size_t count); +extern ioid_t SYSIO_INTERFACE_NAME(ipwritev)(int fd, const struct iovec *iov, + size_t count, off_t offset); +#if _LARGEFILE64_SOURCE +extern ioid_t SYSIO_INTERFACE_NAME(ipwrite64v)(int fd, const struct iovec *iov, + size_t count, off64_t offset); +#endif +extern ioid_t SYSIO_INTERFACE_NAME(ipwrite)(int fd, const void *buf, + size_t count, off_t offset); +#if _LARGEFILE64_SOURCE +extern ioid_t SYSIO_INTERFACE_NAME(ipwrite64)(int fd, const void *buf, + size_t count, off64_t offset); +#endif +extern ssize_t SYSIO_INTERFACE_NAME(pwritev)(int fd, const struct iovec *iov, + size_t count, off_t offset); +#if _LARGEFILE64_SOURCE +extern ssize_t SYSIO_INTERFACE_NAME(pwrite64v)(int fd, const struct iovec *iov, + size_t count, off64_t offset); +#endif +extern ssize_t SYSIO_INTERFACE_NAME(pwrite)(int fd, const void *buf, + size_t count, off_t offset); +#if _LARGEFILE64_SOURCE +extern ssize_t SYSIO_INTERFACE_NAME(pwrite64)(int fd, const void *buf, + size_t count, off64_t offset); +#endif +extern ioid_t SYSIO_INTERFACE_NAME(iwritev)(int fd, + const struct iovec *iov, + int count); +extern ioid_t SYSIO_INTERFACE_NAME(iwrite)(int fd, const void *buf, + size_t count); +extern ssize_t SYSIO_INTERFACE_NAME(writev)(int fd, const struct iovec *iov, + int count); +extern ssize_t SYSIO_INTERFACE_NAME(write)(int fd, const void *buf, + size_t count); +extern int SYSIO_INTERFACE_NAME(mknod)(const char *path, + mode_t mode, dev_t dev); +extern int SYSIO_INTERFACE_NAME(utime)(const char *path, + const struct utimbuf *buf); +extern int SYSIO_INTERFACE_NAME(mount)(const char *source, const char *target, const char *filesystemtype, unsigned long mountflags, const void *data); -extern int umount(const char *target); +extern int SYSIO_INTERFACE_NAME(umount)(const char *target); /* for debugging */ #if 0 @@ -316,6 +350,23 @@ extern int umount(const char *target); #define ASSERT do{}while(0) #endif +/* + * SYSIO interface frame macros + */ +#define SYSIO_INTERFACE_DISPLAY_BLOCK \ + int _saved_errno; +#define SYSIO_INTERFACE_ENTER \ + do { \ + _saved_errno = errno; \ + SYSIO_ENTER; \ + } while (0) +#define SYSIO_INTERFACE_RETURN(rtn, err) \ + do { \ + SYSIO_LEAVE; \ + if (err == 0) errno = _saved_errno; \ + return (rtn); \ + } while(0) + /* syscall enter/leave hook functions */ #if 0 extern void _sysio_sysenter(); Index: xtio.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/xtio.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -b -B -p -r1.2 -r1.3 --- xtio.h 6 Feb 2004 20:07:29 -0000 1.2 +++ xtio.h 27 Apr 2004 22:13:01 -0000 1.3 @@ -60,35 +60,51 @@ struct xtvec64 { }; #endif -extern ioid_t ireadx(int fd, - const struct iovec *iov, size_t iov_count, - const struct xtvec *xtv, size_t xtv_count); +extern ioid_t SYSIO_INTERFACE_NAME(ireadx)(int fd, + const struct iovec *iov, + size_t iov_count, + const struct xtvec *xtv, + size_t xtv_count); #ifdef __USE_LARGEFILE64 -extern ioid_t iread64x(int fd, - const struct iovec *iov, size_t iov_count, - const struct xtvec64 *xtv, size_t xtv_count); +extern ioid_t SYSIO_INTERFACE_NAME(iread64x)(int fd, + const struct iovec *iov, + size_t iov_count, + const struct xtvec64 *xtv, + size_t xtv_count); #endif -extern ssize_t readx(int fd, - const struct iovec *iov, size_t iov_count, - const struct xtvec *xtv, size_t xtv_count); +extern ssize_t SYSIO_INTERFACE_NAME(readx)(int fd, + const struct iovec *iov, + size_t iov_count, + const struct xtvec *xtv, + size_t xtv_count); #ifdef __USE_LARGEFILE64 -extern ssize_t read64x(int fd, - const struct iovec *iov, size_t iov_count, - const struct xtvec64 *xtv, size_t xtv_count); +extern ssize_t SYSIO_INTERFACE_NAME(read64x)(int fd, + const struct iovec *iov, + size_t iov_count, + const struct xtvec64 *xtv, + size_t xtv_count); #endif -extern ioid_t iwritex(int fd, - const struct iovec *iov, size_t iov_count, - const struct xtvec *xtv, size_t xtv_count); +extern ioid_t SYSIO_INTERFACE_NAME(iwritex)(int fd, + const struct iovec *iov, + size_t iov_count, + const struct xtvec *xtv, + size_t xtv_count); #ifdef __USE_LARGEFILE64 -extern ioid_t iwrite64x(int fd, - const struct iovec *iov, size_t iov_count, - const struct xtvec64 *xtv, size_t xtv_count); +extern ioid_t SYSIO_INTERFACE_NAME(iwrite64x)(int fd, + const struct iovec *iov, + size_t iov_count, + const struct xtvec64 *xtv, + size_t xtv_count); #endif -extern ssize_t writex(int fd, - const struct iovec *iov, size_t iov_count, - const struct xtvec *xtv, size_t xtv_count); +extern ssize_t SYSIO_INTERFACE_NAME(writex)(int fd, + const struct iovec *iov, + size_t iov_count, + const struct xtvec *xtv, + size_t xtv_count); #ifdef __USE_LARGEFILE64 -extern ssize_t write64x(int fd, - const struct iovec *iov, size_t iov_count, - const struct xtvec64 *xtv, size_t xtv_count); +extern ssize_t SYSIO_INTERFACE_NAME(write64x)(int fd, + const struct iovec *iov, + size_t iov_count, + const struct xtvec64 *xtv, + size_t xtv_count); #endif |
From: Ruth K. <rk...@us...> - 2004-04-27 22:11:30
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17893 Modified Files: access.c chdir.c chmod.c chown.c dup.c fcntl.c fsync.c getdirentries.c ioctl.c iowait.c link.c lseek.c mkdir.c mknod.c mount.c open.c rename.c rmdir.c rw.c stat.c stat64.c statvfs.c statvfs64.c symlink.c truncate.c unlink.c utime.c Log Message: From Cray 728488 MAJOR ERRNO=2/"NO SUCH FILE OR DIRECTORY" INSTEAD OF SUCCESS ON CREATE OPERATIONS Added macros to preserve the initial errno value across all successful calls. Also added macros to allow compile time construction of interface names unique to sysio library. This facility can be turned on by setting SYSIO_LABEL_NAMES to 1 in sysio.h. Index: access.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/access.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -b -B -p -r1.3 -r1.4 --- access.c 26 Jan 2004 16:34:54 -0000 1.3 +++ access.c 27 Apr 2004 22:10:54 -0000 1.4 @@ -48,16 +48,19 @@ #include <unistd.h> #include "sysio-symbols.h" +#include "sysio.h" int -access(const char *path, int amode) +SYSIO_INTERFACE_NAME(access)(const char *path, int amode) { gid_t *list, *entry; size_t n; int err = 0; unsigned mask, mode; struct stat stbuf; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = 0; n = getgroups(0, NULL); @@ -108,10 +111,10 @@ out: if (list) free(list); - return err; + SYSIO_INTERFACE_RETURN(err, err); } #ifdef REDSTORM #undef __access -sysio_sym_weak_alias(access, __access) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(access), __access) #endif Index: chdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chdir.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -w -b -B -p -r1.14 -r1.15 --- chdir.c 31 Mar 2004 17:43:18 -0000 1.14 +++ chdir.c 27 Apr 2004 22:10:55 -0000 1.15 @@ -114,29 +114,26 @@ _sysio_p_chdir(struct pnode *pno) } int -chdir(const char *path) +SYSIO_INTERFACE_NAME(chdir)(const char *path) { int err; struct pnode *pno; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); if (err) { errno = -err; - SYSIO_LEAVE; - return -1; + SYSIO_INTERFACE_RETURN(-1, err); } err = _sysio_p_chdir(pno); - if (err) - P_RELE(pno); - - SYSIO_LEAVE; if (err) { + P_RELE(pno); errno = -err; err = -1; } - return err; + SYSIO_INTERFACE_RETURN(err, err); } #ifdef REDSTORM @@ -232,28 +229,27 @@ _sysio_p_path(struct pnode *pno, char ** } char * -getcwd(char *buf, size_t size) +SYSIO_INTERFACE_NAME(getcwd)(char *buf, size_t size) { int err; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = _sysio_p_path(_sysio_cwd, &buf, buf ? size : 0); if (err) { errno = -err; - SYSIO_LEAVE; - return NULL; + SYSIO_INTERFACE_RETURN(NULL, err); } - SYSIO_LEAVE; - return buf; + SYSIO_INTERFACE_RETURN(buf, err); } #ifdef __GLIBC__ -sysio_sym_weak_alias(getcwd, __getcwd) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(getcwd), __getcwd) #endif #if defined(PATH_MAX) && !(defined(REDSTORM)) char * -getwd(char *buf) +SYSIO_INTERFACE_NAME(getwd)(char *buf) { if (!buf) { Index: chmod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chmod.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -b -B -p -r1.7 -r1.8 --- chmod.c 25 Feb 2004 16:23:59 -0000 1.7 +++ chmod.c 27 Apr 2004 22:10:55 -0000 1.8 @@ -69,12 +69,13 @@ do_chmod(struct pnode *pno, struct inode } int -chmod(const char *path, mode_t mode) +SYSIO_INTERFACE_NAME(chmod)(const char *path, mode_t mode) { int err; struct pnode *pno; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); if (err) goto out; @@ -85,21 +86,22 @@ out: errno = -err; err = -1; } - SYSIO_LEAVE; - return err; + SYSIO_INTERFACE_RETURN(err, err); } #ifdef REDSTORM #undef __chmod -sysio_sym_weak_alias(chmod, __chmod) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(chmod)), __chmod) #endif int -fchmod(int fd, mode_t mode) +SYSIO_INTERFACE_NAME(fchmod)(int fd, mode_t mode) { int err; struct file *fil; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = 0; fil = _sysio_fd_find(fd); if (!fil) { @@ -113,10 +115,10 @@ out: errno = -err; err = -1; } - return err; + SYSIO_INTERFACE_RETURN(err, err); } #ifdef REDSTORM #undef __fchmod -sysio_sym_weak_alias(fchmod, __fchmod) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(fchmod)), __chmod) #endif Index: chown.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chown.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -b -B -p -r1.7 -r1.8 --- chown.c 31 Mar 2004 17:43:18 -0000 1.7 +++ chown.c 27 Apr 2004 22:10:55 -0000 1.8 @@ -60,7 +60,6 @@ _do_chown(struct pnode *pno, struct inod int err; struct intnl_stat stbuf; unsigned mask; - SYSIO_ENTER; (void )memset(&stbuf, 0, sizeof(struct intnl_stat)); mask = 0; @@ -77,11 +76,13 @@ _do_chown(struct pnode *pno, struct inod } int -chown(const char *path, uid_t owner, gid_t group) +SYSIO_INTERFACE_NAME(chown)(const char *path, uid_t owner, gid_t group) { int err; struct pnode *pno; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); if (err) goto out; @@ -93,21 +94,23 @@ out: errno = -err; err = -1; } - SYSIO_LEAVE; - return err; + + SYSIO_INTERFACE_RETURN(err, err); } #ifdef REDSTORM #undef __chown -sysio_sym_weak_alias(chown, __chown) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(chown)), __chown) #endif int -fchown(int fd, uid_t owner, gid_t group) +SYSIO_INTERFACE_NAME(fchown)(int fd, uid_t owner, gid_t group) { int err; struct file *fil; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = 0; fil = _sysio_fd_find(fd); if (!fil) { @@ -122,11 +125,11 @@ out: err = -1; } - return err; + SYSIO_INTERFACE_RETURN(err, err); } #ifdef REDSTORM #undef __fchown -sysio_sym_weak_alias(fchown, __fchown) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(fchown)), __fchown) #endif Index: dup.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/dup.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -b -B -p -r1.5 -r1.6 --- dup.c 6 Feb 2004 20:07:30 -0000 1.5 +++ dup.c 27 Apr 2004 22:10:55 -0000 1.6 @@ -50,56 +50,54 @@ #include "file.h" #include "sysio-symbols.h" -#include "sysio-symbols.h" - int -dup2(int oldfd, int newfd) +SYSIO_INTERFACE_NAME(dup2)(int oldfd, int newfd) { int rc; - SYSIO_ENTER; + int err; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; + err = 0; if (newfd < 0) { errno = EBADF; - SYSIO_LEAVE; - return -1; + SYSIO_INTERFACE_RETURN(-1, -EBADF); } - if (oldfd == newfd) { - SYSIO_LEAVE; - return newfd; - } + if (oldfd == newfd) + SYSIO_INTERFACE_RETURN(newfd, 0); rc = _sysio_fd_dup2(oldfd, newfd); if (rc < 0) { - errno = -rc; + errno = err = -rc; rc = -1; } - SYSIO_LEAVE; - return rc; + SYSIO_INTERFACE_RETURN(rc, err); } #ifdef REDSTORM #undef __dup2 -sysio_sym_weak_alias(dup2, __dup2) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(dup2), __dup2) #endif int -dup(int oldfd) +SYSIO_INTERFACE_NAME(dup)(int oldfd) { int rc; - SYSIO_ENTER; + int err; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; + err = 0; rc = _sysio_fd_dup2(oldfd, -1); if (rc < 0) { - errno = -rc; + errno = err = -rc; rc = -1; } - - SYSIO_LEAVE; - return rc; + SYSIO_INTERFACE_RETURN(rc, err); } #ifdef __GLIBC__ #undef __dup -sysio_sym_weak_alias(dup, __dup) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(dup), __dup) #endif Index: fcntl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fcntl.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -w -b -B -p -r1.8 -r1.9 --- fcntl.c 26 Jan 2004 16:34:54 -0000 1.8 +++ fcntl.c 27 Apr 2004 22:10:55 -0000 1.9 @@ -54,13 +54,14 @@ #include "sysio-symbols.h" int -fcntl(int fd, int cmd, ...) +SYSIO_INTERFACE_NAME(fcntl)(int fd, int cmd, ...) { int err; struct file *fil; va_list ap; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = 0; fil = _sysio_fd_find(fd); if (!fil) { @@ -84,8 +85,7 @@ fcntl(int fd, int cmd, ...) } rc = _sysio_fd_dup2(fd, (int )newfd); - SYSIO_LEAVE; - return rc; + SYSIO_INTERFACE_RETURN(rc, err); } break; default: @@ -100,16 +100,15 @@ out: errno = -err; err = -1; } - SYSIO_LEAVE; - return err; + SYSIO_INTERFACE_RETURN(err, err); } #ifdef __GLIBC__ #undef __fcntl -sysio_sym_weak_alias(fcntl, __fcntl) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(fcntl), __fcntl) #endif #ifdef BSD #undef _fcntl -sysio_sym_weak_alias(fcntl, _fcntl) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(fcntl), _fcntl) #endif Index: fsync.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fsync.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -b -B -p -r1.3 -r1.4 --- fsync.c 21 Jan 2004 14:44:53 -0000 1.3 +++ fsync.c 27 Apr 2004 22:10:55 -0000 1.4 @@ -51,49 +51,43 @@ #include "inode.h" int -fsync(int fd) +SYSIO_INTERFACE_NAME(fsync)(int fd) { struct file *fil; int err; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find(fd); if (!(fil && fil->f_ino)) { errno = -EBADF; - SYSIO_LEAVE; - return -1; + SYSIO_INTERFACE_RETURN(-1, -EBADF); } err = (*fil->f_ino->i_ops.inop_sync)(fil->f_ino); if (err) { errno = -err; - SYSIO_LEAVE; - return -1; + SYSIO_INTERFACE_RETURN(-1, err); } - - SYSIO_LEAVE; - return 0; + SYSIO_INTERFACE_RETURN(err, err); } int -fdatasync(int fd) +SYSIO_INTERFACE_NAME(fdatasync)(int fd) { struct file *fil; int err; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find(fd); if (!(fil && fil->f_ino)) { errno = -EBADF; - SYSIO_LEAVE; - return -1; + SYSIO_INTERFACE_RETURN(-1, -EBADF); } err = (*fil->f_ino->i_ops.inop_datasync)(fil->f_ino); if (err) { errno = -err; - SYSIO_LEAVE; - return -1; + SYSIO_INTERFACE_RETURN(-1, err); } - - SYSIO_LEAVE; - return 0; + SYSIO_INTERFACE_RETURN(err, err); } Index: getdirentries.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/getdirentries.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -b -B -p -r1.11 -r1.12 --- getdirentries.c 14 Apr 2004 16:05:36 -0000 1.11 +++ getdirentries.c 27 Apr 2004 22:10:55 -0000 1.12 @@ -119,7 +119,7 @@ _getdirentries64(int fd, #if _LARGEFILE64_SOURCE #undef getdirentries64 -sysio_sym_strong_alias(_getdirentries64, getdirentries64) +sysio_sym_strong_alias(_getdirentries64, SYSIO_INTERFACE_NAME(getdirentries64)) #endif #undef getdirentries @@ -143,13 +143,13 @@ sysio_sym_strong_alias(_getdirentries64, #ifndef BSD ssize_t -getdirentries(int fd, +SYSIO_INTERFACE_NAME(getdirentries)(int fd, char *buf, size_t nbytes, off_t * __restrict basep) #else int -getdirentries(int fd, +SYSIO_INTERFACE_NAME(getdirentries)(int fd, char *buf, int nbytes, long * __restrict basep) @@ -167,7 +167,7 @@ getdirentries(int fd, size_t n; size_t reclen; char *cp; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; #define _dbaselen ((size_t )&((struct dirent *)0)->d_name[0]) @@ -188,6 +188,7 @@ getdirentries(int fd, #define _fast_free(p) free(p) #endif + SYSIO_INTERFACE_ENTER; #if defined(BSD) || defined(REDSTORM) if (nbytes < 0) { errno = -EINVAL; @@ -277,8 +278,7 @@ out: if (dp == (struct dirent *)buf && cc < 0) { errno = (int )-cc; - SYSIO_LEAVE; - return -1; + SYSIO_INTERFACE_RETURN(-1, cc); } cc = (char *)dp - buf; if (cc) @@ -288,8 +288,7 @@ out: #else off; #endif - SYSIO_LEAVE; - return cc; + SYSIO_INTERFACE_RETURN(cc, cc >= 0 ? 0 : -1); #ifdef __GLIBC__ #undef _fast_alloc @@ -304,9 +303,9 @@ sysio_sym_strong_alias(_getdirentries64, #ifdef REDSTORM #undef __getdirentries -sysio_sym_weak_alias(getdirentries, __getdirentries) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(getdirentries)), __getdirentries) #endif #if defined(BSD) || defined(REDSTORM) #undef _getdirentries -sysio_sym_weak_alias(getdirentries, _getdirentries) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(getdirentries)), _getdirentries) #endif Index: ioctl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctl.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -w -b -B -p -r1.6 -r1.7 --- ioctl.c 26 Jan 2004 16:34:54 -0000 1.6 +++ ioctl.c 27 Apr 2004 22:10:55 -0000 1.7 @@ -53,13 +53,14 @@ #include "sysio-symbols.h" int -ioctl(int fd, unsigned long request, ...) +SYSIO_INTERFACE_NAME(ioctl)(int fd, unsigned long request, ...) { int err; struct file *fil; va_list ap; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = 0; fil = _sysio_fd_find(fd); if (!fil) { @@ -72,21 +73,20 @@ ioctl(int fd, unsigned long request, ... va_end(ap); out: - if (err) { + if (err < 0) { errno = -err; err = -1; } - SYSIO_LEAVE; - return err; + SYSIO_INTERFACE_RETURN(err, err); } #ifdef __GLIBC__ #undef __ioctl -sysio_sym_weak_alias(ioctl, __ioctl) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(ioctl), __ioctl) #endif #ifdef BSD #undef _ioctl -sysio_sym_weak_alias(ioctl, _ioctl) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(ioctl), _ioctl) #endif Index: iowait.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/iowait.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -b -B -p -r1.5 -r1.6 --- iowait.c 21 Jan 2004 14:44:53 -0000 1.5 +++ iowait.c 27 Apr 2004 22:10:55 -0000 1.6 @@ -67,22 +67,21 @@ lookup_ioid(ioid_t ioid) * Poll status of asynch IO request. */ int -iodone(ioid_t ioid) +SYSIO_INTERFACE_NAME(iodone)(ioid_t ioid) { struct ioctx *ioctx; int rc; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; ioctx = lookup_ioid(ioid); - if (!ioctx) { - SYSIO_LEAVE; - return -1; - } + if (!ioctx) + SYSIO_INTERFACE_RETURN(-1, -1); rc = (ioctx->ioctx_done || (*ioctx->ioctx_ino->i_ops.inop_iodone)(ioctx)); - SYSIO_LEAVE; - return rc; + + SYSIO_INTERFACE_RETURN(rc, rc >= 0 ? 0 : -1); } /* @@ -92,23 +91,21 @@ iodone(ioid_t ioid) * The identifier is no longer valid after return. */ ssize_t -iowait(ioid_t ioid) +SYSIO_INTERFACE_NAME(iowait)(ioid_t ioid) { struct ioctx *ioctx; ssize_t cc; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; ioctx = lookup_ioid(ioid); - if (!ioctx) { - SYSIO_LEAVE; - return -1; - } + if (!ioctx) + SYSIO_INTERFACE_RETURN(-1, -1); cc = _sysio_ioctx_wait(ioctx); if (cc < 0) { errno = -(int )cc; cc = -1; } - SYSIO_LEAVE; - return cc; + SYSIO_INTERFACE_RETURN(cc, cc >= 0 ? 0 : -1); } Index: link.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/link.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -b -B -p -r1.5 -r1.6 --- link.c 27 Apr 2004 16:03:17 -0000 1.5 +++ link.c 27 Apr 2004 22:10:55 -0000 1.6 @@ -55,12 +55,14 @@ #include "sysio-symbols.h" int -link(const char *oldpath, const char *newpath) +SYSIO_INTERFACE_NAME(link)(const char *oldpath, const char *newpath) { struct intent intent; int err; struct pnode *old, *new; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; INTENT_INIT(&intent, 0, NULL, NULL); err = _sysio_namei(_sysio_cwd, oldpath, 0, &intent, &old); if (err) @@ -101,10 +103,10 @@ out: errno = -err; err = -1; } - return err; + SYSIO_INTERFACE_RETURN(err, err); } #ifdef REDSTORM #undef __link -sysio_sym_weak_alias(link, __link) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(link), __link) #endif Index: lseek.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/lseek.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -w -b -B -p -r1.15 -r1.16 --- lseek.c 16 Apr 2004 20:38:34 -0000 1.15 +++ lseek.c 27 Apr 2004 22:10:55 -0000 1.16 @@ -60,7 +60,9 @@ _sysio_lseek(int fd, _SYSIO_OFF_T offset struct file *fil; _SYSIO_OFF_T off, pos; struct intnl_stat stbuf; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find(fd); if (!fil) return -EBADF; @@ -83,7 +85,8 @@ _sysio_lseek(int fd, _SYSIO_OFF_T offset fil->f_ino, &stbuf); if (err) - return err; + SYSIO_INTERFACE_RETURN(err, err); + } off = stbuf.st_size; break; @@ -93,24 +96,26 @@ _sysio_lseek(int fd, _SYSIO_OFF_T offset pos = off + offset; if ((offset < 0 && -offset >= off) || (offset > 0 && pos <= off)) - return -EINVAL; + SYSIO_INTERFACE_RETURN(-EINVAL, -EINVAL); + #ifdef O_LARGEFILE if (pos >= ((fil->f_flags & O_LARGEFILE) ? _SYSIO_OFF_T_MAX : LONG_MAX)) - return -EOVERFLOW; + SYSIO_INTERFACE_RETURN(-EOVERFLOW, -EOVERFLOW); #else if (pos >= _SYSIO_OFF_T_MAX) - return -EOVERFLOW; + SYSIO_INTERFACE_RETURN(-EOVERFLOW, -EOVERFLOW); #endif pos = (fil->f_ino->i_ops.inop_pos)(fil->f_ino, pos); if (pos < 0) return pos; + fil->f_pos = pos; - return fil->f_pos = pos; + SYSIO_INTERFACE_RETURN(pos, -1); } #if _LARGEFILE64_SOURCE #undef lseek64 -sysio_sym_weak_alias(_sysio_lseek, lseek64) +sysio_sym_weak_alias(_sysio_lseek, SYSIO_INTERFACE_NAME(lseek64)) #ifdef __GLIBC__ #undef __lseek64 sysio_sym_weak_alias(_sysio_lseek, __lseek64) @@ -124,34 +129,33 @@ sysio_sym_weak_alias(_sysio_lseek, __lib #undef lseek extern off_t -lseek(int fd, off_t offset, int whence) +SYSIO_INTERFACE_NAME(lseek)(int fd, off_t offset, int whence) { _SYSIO_OFF_T off; off_t rtn; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; off = _sysio_lseek(fd, offset, whence); if (off < 0) { errno = -off; - SYSIO_LEAVE; - return -1; + SYSIO_INTERFACE_RETURN((off_t )-1, off); } rtn = (off_t )off; assert(rtn == off); - SYSIO_LEAVE; - return rtn; + SYSIO_INTERFACE_RETURN(rtn, 0); } #ifdef __GLIBC__ #undef __lseek -sysio_sym_weak_alias(lseek, __lseek) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(lseek), __lseek) #endif #if 0 #ifdef __linux__ #undef llseek int -llseek(unsigned int fd __IS_UNUSED, +SYSIO_INTERFACE_NAME(llseek)(unsigned int fd __IS_UNUSED, unsigned long offset_high __IS_UNUSED, unsigned long offset_low __IS_UNUSED, loff_t *result __IS_UNUSED, @@ -166,6 +170,6 @@ llseek(unsigned int fd __IS_UNUSED, } #undef __llseek -sysio_sym_weak_alias(llseek, __llseek) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(llseek), __llseek) #endif #endif Index: mkdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mkdir.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -w -b -B -p -r1.6 -r1.7 --- mkdir.c 6 Feb 2004 20:07:30 -0000 1.6 +++ mkdir.c 27 Apr 2004 22:10:55 -0000 1.7 @@ -54,13 +54,14 @@ #include "sysio-symbols.h" int -mkdir(const char *path, mode_t mode) +SYSIO_INTERFACE_NAME(mkdir)(const char *path, mode_t mode) { int err; struct intent intent; struct pnode *pno; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; INTENT_INIT(&intent, INT_CREAT, &mode, NULL); err = _sysio_namei(_sysio_cwd, path, ND_NEGOK, &intent, &pno); if (err) @@ -82,12 +83,11 @@ out: errno = -err; err = -1; } - - SYSIO_LEAVE; - return err; + SYSIO_INTERFACE_RETURN(err, err); } #ifdef REDSTORM #undef __mkdir sysio_sym_weak_alias(mkdir, __mkdir) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(mkdir)), __mkdir) #endif Index: mknod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mknod.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- mknod.c 19 Apr 2004 19:54:25 -0000 1.10 +++ mknod.c 27 Apr 2004 22:10:55 -0000 1.11 @@ -67,12 +67,17 @@ #endif int -__xmknod(int __ver, const char *path, mode_t mode, dev_t *dev) +PREPEND(__,SYSIO_INTERFACE_NAME(xmknod))(int __ver, + const char *path, + mode_t mode, + dev_t *dev) { int err; struct intent intent; struct pnode *pno; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; if (__ver != _MKNOD_VER) { err = -ENOSYS; goto out; @@ -108,24 +113,28 @@ out: errno = -err; err = -1; } - return err; + SYSIO_INTERFACE_RETURN(err, err); } #ifdef REDSTORM #undef _xmknod -sysio_sym_weak_alias(__xmknod, _xmknod) +sysio_sym_weak_alias(PREPEND(__,SYSIO_INTERFACE_NAME(xmknod)), _xmknod) #endif static int -__mknod(const char *path, mode_t mode, dev_t dev) +PREPEND(__,SYSIO_INTERFACE_NAME(mknod))(const char *path, + mode_t mode, + dev_t dev) { int rc; - SYSIO_ENTER; - rc = __xmknod(_MKNOD_VER, path, mode, &dev); + rc = PREPEND(__,SYSIO_INTERFACE_NAME(xmknod))(_MKNOD_VER, + path, + mode, + &dev); - SYSIO_LEAVE; return rc; } -sysio_sym_weak_alias(__mknod, mknod) +sysio_sym_weak_alias(PREPEND(__,SYSIO_INTERFACE_NAME(mknod)), \ + SYSIO_INTERFACE_NAME(mknod)) Index: mount.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mount.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -b -B -p -r1.11 -r1.12 --- mount.c 14 Feb 2004 19:42:59 -0000 1.11 +++ mount.c 27 Apr 2004 22:10:55 -0000 1.12 @@ -323,14 +323,16 @@ _sysio_mount(struct pnode *cwd, } int -mount(const char *source, +SYSIO_INTERFACE_NAME(mount)(const char *source, const char *target, const char *filesystemtype, unsigned long mountflags, const void *data) { int err; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = _sysio_mount(_sysio_cwd, source, @@ -342,15 +344,17 @@ mount(const char *source, errno = -err; err = -1; } - return err; + SYSIO_INTERFACE_RETURN(err, err); } int -umount(const char *target) +SYSIO_INTERFACE_NAME(umount)(const char *target) { int err; struct pnode *pno; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; /* * Look up the target path node. */ @@ -376,7 +380,7 @@ out: errno = -err; err = -1; } - return err; + SYSIO_INTERFACE_RETURN(err, err); } /* Index: open.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/open.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -w -b -B -p -r1.16 -r1.17 --- open.c 2 Apr 2004 14:27:46 -0000 1.16 +++ open.c 27 Apr 2004 22:10:55 -0000 1.17 @@ -127,7 +127,7 @@ _sysio_open(struct pnode *pno, int flags #undef open int -open(const char *path, int flags, ...) +SYSIO_INTERFACE_NAME(open)(const char *path, int flags, ...) { mode_t mode; unsigned ndflags; @@ -135,8 +135,9 @@ open(const char *path, int flags, ...) int err; struct pnode *pno; struct file *fil; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; /* * Get mode argument and determine parameters for namei */ @@ -207,8 +208,7 @@ open(const char *path, int flags, ...) P_RELE(pno); - SYSIO_LEAVE; - return err; + SYSIO_INTERFACE_RETURN(err, 0); error: if (fil) @@ -216,54 +216,53 @@ error: if (pno) P_RELE(pno); errno = -err; - SYSIO_LEAVE; - return -1; + SYSIO_INTERFACE_RETURN(-1, err); } #ifdef __GLIBC__ #undef __open -sysio_sym_weak_alias(open, __open) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(open), __open) #undef open64 -sysio_sym_weak_alias(open, open64) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(open), open64) #undef __open64 -sysio_sym_weak_alias(open, __open64) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(open), __open64) #endif #ifdef REDSTORM #undef __libc_open64 -sysio_sym_weak_alias(open, __libc_open64) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(open), __libc_open64) #endif #ifdef BSD #undef _open -sysio_sym_weak_alias(open, _open) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(open), _open) #endif int -close(int fd) +SYSIO_INTERFACE_NAME(close)(int fd) { int err; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = _sysio_fd_close(fd); if (err) errno = -err; - SYSIO_LEAVE; - return err ? -1 : 0; + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } #ifdef __GLIBC__ #undef __close -sysio_sym_weak_alias(close, __close) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(close), __close) #endif #ifdef BSD #undef _close -sysio_sym_weak_alias(close, _close) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(close), _close) #endif int -creat(const char *path, mode_t mode) +SYSIO_INTERFACE_NAME(creat)(const char *path, mode_t mode) { return open(path, O_CREAT|O_WRONLY|O_TRUNC, mode); @@ -271,25 +270,25 @@ creat(const char *path, mode_t mode) #ifdef __GLIBC__ #undef __creat -sysio_sym_weak_alias(creat, __creat) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(creat), __creat) #undef creat64 -sysio_sym_weak_alias(creat, creat64) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(creat), creat64) #undef __creat64 -sysio_sym_weak_alias(creat, __creat64) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(creat), __creat64) #endif #ifdef REDSTORM #undef __libc_creat -sysio_sym_weak_alias(creat, __libc_creat) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(creat), __libc_creat) #endif #ifdef BSD #undef _creat -sysio_sym_weak_alias(creat, _creat) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(creat), _creat) #endif mode_t -umask(mode_t mask) +SYSIO_INTERFACE_NAME(umask)(mode_t mask) { mode_t omask; @@ -300,5 +299,5 @@ umask(mode_t mask) #ifdef REDSTORM #undef __umask -sysio_sym_weak_alias(umask, __umask) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(umask), __umask) #endif Index: rename.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rename.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -b -B -p -r1.3 -r1.4 --- rename.c 14 Feb 2004 19:42:59 -0000 1.3 +++ rename.c 27 Apr 2004 22:10:55 -0000 1.4 @@ -55,14 +55,16 @@ #include "inode.h" int -rename(const char *oldpath, const char *newpath) +SYSIO_INTERFACE_NAME(rename)(const char *oldpath, const char *newpath) { struct intent intent; int err; struct pnode *old, *new; struct pnode_base *nxtpb, *pb; struct intnl_stat ostbuf, nstbuf; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; /* * Resolve oldpath to a path node. */ @@ -178,5 +180,5 @@ error3: } _sysio_p_gone(old); /* kill it! */ out: - return err; + SYSIO_INTERFACE_RETURN(err, err); } Index: rmdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rmdir.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -b -B -p -r1.9 -r1.10 --- rmdir.c 26 Apr 2004 19:02:03 -0000 1.9 +++ rmdir.c 27 Apr 2004 22:10:55 -0000 1.10 @@ -60,8 +60,9 @@ rmdir(const char *path) int err; struct pnode *pno; struct inode *ino; + SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_ENTER; + SYSIO_INTERFACE_ENTER; INTENT_INIT(&intent, INT_UPDPARENT, NULL, NULL); err = _sysio_namei(_sysio_cwd, path, 0, &intent, &pno); if (err) @@ -90,12 +91,10 @@ out: errno = -err; err = -1; } - - SYSIO_LEAVE; - return err; + SYSIO_INTERFACE_RETURN(err, err); } #ifdef REDSTORM #undef __rmdir -sysio_sym_weak_alias(rmdir, __rmdir) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(rmdir)), __rmdir) #endif Index: rw.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rw.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -b -B -p -r1.5 -r1.6 --- rw.c 12 Apr 2004 15:40:58 -0000 1.5 +++ rw.c 27 Apr 2004 22:10:55 -0000 1.6 @@ -243,26 +243,25 @@ free_xtv(struct ioctx *ioctx) } ioid_t -ireadv(int fd, const struct iovec *iov, int count) +SYSIO_INTERFACE_NAME(ireadv)(int fd, const struct iovec *iov, int count) { struct file *fil; struct intnl_xtvec *xtv; struct ioctx *ioctx; int err; + SYSIO_INTERFACE_DISPLAY_BLOCK; [...1164 lines suppressed...] #if _LARGEFILE64_SOURCE -#undef iwrite64x +#undef write64x ssize_t -write64x(int fd, +SYSIO_INTERFACE_NAME(write64x)(int fd, const struct iovec *iov, size_t iov_count, const struct xtvec64 *xtv, size_t xtv_count) { ioid_t ioid; - if ((ioid = iwrite64x(fd, iov, iov_count, xtv, xtv_count)) == IOID_FAIL) + if ((ioid = SYSIO_INTERFACE_NAME(iwrite64x)(fd, + iov, + iov_count, + xtv, + xtv_count)) == IOID_FAIL) return -1; return iowait(ioid); } Index: stat.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/stat.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -b -B -p -r1.11 -r1.12 --- stat.c 15 Apr 2004 13:03:27 -0000 1.11 +++ stat.c 27 Apr 2004 22:10:57 -0000 1.12 @@ -90,7 +90,9 @@ convstat(struct stat64 *st64_buf, struct #endif int -__fxstat(int __ver, int __fildes, struct stat *__stat_buf) +PREPEND(__,SYSIO_INTERFACE_NAME(fxstat))(int __ver, + int __fildes, + struct stat *__stat_buf) { struct file *fil; int err; @@ -98,7 +100,9 @@ __fxstat(int __ver, int __fildes, struct #if _LARGEFILE64_SOURCE struct stat64 st64; #endif + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; if (__ver != _STAT_VER) { err = -ENOSYS; goto out; @@ -125,37 +129,42 @@ out: #if _LARGEFILE64_SOURCE convstat(buf, __stat_buf); #endif - return err; + SYSIO_INTERFACE_RETURN(err, err); } #ifdef REDSTORM #undef _fxstat -sysio_sym_weak_alias(__fxstat, _fxstat) +sysio_sym_weak_alias(PREPEND(__,SYSIO_INTERFACE_NAME(fxstat)), _fxstat) #endif #ifndef REDSTORM static int -__fstat(int fd, struct stat *buf) +PREPEND(__,SYSIO_INTERFACE_NAME(fstat))(int fd, struct stat *buf) { int rc; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; - rc = __fxstat(_STAT_VER, fd, buf); + SYSIO_INTERFACE_ENTER; + rc = PREPEND(__,SYSIO_INTERFACE_NAME(fxstat))(_STAT_VER, + fd, + buf); - SYSIO_LEAVE; - return rc; + SYSIO_INTERFACE_RETURN(rc, rc); } -sysio_sym_weak_alias(__fstat, fstat) +sysio_sym_weak_alias(PREPEND(__, SYSIO_INTERFACE_NAME(fstat)), + SYSIO_INTERFACE_NAME(fstat)) #ifdef BSD #undef _fstat -sysio_sym_weak_alias(__fstat, _fstat) +sysio_sym_weak_alias(PREPEND(__,SYSIO_INTERFACE_NAME(fstat)), _fstat) #endif #endif int -__xstat(int __ver, const char *__filename, struct stat *__stat_buf) +PREPEND(__,SYSIO_INTERFACE_NAME(xstat))(int __ver, + const char *__filename, + struct stat *__stat_buf) { struct intent intent; int err; @@ -165,7 +174,9 @@ __xstat(int __ver, const char *__filenam #if _LARGEFILE64_SOURCE struct stat64 st64; #endif + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; if (__ver != _STAT_VER) { err = -ENOSYS; goto out; @@ -195,37 +206,43 @@ out: errno = -err; err = -1; } - return err; + SYSIO_INTERFACE_RETURN(err, err); } #ifdef REDSTORM #undef _xstat -sysio_sym_weak_alias(__xstat, _xstat) +sysio_sym_weak_alias(PREPEND(__,SYSIO_INTERFACE_NAME(xstat)), _xstat) #endif #ifndef REDSTORM static int -__stat(const char *filename, struct stat *buf) +PREPEND(__,SYSIO_INTERFACE_NAME(stat))(const char *filename, + struct stat *buf) { int rc; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; - rc = __xstat(_STAT_VER, filename, buf); + SYSIO_INTERFACE_ENTER; + rc = PREPEND(__,SYSIO_INTERFACE_NAME(xstat))(_STAT_VER, + filename, + buf); - SYSIO_LEAVE; - return rc; + SYSIO_INTERFACE_RETURN(rc, rc); } -sysio_sym_weak_alias(__stat, stat) +sysio_sym_weak_alias(PREPEND(__,SYSIO_INTERFACE_NAME(stat)), + SYSIO_INTERFACE_NAME(stat)) #ifdef BSD #undef _stat -sysio_sym_weak_alias(__stat, _stat) +sysio_sym_weak_alias(PREPEND(__,SYSIO_INTERFACE_NAME(stat)), _stat) #endif #endif int -__lxstat(int __ver, const char *__filename, struct stat *__stat_buf) +PREPEND(__,SYSIO_INTERFACE_NAME(lxstat))(int __ver, + const char *__filename, + struct stat *__stat_buf) { struct intent intent; int err; @@ -235,7 +252,9 @@ __lxstat(int __ver, const char *__filena #if _LARGEFILE64_SOURCE struct stat64 st64; #endif + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; if (__ver != _STAT_VER) { err = -ENOSYS; goto out; @@ -265,31 +284,33 @@ out: errno = -err; err = -1; } - return err; + SYSIO_INTERFACE_RETURN(err, err); } #ifdef REDSTORM #undef _lxstat -sysio_sym_weak_alias(__lxstat, _lxstat) +sysio_sym_weak_alias(PREPEND(__,SYSIO_INTERFACE_NAME(lxstat)), _lxstat) #endif #ifndef REDSTORM static int -__lstat(const char *filename, struct stat *buf) +PREPEND(__,SYSIO_INTERFACE_NAME(lstat))(const char *filename, struct stat *buf) { int rc; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; - rc = __lxstat(_STAT_VER, filename, buf); - - SYSIO_LEAVE; - return rc; + SYSIO_INTERFACE_ENTER; + rc = PREPEND(__,SYSIO_INTERFACE_NAME(lxstat))(_STAT_VER, + filename, + buf); + SYSIO_INTERFACE_RETURN(rc, rc); } -sysio_sym_weak_alias(__lstat, lstat) +sysio_sym_weak_alias(PREPEND(__,SYSIO_INTERFACE_NAME(lstat)), + SYSIO_INTERFACE_NAME(lstat)) #ifdef BSD #undef _lstat -sysio_sym_weak_alias(__lstat, _lstat) +sysio_sym_weak_alias(PREPEND(__,SYSIO_INTERFACE_NAME(lstat)), _lstat) #endif #endif Index: stat64.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/stat64.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -b -B -p -r1.7 -r1.8 --- stat64.c 15 Apr 2004 13:03:27 -0000 1.7 +++ stat64.c 27 Apr 2004 22:10:57 -0000 1.8 @@ -92,15 +92,15 @@ out: #ifndef REDSTORM int -fstat64(int fd, struct stat64 *buf) +SYSIO_INTERFACE_NAME(fstat64)(int fd, struct stat64 *buf) { int rc; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; rc = __fxstat64(_STAT_VER, fd, buf); - SYSIO_LEAVE; - return rc; + SYSIO_INTERFACE_RETURN(rc, rc); } #endif @@ -135,15 +135,15 @@ out: #ifndef REDSTORM int -stat64(const char *filename, struct stat64 *buf) +SYSIO_INTERFACE_NAME(stat64)(const char *filename, struct stat64 *buf) { int rc; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; rc = __xstat64(_STAT_VER, filename, buf); - SYSIO_LEAVE; - return rc; + SYSIO_INTERFACE_RETURN(rc, rc); } #endif @@ -178,15 +178,15 @@ out: #ifndef REDSTORM int -lstat64(const char *filename, struct stat64 *buf) +SYSIO_INTERFACE_NAME(lstat64)(const char *filename, struct stat64 *buf) { int rc; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; rc = __lxstat64(_STAT_VER, filename, buf); - SYSIO_LEAVE; - return rc; + SYSIO_INTERFACE_RETURN(rc, rc); } #endif #endif /* !_LARGEFILE64_SOURCE */ Index: statvfs.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/statvfs.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -b -B -p -r1.7 -r1.8 --- statvfs.c 24 Feb 2004 14:58:26 -0000 1.7 +++ statvfs.c 27 Apr 2004 22:10:57 -0000 1.8 @@ -77,7 +77,7 @@ convstatvfs(struct statvfs *stvfsbuf, st #endif int -statvfs(const char *path, struct statvfs *buf) +SYSIO_INTERFACE_NAME(statvfs)(const char *path, struct statvfs *buf) { int err; struct pnode *pno; @@ -87,8 +87,9 @@ statvfs(const char *path, struct statvfs struct intnl_statvfs _call_buffer; struct intnl_statvfs *_call_buf = &_call_buffer; #endif - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); if (err) goto out; @@ -105,17 +106,16 @@ err: errno = -err; err = -1; out: - SYSIO_LEAVE; - return err; + SYSIO_INTERFACE_RETURN(err, err); +} + #ifdef REDSTORM #undef __statvfs -sysio_sym_weak_alias(statvfs, __statvfs) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(statvfs), __statvfs) #endif -} - int -fstatvfs(int fd, struct statvfs *buf) +SYSIO_INTERFACE_NAME(fstatvfs)(int fd, struct statvfs *buf) { int err; struct file *filp; @@ -125,8 +125,9 @@ fstatvfs(int fd, struct statvfs *buf) struct intnl_statvfs _call_buffer; struct intnl_statvfs *_call_buf = &_call_buffer; #endif - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = 0; filp = _sysio_fd_find(fd); if (!filp) { @@ -145,13 +146,12 @@ err: errno = -err; err = -1; out: - SYSIO_LEAVE; - return err; + SYSIO_INTERFACE_RETURN(err, err); } #ifdef REDSTORM #undef __fstatvfs -sysio_sym_weak_alias(fstatvfs, __fstatvfs) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(fstatvfs), __fstatvfs) #endif #endif /* ifndef BSD */ Index: statvfs64.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/statvfs64.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -b -B -p -r1.9 -r1.10 --- statvfs64.c 24 Feb 2004 14:58:26 -0000 1.9 +++ statvfs64.c 27 Apr 2004 22:10:57 -0000 1.10 @@ -55,12 +55,13 @@ #include "sysio-symbols.h" int -statvfs64(const char *path, struct statvfs64 *buf) +SYSIO_INTERFACE_NAME(statvfs64)(const char *path, struct statvfs64 *buf) { int err; struct pnode *pno; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); if (err) goto out; @@ -72,23 +73,22 @@ out: errno = -err; err = -1; } - - SYSIO_LEAVE; - return err; + SYSIO_INTERFACE_RETURN(err, err); } #ifdef REDSTORM #undef __statvfs64 -sysio_sym_weak_alias(statvfs64, __statvfs64) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(statvfs64), __statvfs64) #endif int -fstatvfs64(int fd, struct statvfs64 *buf) +SYSIO_INTERFACE_NAME(fstatvfs64)(int fd, struct statvfs64 *buf) { int err; struct file *filp; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = 0; filp = _sysio_fd_find(fd); if (!filp) { @@ -102,14 +102,12 @@ out: errno = -err; err = -1; } - - SYSIO_LEAVE; - return err; + SYSIO_INTERFACE_RETURN(err, err); } #ifdef REDSTORM #undef __fstatvfs64 -sysio_sym_weak_alias(fstatvfs64, __fstatvfs64) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(fstatvfs64), __fstatvfs64) #endif #endif /* ifndef BSD */ Index: symlink.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/symlink.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -w -b -B -p -r1.6 -r1.7 --- symlink.c 6 Feb 2004 20:07:30 -0000 1.6 +++ symlink.c 27 Apr 2004 22:10:57 -0000 1.7 @@ -54,13 +54,14 @@ #include "sysio-symbols.h" int -symlink(const char *oldpath, const char *newpath) +SYSIO_INTERFACE_NAME(symlink)(const char *oldpath, const char *newpath) { int err; struct intent intent; struct pnode *pno; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; INTENT_INIT(&intent, INT_CREAT, NULL, NULL); err = _sysio_namei(_sysio_cwd, newpath, ND_NEGOK, &intent, &pno); if (err) @@ -83,11 +84,10 @@ out: errno = -err; err = -1; } - SYSIO_LEAVE; - return err; + SYSIO_INTERFACE_RETURN(err, err); } #ifdef REDSTORM #undef __symlink -sysio_sym_weak_alias(symlink, __symlink) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(symlink), __symlink) #endif Index: truncate.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/truncate.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -b -B -p -r1.7 -r1.8 --- truncate.c 6 Feb 2004 20:07:30 -0000 1.7 +++ truncate.c 27 Apr 2004 22:10:57 -0000 1.8 @@ -83,12 +83,14 @@ do_truncate(struct pnode *pno, struct in } static int -_truncate(const char *path, _SYSIO_OFF_T length) +PREPEND(_,SYSIO_INTERFACE_NAME(truncate))(const char *path, + _SYSIO_OFF_T length) { int err; struct pnode *pno; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); if (err) goto out; @@ -100,33 +102,35 @@ out: errno = -err; err = -1; } - SYSIO_LEAVE; - return err; + SYSIO_INTERFACE_RETURN(err, err); } #if _LARGEFILE64_SOURCE #undef truncate64 -sysio_sym_weak_alias(_truncate, truncate64) +sysio_sym_weak_alias(PREPEND(_,SYSIO_INTERFACE_NAME(truncate)), \ + SYSIO_INTERFACE_NAME(truncate64)) #undef truncate int -truncate(const char *path, off_t length) +SYSIO_INTERFACE_NAME(truncate)(const char *path, off_t length) { - return _truncate(path, length); + return PREPEND(_,SYSIO_INTERFACE_NAME(truncate))(path, length); } #else #undef truncate -sysio_sym_weak_alias(_truncate, truncate) +sysio_sym_weak_alias(PREPEND(_,SYSIO_INTERFACE_NAME(truncate)), \ + SYSIO_INTERFACE_NAME(truncate)) #endif static int -_ftruncate(int fd, _SYSIO_OFF_T length) +PREPEND(_,SYSIO_INTERFACE_NAME(ftruncate))(int fd, _SYSIO_OFF_T length) { int err; struct file *fil; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = 0; fil = _sysio_fd_find(fd); if (!fil) { @@ -139,22 +143,21 @@ out: errno = -err; err = -1; } - SYSIO_LEAVE; - return err; + SYSIO_INTERFACE_RETURN(err, err); } #if _LARGEFILE64_SOURCE #undef ftruncate64 -sysio_sym_weak_alias(_ftruncate, ftruncate64) +sysio_sym_weak_alias(PREPEND(_,SYSIO_INTERFACE_NAME(ftruncate)), SYSIO_INTERFACE_NAME(ftruncate64)) #undef ftruncate int -ftruncate(int fd, off_t length) +SYSIO_INTERFACE_NAME(ftruncate)(int fd, off_t length) { - return _ftruncate(fd, length); + return PREPEND(_,SYSIO_INTERFACE_NAME(ftruncate))(fd, length); } #else #undef ftruncate -sysio_sym_weak_alias(_ftruncate, ftruncate) +sysio_sym_weak_alias(PREPEND(_,SYSIO_INTERFACE_NAME(ftruncate)), SYSIO_INTERFACE_NAME(ftruncate)) #endif Index: unlink.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/unlink.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -b -B -p -r1.9 -r1.10 --- unlink.c 14 Feb 2004 19:42:59 -0000 1.9 +++ unlink.c 27 Apr 2004 22:10:57 -0000 1.10 @@ -54,14 +54,15 @@ #include "sysio-symbols.h" int -unlink(const char *path) +SYSIO_INTERFACE_NAME(unlink)(const char *path) { struct intent intent; int err; struct pnode *pno; struct inode *ino; + SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_ENTER; + SYSIO_INTERFACE_ENTER; INTENT_INIT(&intent, INT_UPDPARENT, NULL, NULL); err = _sysio_namei(_sysio_cwd, path, ND_NOFOLLOW, &intent, &pno); if (err) @@ -96,11 +97,10 @@ out: errno = -err; err = -1; } - SYSIO_LEAVE; - return err; + SYSIO_INTERFACE_RETURN(err, err); } #ifdef REDSTORM #undef __unlink -sysio_sym_weak_alias(unlink, __unlink) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(unlink), __unlink) #endif Index: utime.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/utime.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -b -B -p -r1.2 -r1.3 --- utime.c 21 Jan 2004 14:44:53 -0000 1.2 +++ utime.c 27 Apr 2004 22:10:57 -0000 1.3 @@ -56,13 +56,15 @@ #include "file.h" int -utime(const char *path, const struct utimbuf *buf) +SYSIO_INTERFACE_NAME(utime)(const char *path, const struct utimbuf *buf) { int err; struct pnode *pno; struct utimbuf _utbuffer; struct intnl_stat stbuf; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); if (err) goto out; @@ -84,5 +86,5 @@ out: errno = -err; err = -1; } - return err; + SYSIO_INTERFACE_RETURN(err, err); } |
From: Lee W. <lw...@us...> - 2004-04-27 16:03:26
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31471 Modified Files: link.c Log Message: From Cray SPR 728648; LINK() IS NOT ALWAYS RETURNING -1 ON ERROR Fix from Kevin Pedretti. Namei failures jumped to the exit point without setting an error/errno appropriately. Index: link.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/link.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -b -B -p -r1.4 -r1.5 --- link.c 14 Feb 2004 19:42:59 -0000 1.4 +++ link.c 27 Apr 2004 16:03:17 -0000 1.5 @@ -96,11 +96,11 @@ error2: P_RELE(new); error1: P_RELE(old); +out: if (err) { errno = -err; err = -1; } -out: return err; } |
From: Lee W. <lw...@us...> - 2004-04-27 15:15:00
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21082 Modified Files: ioctx.c Log Message: From Cray SPR 728619; writev(3) only writes the last vector in its iovector. The iovec enumerator function forgot to bump the offset for the next write call. This would lead to the same position being written over and over. Of course, only the final iovec entry length was the remaining data. Index: ioctx.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctx.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -w -b -B -p -r1.12 -r1.13 --- ioctx.c 11 Mar 2004 14:40:52 -0000 1.12 +++ ioctx.c 27 Apr 2004 15:14:50 -0000 1.13 @@ -495,6 +495,7 @@ _sysio_enumerate_iovec(const struct iove return acc; return cc; } + off += cc; limit -= cc; remain = iov->iov_len - cc; cc += acc; |
From: Lee W. <lw...@us...> - 2004-04-27 06:33:31
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16048 Modified Files: fs_native.c Log Message: Fix a bug in getdirentries. Found by inspection after a conversation about a similar bug in glibc. The content of *basep was not updated after a successful call. Also, streamlined native_filldirentries a bit. Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.36 retrieving revision 1.37 diff -u -w -b -B -p -r1.36 -r1.37 --- fs_native.c 17 Apr 2004 21:15:03 -0000 1.36 +++ fs_native.c 27 Apr 2004 06:33:22 -0000 1.37 @@ -917,9 +917,7 @@ native_filldirentries(struct native_inod size_t nbytes, _SYSIO_OFF_T *basep) { -#if !DIR_STREAMED - _SYSIO_OFF_T result; -#endif + int err; ssize_t cc; if (*basep < 0) @@ -930,17 +928,13 @@ native_filldirentries(struct native_inod * Stream-oriented access requires that we reposition prior to the * fill call. */ - result = *basep; - if (*basep != nino->ni_fpos && - (cc = native_pos(nino->ni_fd, &result, SEEK_SET)) != 0) - return cc; - nino->ni_fpos = result; -#else - nino->ni_fpos = *basep; + if ((err = native_pos(nino->ni_fd, basep, SEEK_SET)) != 0) + return err; #endif + nino->ni_fpos = *basep; -#if defined(SYS_getdirentries) cc = +#if defined(SYS_getdirentries) syscall(SYS_getdirentries, nino->ni_fd, buf, @@ -948,14 +942,23 @@ native_filldirentries(struct native_inod basep, &nino->ni_fpos); #elif defined(SYS_getdents64) - cc = syscall(SYS_getdents64, nino->ni_fd, buf, nbytes); + syscall(SYS_getdents64, nino->ni_fd, buf, nbytes); #elif defined(SYS_getdents) - cc = syscall(SYS_getdents, nino->ni_fd, buf, nbytes); + syscall(SYS_getdents, nino->ni_fd, buf, nbytes); #endif if (cc < 0) return -errno; - nino->ni_fpos += cc; +#if !DIR_STREAMED + /* + * Stream-oriented access requires that we discover where we are + * after the call. + */ + *basep = 0; + if ((err = native_pos(nino->ni_fd, basep, SEEK_CUR)) != 0) + return err; +#endif + nino->ni_fpos = *basep; return cc; } |
From: Lee W. <lw...@us...> - 2004-04-26 19:02:14
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18462/src Modified Files: rmdir.c Log Message: Cray SPR 728793; Lustre user-space library faults when handed a root pnode to remove. The rmdir function shouldn't even be calling rmdir for a busy pnode. Added a check to see if the pnode is in use and return EBUSY if so. Index: rmdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rmdir.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -w -b -B -p -r1.8 -r1.9 --- rmdir.c 14 Feb 2004 19:42:59 -0000 1.8 +++ rmdir.c 26 Apr 2004 19:02:03 -0000 1.9 @@ -70,6 +70,10 @@ rmdir(const char *path) err = -EROFS; goto error; } + if (pno->p_ref > 1) { + err = -EBUSY; + goto error; + } err = pno->p_base->pb_ino->i_ops.inop_rmdir(pno); if (err) goto error; |
From: Ruth K. <rk...@us...> - 2004-04-22 19:31:38
|
Update of /cvsroot/libsysio/libsysio/drivers/yod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5112 Modified Files: Tag: gmdev fs_yod.c Log Message: merge from head Index: fs_yod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/yod/fs_yod.c,v retrieving revision 1.11.2.1 retrieving revision 1.11.2.2 diff -u -w -b -B -p -r1.11.2.1 -r1.11.2.2 --- fs_yod.c 4 Mar 2004 18:08:06 -0000 1.11.2.1 +++ fs_yod.c 22 Apr 2004 19:31:29 -0000 1.11.2.2 @@ -996,17 +996,11 @@ doio(ssize_t (*f)(void *, size_t, _SYSIO { struct yod_inode *nino = I2NI(ioctx->ioctx_ino); - if (ioctx->ioctx_xtvlen != 1) { - /* - * No scatter/gather supported in yod I/O - */ - return -EINVAL; - } - ioctx->ioctx_cc = _sysio_doio(ioctx->ioctx_xtv, ioctx->ioctx_xtvlen, ioctx->ioctx_iov, ioctx->ioctx_iovlen, - (ssize_t (*)(void *, size_t, _SYSIO_OFF_T, void *))f, + (ssize_t (*)(void *, size_t, + _SYSIO_OFF_T, void *))f, nino); if (ioctx->ioctx_cc < 0) { ioctx->ioctx_errno = -ioctx->ioctx_cc; |
From: Ruth K. <rk...@us...> - 2004-04-22 18:59:15
|
Update of /cvsroot/libsysio/libsysio/drivers/yod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29380 Modified Files: fs_yod.c Log Message: yod driver handles strided-io by serializing, don't need to disable it Index: fs_yod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/yod/fs_yod.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -w -b -B -p -r1.13 -r1.14 --- fs_yod.c 19 Apr 2004 21:53:57 -0000 1.13 +++ fs_yod.c 22 Apr 2004 18:59:04 -0000 1.14 @@ -991,17 +991,11 @@ doio(ssize_t (*f)(void *, size_t, _SYSIO { struct yod_inode *nino = I2NI(ioctx->ioctx_ino); - if (ioctx->ioctx_xtvlen != 1) { - /* - * No scatter/gather supported in yod I/O - */ - return -EINVAL; - } - ioctx->ioctx_cc = _sysio_doio(ioctx->ioctx_xtv, ioctx->ioctx_xtvlen, ioctx->ioctx_iov, ioctx->ioctx_iovlen, - (ssize_t (*)(void *, size_t, _SYSIO_OFF_T, void *))f, + (ssize_t (*)(void *, size_t, + _SYSIO_OFF_T, void *))f, nino); if (ioctx->ioctx_cc < 0) { ioctx->ioctx_errno = -ioctx->ioctx_cc; |
From: Ruth K. <rk...@us...> - 2004-04-20 16:55:09
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5341 Modified Files: Tag: gmdev lseek.c Log Message: restore missing assignment Index: lseek.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/lseek.c,v retrieving revision 1.13.2.1 retrieving revision 1.13.2.2 diff -u -w -b -B -p -r1.13.2.1 -r1.13.2.2 --- lseek.c 19 Apr 2004 16:15:50 -0000 1.13.2.1 +++ lseek.c 20 Apr 2004 16:54:38 -0000 1.13.2.2 @@ -105,6 +105,7 @@ _sysio_lseek(int fd, _SYSIO_OFF_T offset if (pos >= _SYSIO_OFF_T_MAX) SYSIO_INTERFACE_RETURN(-EOVERFLOW, -EOVERFLOW); #endif + fil->f_pos = pos; SYSIO_INTERFACE_RETURN(pos, 0); } |
From: Ruth K. <rk...@us...> - 2004-04-20 14:55:03
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13317 Modified Files: Tag: gmdev open.c Log Message: add label name Index: open.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/open.c,v retrieving revision 1.14.2.1 retrieving revision 1.14.2.2 diff -u -w -b -B -p -r1.14.2.1 -r1.14.2.2 --- open.c 19 Apr 2004 16:15:50 -0000 1.14.2.1 +++ open.c 20 Apr 2004 14:54:53 -0000 1.14.2.2 @@ -223,7 +223,7 @@ error: #undef __open sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(open), __open) #undef open64 -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(open), open64) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(open), SYSIO_INTERFACE_NAME(open64)) #undef __open64 sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(open), __open64) #endif @@ -272,7 +272,7 @@ SYSIO_INTERFACE_NAME(creat)(const char * #undef __creat sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(creat), __creat) #undef creat64 -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(creat), creat64) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(creat), SYSIO_INTERFACE_NAME(creat64)) #undef __creat64 sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(creat), __creat64) #endif |
From: Lee W. <lw...@us...> - 2004-04-20 07:20:30
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25512 Modified Files: inode.c Log Message: Copy the operation for inop_pos too. Forgot to make this change in the original pass. Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -w -b -B -p -r1.15 -r1.16 --- inode.c 16 Apr 2004 20:38:34 -0000 1.15 +++ inode.c 20 Apr 2004 07:20:19 -0000 1.16 @@ -252,6 +252,7 @@ _sysio_i_new(struct filesys *fs, operations.inop_close = o->inop_close; operations.inop_read = o->inop_read; operations.inop_write = o->inop_write; + operations.inop_pos = o->inop_pos; operations.inop_iodone = o->inop_iodone; operations.inop_datasync = o->inop_datasync; operations.inop_ioctl = o->inop_ioctl; |
From: Ruth K. <rk...@us...> - 2004-04-19 21:54:06
|
Update of /cvsroot/libsysio/libsysio/drivers/yod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21205 Modified Files: fs_yod.c Log Message: yod driver changes for strided I/O and inop_pos Index: fs_yod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/yod/fs_yod.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -w -b -B -p -r1.12 -r1.13 --- fs_yod.c 16 Apr 2004 20:38:34 -0000 1.12 +++ fs_yod.c 19 Apr 2004 21:53:57 -0000 1.13 @@ -140,12 +140,13 @@ struct yod_inode_identifier { * system objects. */ struct yod_inode { + unsigned ni_seekok : 1; /* can seek? */ struct yod_inode_identifier ni_ident; /* unique identifier */ struct file_identifier ni_fileid; /* ditto */ int ni_fd; /* host fildes */ int ni_oflags; /* flags, from open */ unsigned ni_nopens; /* soft ref count */ - off_t ni_fpos; /* current pos */ + _SYSIO_OFF_T ni_fpos; /* current pos */ }; static int yod_inop_lookup(struct pnode *pno, @@ -172,12 +173,9 @@ static int yod_inop_close(struct inode * static int yod_inop_link(struct pnode *old, struct pnode *new); static int yod_inop_unlink(struct pnode *pno); static int yod_inop_rename(struct pnode *old, struct pnode *new); -static int yod_inop_ipreadv(struct inode *ino, - struct ioctx *ioctx); -static int yod_inop_ipwritev(struct inode *ino, - struct ioctx *ioctx); -#define yod_inop_pos(ino, off) \ - (_SYSIO_OFF_T (*)(struct inode *, _SYSIO_OFF_T))_sysio_do_espipe +static _SYSIO_OFF_T yod_inop_pos (struct inode *ino, _SYSIO_OFF_T off); +static int yod_inop_read(struct inode *ino, struct ioctx *ioctx); +static int yod_inop_write(struct inode *ino, struct ioctx *ioctx); static int yod_inop_iodone(struct ioctx *ioctx); static int yod_inop_fcntl(struct inode *ino, int cmd, va_list ap); static int yod_inop_sync(struct inode *ino); @@ -207,8 +205,8 @@ static struct inode_ops yod_i_ops = { yod_inop_link, yod_inop_unlink, yod_inop_rename, - yod_inop_ipreadv, - yod_inop_ipwritev, + yod_inop_read, + yod_inop_write, yod_inop_pos, yod_inop_iodone, yod_inop_fcntl, @@ -895,6 +893,13 @@ yod_inop_open(struct pnode *pno, int fla nino->ni_fpos = 0; nino->ni_fd = fd; + /* + * Need to know whether we can seek on this + * descriptor. + */ + nino->ni_seekok = + lseek_yod(nino->ni_fd, 0, SEEK_CUR) != 0 ? 0 : 1; + return 0; } @@ -981,75 +986,55 @@ yod_inop_unlink(struct pnode *pno) * now. */ static int -doio(ssize_t (*f)(int, const struct iovec *, int), - struct inode *ino, +doio(ssize_t (*f)(void *, size_t, _SYSIO_OFF_T, struct yod_inode *), struct ioctx *ioctx) { - struct yod_inode *nino = I2NI(ino); - loff_t result; - - assert(nino->ni_fd >= 0); - - if ((ioctx->ioctx_iovlen && (int )ioctx->ioctx_iovlen < 0) || - !(S_ISREG(ino->i_mode) || - S_ISCHR(ino->i_mode) || - S_ISSOCK(ino->i_mode) || - S_ISFIFO(ino->i_mode))) - return -EINVAL; + struct yod_inode *nino = I2NI(ioctx->ioctx_ino); + if (ioctx->ioctx_xtvlen != 1) { /* - * This implementation first positions the real system descriptor, then - * performs the operation. This is silly because it's not atomic. - * - * An alternative, more complex, less efficient but atomic, - * implementation might consider each entry of the iovec separately. - * Then, the system implementations of the POSIX p{reaad,write} calls - * could be used. - * - * Avoid the reposition call if we're already at the right place. - * Allows us to access pipes and fifos. + * No scatter/gather supported in yod I/O */ - result = ioctx->ioctx_offset; - if (ioctx->ioctx_offset != nino->ni_fpos) { - result = lseek_yod(nino->ni_fd, - ioctx->ioctx_offset, - SEEK_SET); - if (result == -1) { - ioctx->ioctx_cc = -1; - ioctx->ioctx_errno = errno; - goto out; - } - nino->ni_fpos = result; + return -EINVAL; } - /* - * Call the appropriate (read/write) IO function to - * transfer the data now. - */ + ioctx->ioctx_cc = - (*f)(nino->ni_fd, ioctx->ioctx_iovec, ioctx->ioctx_iovlen); - if (ioctx->ioctx_cc < 0) - ioctx->ioctx_errno = errno; - if (ioctx->ioctx_cc > 0) + _sysio_doio(ioctx->ioctx_xtv, ioctx->ioctx_xtvlen, + ioctx->ioctx_iov, ioctx->ioctx_iovlen, + (ssize_t (*)(void *, size_t, _SYSIO_OFF_T, void *))f, + nino); + if (ioctx->ioctx_cc < 0) { + ioctx->ioctx_errno = -ioctx->ioctx_cc; + ioctx->ioctx_cc = -1; + return -1; + } nino->ni_fpos += ioctx->ioctx_cc; -out: ioctx->ioctx_done = 1; return 0; } -/* - * Helper function passed to doio(), above, to accomplish a real readv. - */ static ssize_t -_readv(int fd, const struct iovec *vector, int count) +yod_read_simple(void *buf, + size_t nbytes, + _SYSIO_OFF_T off, + struct yod_inode *nino) { - int i; - ssize_t total = 0; + if (off != nino->ni_fpos) { + _SYSIO_OFF_T rtn; - for (i = 0; i < count; i++) - total += read_yod(fd, - vector[i].iov_base, - vector[i].iov_len); - return total; + rtn = lseek_yod(nino->ni_fd, off, SEEK_SET); + if (rtn < 0) + return -1; + nino->ni_fpos = rtn; + } + return read_yod(nino->ni_fd, buf, nbytes); +} + +static int +yod_inop_read(struct inode *ino __IS_UNUSED, struct ioctx *ioctx) +{ + + return doio(yod_read_simple, ioctx); } static int @@ -1076,36 +1061,39 @@ out: return err; } -static int -yod_inop_ipreadv(struct inode *ino, - struct ioctx *ioctx) +static ssize_t +yod_write_simple(void *buf, + size_t nbytes, + _SYSIO_OFF_T off, + struct yod_inode *nino) { - return doio(_readv, ino, ioctx); + if (off != nino->ni_fpos) { + _SYSIO_OFF_T rtn; + + rtn = lseek_yod(nino->ni_fd, off, SEEK_SET); + if (rtn < 0) + return -1; + nino->ni_fpos = rtn; + } + return write_yod(nino->ni_fd, buf, nbytes); } -/* - * Helper function passed to doio(), above, to accomplish a real writev. - */ -static ssize_t -_writev(int fd, const struct iovec *vector, int count) +static int +yod_inop_write(struct inode *ino __IS_UNUSED, struct ioctx *ioctx) { - int i; - ssize_t total = 0; - for (i = 0; i < count; i++) - total += write_yod(fd, - vector[i].iov_base, - vector[i].iov_len); - return total; + return doio(yod_write_simple, ioctx); } -static int -yod_inop_ipwritev(struct inode *ino, - struct ioctx *ioctx) +static _SYSIO_OFF_T +yod_inop_pos(struct inode *ino, _SYSIO_OFF_T off) { + struct yod_inode *nino = I2NI(ino); + int err; - return doio(_writev, ino, ioctx); + err = lseek_yod(nino->ni_fd, off, SEEK_SET); + return err < 0 ? err : off; } static int |
From: Ruth K. <rk...@us...> - 2004-04-19 21:43:17
|
Update of /cvsroot/libsysio/libsysio/drivers/yod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19173 Modified Files: fs_yod.c Log Message: yod driver changes for strided I/O and inop_pos Index: fs_yod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/yod/fs_yod.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -w -b -B -p -r1.12 -r1.13 --- fs_yod.c 16 Apr 2004 20:38:34 -0000 1.12 +++ fs_yod.c 19 Apr 2004 21:43:08 -0000 1.13 @@ -140,12 +140,13 @@ struct yod_inode_identifier { * system objects. */ struct yod_inode { + unsigned ni_seekok : 1; /* can seek? */ struct yod_inode_identifier ni_ident; /* unique identifier */ struct file_identifier ni_fileid; /* ditto */ int ni_fd; /* host fildes */ int ni_oflags; /* flags, from open */ unsigned ni_nopens; /* soft ref count */ - off_t ni_fpos; /* current pos */ + _SYSIO_OFF_T ni_fpos; /* current pos */ }; static int yod_inop_lookup(struct pnode *pno, @@ -172,12 +173,9 @@ static int yod_inop_close(struct inode * static int yod_inop_link(struct pnode *old, struct pnode *new); static int yod_inop_unlink(struct pnode *pno); static int yod_inop_rename(struct pnode *old, struct pnode *new); -static int yod_inop_ipreadv(struct inode *ino, - struct ioctx *ioctx); -static int yod_inop_ipwritev(struct inode *ino, - struct ioctx *ioctx); -#define yod_inop_pos(ino, off) \ - (_SYSIO_OFF_T (*)(struct inode *, _SYSIO_OFF_T))_sysio_do_espipe +static _SYSIO_OFF_T yod_inop_pos (struct inode *ino, _SYSIO_OFF_T off); +static int yod_inop_read(struct inode *ino, struct ioctx *ioctx); +static int yod_inop_write(struct inode *ino, struct ioctx *ioctx); static int yod_inop_iodone(struct ioctx *ioctx); static int yod_inop_fcntl(struct inode *ino, int cmd, va_list ap); static int yod_inop_sync(struct inode *ino); @@ -186,6 +184,12 @@ static int yod_inop_ioctl(struct inode * unsigned long int request, va_list ap); static int yod_inop_mknod(struct pnode *pno, mode_t mode, dev_t dev); +static void *yod_inop_mmap(struct inode *ino, + void *start, + size_t length, + int prot, + int flags, + _SYSIO_OFF_T offset); #ifdef _HAVE_STATVFS static int yod_inop_statvfs(struct pnode *pno, struct inode *ino, @@ -207,8 +211,8 @@ static struct inode_ops yod_i_ops = { yod_inop_link, yod_inop_unlink, yod_inop_rename, - yod_inop_ipreadv, - yod_inop_ipwritev, + yod_inop_read, + yod_inop_write, yod_inop_pos, yod_inop_iodone, yod_inop_fcntl, @@ -895,6 +899,13 @@ yod_inop_open(struct pnode *pno, int fla nino->ni_fpos = 0; nino->ni_fd = fd; + /* + * Need to know whether we can seek on this + * descriptor. + */ + nino->ni_seekok = + lseek_yod(nino->ni_fd, 0, SEEK_CUR) != 0 ? 0 : 1; + return 0; } @@ -981,75 +992,55 @@ yod_inop_unlink(struct pnode *pno) * now. */ static int -doio(ssize_t (*f)(int, const struct iovec *, int), - struct inode *ino, +doio(ssize_t (*f)(void *, size_t, _SYSIO_OFF_T, struct yod_inode *), struct ioctx *ioctx) { - struct yod_inode *nino = I2NI(ino); - loff_t result; - - assert(nino->ni_fd >= 0); - - if ((ioctx->ioctx_iovlen && (int )ioctx->ioctx_iovlen < 0) || - !(S_ISREG(ino->i_mode) || - S_ISCHR(ino->i_mode) || - S_ISSOCK(ino->i_mode) || - S_ISFIFO(ino->i_mode))) - return -EINVAL; + struct yod_inode *nino = I2NI(ioctx->ioctx_ino); + if (ioctx->ioctx_xtvlen != 1) { /* - * This implementation first positions the real system descriptor, then - * performs the operation. This is silly because it's not atomic. - * - * An alternative, more complex, less efficient but atomic, - * implementation might consider each entry of the iovec separately. - * Then, the system implementations of the POSIX p{reaad,write} calls - * could be used. - * - * Avoid the reposition call if we're already at the right place. - * Allows us to access pipes and fifos. + * No scatter/gather supported in yod I/O */ - result = ioctx->ioctx_offset; - if (ioctx->ioctx_offset != nino->ni_fpos) { - result = lseek_yod(nino->ni_fd, - ioctx->ioctx_offset, - SEEK_SET); - if (result == -1) { - ioctx->ioctx_cc = -1; - ioctx->ioctx_errno = errno; - goto out; - } - nino->ni_fpos = result; + return -EINVAL; } - /* - * Call the appropriate (read/write) IO function to - * transfer the data now. - */ + ioctx->ioctx_cc = - (*f)(nino->ni_fd, ioctx->ioctx_iovec, ioctx->ioctx_iovlen); - if (ioctx->ioctx_cc < 0) - ioctx->ioctx_errno = errno; - if (ioctx->ioctx_cc > 0) + _sysio_doio(ioctx->ioctx_xtv, ioctx->ioctx_xtvlen, + ioctx->ioctx_iov, ioctx->ioctx_iovlen, + (ssize_t (*)(void *, size_t, _SYSIO_OFF_T, void *))f, + nino); + if (ioctx->ioctx_cc < 0) { + ioctx->ioctx_errno = -ioctx->ioctx_cc; + ioctx->ioctx_cc = -1; + return -1; + } nino->ni_fpos += ioctx->ioctx_cc; -out: ioctx->ioctx_done = 1; return 0; } -/* - * Helper function passed to doio(), above, to accomplish a real readv. - */ static ssize_t -_readv(int fd, const struct iovec *vector, int count) +yod_read_simple(void *buf, + size_t nbytes, + _SYSIO_OFF_T off, + struct yod_inode *nino) { - int i; - ssize_t total = 0; + if (off != nino->ni_fpos) { + _SYSIO_OFF_T rtn; - for (i = 0; i < count; i++) - total += read_yod(fd, - vector[i].iov_base, - vector[i].iov_len); - return total; + rtn = lseek_yod(nino->ni_fd, off, SEEK_SET); + if (rtn < 0) + return -1; + nino->ni_fpos = rtn; + } + return read_yod(nino->ni_fd, buf, nbytes); +} + +static int +yod_inop_read(struct inode *ino __IS_UNUSED, struct ioctx *ioctx) +{ + + return doio(yod_read_simple, ioctx); } static int @@ -1076,36 +1067,39 @@ out: return err; } -static int -yod_inop_ipreadv(struct inode *ino, - struct ioctx *ioctx) +static ssize_t +yod_write_simple(void *buf, + size_t nbytes, + _SYSIO_OFF_T off, + struct yod_inode *nino) { - return doio(_readv, ino, ioctx); + if (off != nino->ni_fpos) { + _SYSIO_OFF_T rtn; + + rtn = lseek_yod(nino->ni_fd, off, SEEK_SET); + if (rtn < 0) + return -1; + nino->ni_fpos = rtn; + } + return write_yod(nino->ni_fd, buf, nbytes); } -/* - * Helper function passed to doio(), above, to accomplish a real writev. - */ -static ssize_t -_writev(int fd, const struct iovec *vector, int count) +static int +yod_inop_write(struct inode *ino __IS_UNUSED, struct ioctx *ioctx) { - int i; - ssize_t total = 0; - for (i = 0; i < count; i++) - total += write_yod(fd, - vector[i].iov_base, - vector[i].iov_len); - return total; + return doio(yod_write_simple, ioctx); } -static int -yod_inop_ipwritev(struct inode *ino, - struct ioctx *ioctx) +static _SYSIO_OFF_T +yod_inop_pos(struct inode *ino, _SYSIO_OFF_T off) { + struct yod_inode *nino = I2NI(ino); + int err; - return doio(_writev, ino, ioctx); + err = lseek_yod(nino->ni_fd, off, SEEK_SET); + return err < 0 ? err : off; } static int @@ -1240,3 +1234,14 @@ yod_fsop_gone(struct filesys *fs __IS_UN * yod file interface. */ } + +static void * +yod_inop_mmap(struct inode *ino __IS_UNUSED, + void *start __IS_UNUSED, + size_t length __IS_UNUSED, + int prot __IS_UNUSED, + int flags __IS_UNUSED, + _SYSIO_OFF_T offset __IS_UNUSED) +{ + return (void *)-ENOSYS; +} |
From: Ruth K. <rk...@us...> - 2004-04-19 21:35:31
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17041 Modified Files: Tag: gmdev sysio.h Log Message: invert test, restore errno if err is not set Index: sysio.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio.h,v retrieving revision 1.18.2.2 retrieving revision 1.18.2.3 diff -u -w -b -B -p -r1.18.2.2 -r1.18.2.3 --- sysio.h 19 Apr 2004 17:45:01 -0000 1.18.2.2 +++ sysio.h 19 Apr 2004 21:35:22 -0000 1.18.2.3 @@ -363,7 +363,7 @@ extern int SYSIO_INTERFACE_NAME(umount)( #define SYSIO_INTERFACE_RETURN(rtn, err) \ do { \ SYSIO_LEAVE; \ - if (err) errno = _saved_errno; \ + if (err == 0) errno = _saved_errno; \ return (rtn); \ } while(0) |
From: Lee W. <lw...@us...> - 2004-04-19 19:54:35
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26550 Modified Files: mknod.c Log Message: Last change screwed up in the change. We went from checking to see that the node was either CHR or FIFO, to DIR or FIFO. Oops! This rev makes it CHR again. Index: mknod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mknod.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -b -B -p -r1.9 -r1.10 --- mknod.c 14 Apr 2004 16:25:40 -0000 1.9 +++ mknod.c 19 Apr 2004 19:54:25 -0000 1.10 @@ -81,7 +81,7 @@ __xmknod(int __ver, const char *path, mo /* * Support only character-special and fifos right now. */ - if (!(S_ISDIR(mode) || S_ISFIFO(mode))) { + if (!(S_ISCHR(mode) || S_ISFIFO(mode))) { err = -EINVAL; goto out; } |
From: Ruth K. <rk...@us...> - 2004-04-19 18:24:24
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8810 Modified Files: Tag: gmdev getdirentries.c rename.c stat.c Log Message: add name label Index: getdirentries.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/getdirentries.c,v retrieving revision 1.8.2.2 retrieving revision 1.8.2.3 diff -u -w -b -B -p -r1.8.2.2 -r1.8.2.3 --- getdirentries.c 19 Apr 2004 17:52:38 -0000 1.8.2.2 +++ getdirentries.c 19 Apr 2004 18:24:14 -0000 1.8.2.3 @@ -119,7 +119,7 @@ _getdirentries64(int fd, #if _LARGEFILE64_SOURCE #undef getdirentries64 -sysio_sym_strong_alias(_getdirentries64, getdirentries64) +sysio_sym_strong_alias(_getdirentries64, SYSIO_INTERFACE_NAME(getdirentries64)) #endif #undef getdirentries Index: rename.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rename.c,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -u -w -b -B -p -r1.3.2.1 -r1.3.2.2 --- rename.c 19 Apr 2004 16:15:50 -0000 1.3.2.1 +++ rename.c 19 Apr 2004 18:24:14 -0000 1.3.2.2 @@ -55,7 +55,7 @@ #include "inode.h" int -rename(const char *oldpath, const char *newpath) +SYSIO_INTERFACE_NAME(rename)(const char *oldpath, const char *newpath) { struct intent intent; int err; Index: stat.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/stat.c,v retrieving revision 1.9.2.1 retrieving revision 1.9.2.2 diff -u -w -b -B -p -r1.9.2.1 -r1.9.2.2 --- stat.c 19 Apr 2004 16:15:50 -0000 1.9.2.1 +++ stat.c 19 Apr 2004 18:24:14 -0000 1.9.2.2 @@ -230,7 +230,8 @@ PREPEND(__,SYSIO_INTERFACE_NAME(stat))(c SYSIO_INTERFACE_RETURN(rc, rc); } -sysio_sym_weak_alias(PREPEND(__,SYSIO_INTERFACE_NAME(stat)), stat) +sysio_sym_weak_alias(PREPEND(__,SYSIO_INTERFACE_NAME(stat)), + SYSIO_INTERFACE_NAME(stat)) #ifdef BSD #undef _stat @@ -305,7 +306,8 @@ PREPEND(__,SYSIO_INTERFACE_NAME(lstat))( SYSIO_INTERFACE_RETURN(rc, rc); } -sysio_sym_weak_alias(PREPEND(__,SYSIO_INTERFACE_NAME(lstat)), lstat) +sysio_sym_weak_alias(PREPEND(__,SYSIO_INTERFACE_NAME(lstat)), + SYSIO_INTERFACE_NAME(lstat)) #ifdef BSD #undef _lstat |
From: Ruth K. <rk...@us...> - 2004-04-19 17:52:48
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1276 Modified Files: Tag: gmdev getdirentries.c Log Message: remove extra _ Index: getdirentries.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/getdirentries.c,v retrieving revision 1.8.2.1 retrieving revision 1.8.2.2 diff -u -w -b -B -p -r1.8.2.1 -r1.8.2.2 --- getdirentries.c 19 Apr 2004 16:15:50 -0000 1.8.2.1 +++ getdirentries.c 19 Apr 2004 17:52:38 -0000 1.8.2.2 @@ -307,5 +307,5 @@ sysio_sym_weak_alias(SYSIO_INTERFACE_NAM #endif #if defined(BSD) || defined(REDSTORM) #undef _getdirentries -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(getdirentries)), __getdirentries) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(getdirentries)), _getdirentries) #endif |
From: Ruth K. <rk...@us...> - 2004-04-19 17:51:40
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1019 Modified Files: Tag: gmdev fsync.c Log Message: add name label Index: fsync.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fsync.c,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -u -w -b -B -p -r1.3.2.1 -r1.3.2.2 --- fsync.c 19 Apr 2004 16:15:50 -0000 1.3.2.1 +++ fsync.c 19 Apr 2004 17:51:30 -0000 1.3.2.2 @@ -51,7 +51,7 @@ #include "inode.h" int -fsync(int fd) +SYSIO_INTERFACE_NAME(fsync)(int fd) { struct file *fil; int err; @@ -72,7 +72,7 @@ fsync(int fd) } int -fdatasync(int fd) +SYSIO_INTERFACE_NAME(fdatasync)(int fd) { struct file *fil; int err; |
From: Ruth K. <rk...@us...> - 2004-04-19 17:46:45
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32282 Modified Files: Tag: gmdev iowait.c Log Message: add name label Index: iowait.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/iowait.c,v retrieving revision 1.5.2.1 retrieving revision 1.5.2.2 diff -u -w -b -B -p -r1.5.2.1 -r1.5.2.2 --- iowait.c 19 Apr 2004 16:15:50 -0000 1.5.2.1 +++ iowait.c 19 Apr 2004 17:46:35 -0000 1.5.2.2 @@ -67,7 +67,7 @@ lookup_ioid(ioid_t ioid) * Poll status of asynch IO request. */ int -iodone(ioid_t ioid) +SYSIO_INTERFACE_NAME(iodone)(ioid_t ioid) { struct ioctx *ioctx; int rc; @@ -91,7 +91,7 @@ iodone(ioid_t ioid) * The identifier is no longer valid after return. */ ssize_t -iowait(ioid_t ioid) +SYSIO_INTERFACE_NAME(iowait)(ioid_t ioid) { struct ioctx *ioctx; ssize_t cc; |
From: Ruth K. <rk...@us...> - 2004-04-19 17:45:14
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32090 Modified Files: Tag: gmdev xtio.h sysio.h Log Message: sysio interface frame macros and name label macros: SYSIO_INTERFACE_NAME(x) prepends a label defined in sysio.h, or does nothing SYSIO_DISPLAY_BLOCK frame variables, currently _saved_errno SYSIO_INTERFACE_ENTER store incoming errno, and call SYSIO_ENTER SYSIO_INTERFACE_RETURN(rtn, err) calls SYSIO_LEAVE restores saved errno val if err == 0, returns rtn Index: xtio.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/xtio.h,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -w -b -B -p -r1.2 -r1.2.2.1 --- xtio.h 6 Feb 2004 20:07:29 -0000 1.2 +++ xtio.h 19 Apr 2004 17:45:01 -0000 1.2.2.1 @@ -60,35 +60,51 @@ struct xtvec64 { }; #endif -extern ioid_t ireadx(int fd, - const struct iovec *iov, size_t iov_count, - const struct xtvec *xtv, size_t xtv_count); +extern ioid_t SYSIO_INTERFACE_NAME(ireadx)(int fd, + const struct iovec *iov, + size_t iov_count, + const struct xtvec *xtv, + size_t xtv_count); #ifdef __USE_LARGEFILE64 -extern ioid_t iread64x(int fd, - const struct iovec *iov, size_t iov_count, - const struct xtvec64 *xtv, size_t xtv_count); +extern ioid_t SYSIO_INTERFACE_NAME(iread64x)(int fd, + const struct iovec *iov, + size_t iov_count, + const struct xtvec64 *xtv, + size_t xtv_count); #endif -extern ssize_t readx(int fd, - const struct iovec *iov, size_t iov_count, - const struct xtvec *xtv, size_t xtv_count); +extern ssize_t SYSIO_INTERFACE_NAME(readx)(int fd, + const struct iovec *iov, + size_t iov_count, + const struct xtvec *xtv, + size_t xtv_count); #ifdef __USE_LARGEFILE64 -extern ssize_t read64x(int fd, - const struct iovec *iov, size_t iov_count, - const struct xtvec64 *xtv, size_t xtv_count); +extern ssize_t SYSIO_INTERFACE_NAME(read64x)(int fd, + const struct iovec *iov, + size_t iov_count, + const struct xtvec64 *xtv, + size_t xtv_count); #endif -extern ioid_t iwritex(int fd, - const struct iovec *iov, size_t iov_count, - const struct xtvec *xtv, size_t xtv_count); +extern ioid_t SYSIO_INTERFACE_NAME(iwritex)(int fd, + const struct iovec *iov, + size_t iov_count, + const struct xtvec *xtv, + size_t xtv_count); #ifdef __USE_LARGEFILE64 -extern ioid_t iwrite64x(int fd, - const struct iovec *iov, size_t iov_count, - const struct xtvec64 *xtv, size_t xtv_count); +extern ioid_t SYSIO_INTERFACE_NAME(iwrite64x)(int fd, + const struct iovec *iov, + size_t iov_count, + const struct xtvec64 *xtv, + size_t xtv_count); #endif -extern ssize_t writex(int fd, - const struct iovec *iov, size_t iov_count, - const struct xtvec *xtv, size_t xtv_count); +extern ssize_t SYSIO_INTERFACE_NAME(writex)(int fd, + const struct iovec *iov, + size_t iov_count, + const struct xtvec *xtv, + size_t xtv_count); #ifdef __USE_LARGEFILE64 -extern ssize_t write64x(int fd, - const struct iovec *iov, size_t iov_count, - const struct xtvec64 *xtv, size_t xtv_count); +extern ssize_t SYSIO_INTERFACE_NAME(write64x)(int fd, + const struct iovec *iov, + size_t iov_count, + const struct xtvec64 *xtv, + size_t xtv_count); #endif Index: sysio.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio.h,v retrieving revision 1.18.2.1 retrieving revision 1.18.2.2 diff -u -w -b -B -p -r1.18.2.1 -r1.18.2.2 --- sysio.h 19 Apr 2004 16:14:47 -0000 1.18.2.1 +++ sysio.h 19 Apr 2004 17:45:01 -0000 1.18.2.2 @@ -166,136 +166,170 @@ extern void _sysio_shutdown(void); extern int _sysio_boot(const char *buf); /* + * SYSIO name label macros + */ +#define XPREPEND(p,x) p ## x +#define PREPEND(p,x) XPREPEND(p,x) +#define SYSIO_LABEL_NAMES 0 +#if SYSIO_LABEL_NAMES +#define SYSIO_INTERFACE_NAME(x) PREPEND(sysio__,x) +#else +#define SYSIO_INTERFACE_NAME(x) x +#endif + +/* * The following should be defined by the system includes, and probably are, * but it's not illegal to have multiple externs, so long as they are the * same. It helps when building the library in a standalone fashion. */ -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 char *getcwd(char *buf, size_t size); -extern off_t lseek(int fd, off_t offset, int whence); +extern int SYSIO_INTERFACE_NAME(access)(const char *path, int amode); +extern int SYSIO_INTERFACE_NAME(chdir)(const char *path); +extern int SYSIO_INTERFACE_NAME(chmod)(const char *path, mode_t mode); +extern int SYSIO_INTERFACE_NAME(fchmod)(int fd, mode_t mode); +extern int SYSIO_INTERFACE_NAME(chown)(const char *path, uid_t owner, + gid_t group); +extern int SYSIO_INTERFACE_NAME(fchown)(int fd, uid_t owner, gid_t group); +extern int SYSIO_INTERFACE_NAME(close)(int d); +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(fstat)(int fd, struct stat *buf); +extern int SYSIO_INTERFACE_NAME(fsync)(int fd); +extern char *SYSIO_INTERFACE_NAME(getcwd)(char *buf, size_t size); +extern off_t SYSIO_INTERFACE_NAME(lseek)(int fd, off_t offset, int whence); #if _LARGEFILE64_SOURCE -extern off64_t lseek64(int fd, off64_t offset, int whence); +extern off64_t SYSIO_INTERFACE_NAME(lseek64)(int fd, off64_t offset, + int whence); #endif -extern int lstat(const char *path, struct stat *buf); +extern int SYSIO_INTERFACE_NAME(lstat)(const char *path, struct stat *buf); #ifdef BSD -extern int getdirentries(int fd, char *buf, int nbytes , long *basep); +extern int SYSIO_INTERFACE_NAME(getdirentries)(int fd, char *buf, int nbytes , + long *basep); #else -extern ssize_t getdirentries(int fd, char *buf, size_t nbytes, off_t *basep); +extern ssize_t SYSIO_INTERFACE_NAME(getdirentries)(int fd, char *buf, + size_t nbytes, off_t *basep); #if _LARGEFILE64_SOURCE -extern ssize_t getdirentries64(int fd, +extern ssize_t SYSIO_INTERFACE_NAME(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, ...); +extern int SYSIO_INTERFACE_NAME(mkdir)(const char *path, mode_t mode); +extern int SYSIO_INTERFACE_NAME(open)(const char *path, int flag, ...); #if _LARGEFILE64_SOURCE -extern int open64(const char *path, int flag, ...); +extern int SYSIO_INTERFACE_NAME(open64)(const char *path, int flag, ...); #endif -extern int creat(const char *path, mode_t mode); +extern int SYSIO_INTERFACE_NAME(creat)(const char *path, mode_t mode); #if _LARGEFILE64_SOURCE -extern int creat64(const char *path, mode_t mode); +extern int SYSIO_INTERFACE_NAME(creat64)(const char *path, mode_t mode); #endif -extern int stat(const char *path, struct stat *buf); +extern int SYSIO_INTERFACE_NAME(stat)(const char *path, struct stat *buf); #if _LARGEFILE64_SOURCE -extern int stat64(const char *path, struct stat64 *buf); +extern int SYSIO_INTERFACE_NAME(stat64)(const char *path, struct stat64 *buf); #endif #ifdef _HAVE_STATVFS -extern int statvfs(const char *path, struct statvfs *buf); -#if _LARGEFILE64_SOURCE -extern int statvfs64(const char *path, struct statvfs64 *buf); -#endif -extern int fstatvfs(int fd, struct statvfs *buf); -#if _LARGEFILE64_SOURCE -extern int fstatvfs64(int fd, struct statvfs64 *buf); -#endif -#endif -extern int truncate(const char *path, off_t length); +extern int SYSIO_INTERFACE_NAME(statvfs)(const char *path, struct statvfs *buf); #if _LARGEFILE64_SOURCE -extern int truncate64(const char *path, off64_t length); +extern int SYSIO_INTERFACE_NAME(statvfs64)(const char *path, + struct statvfs64 *buf); #endif -extern int ftruncate(int fd, off_t length); +extern int SYSIO_INTERFACE_NAME(fstatvfs)(int fd, struct statvfs *buf); #if _LARGEFILE64_SOURCE -extern int ftruncate64(int fd, off64_t length); +extern int SYSIO_INTERFACE_NAME(fstatvfs64)(int fd, struct statvfs64 *buf); #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); -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); -#if _LARGEFILE64_SOURCE -extern ioid_t ipread64v(int fd, const struct iovec *iov, size_t count, - off64_t offset); #endif -extern ioid_t ipread(int fd, void *buf, size_t count, off_t offset); +extern int SYSIO_INTERFACE_NAME(truncate)(const char *path, off_t length); #if _LARGEFILE64_SOURCE -extern ioid_t ipread64(int fd, void *buf, size_t count, off64_t offset); +extern int SYSIO_INTERFACE_NAME(truncate64)(const char *path, off64_t length); #endif -extern ssize_t preadv(int fd, const struct iovec *iov, size_t count, - off_t offset); +extern int SYSIO_INTERFACE_NAME(ftruncate)(int fd, off_t length); #if _LARGEFILE64_SOURCE -extern ssize_t pread64v(int fd, const struct iovec *iov, size_t count, - off64_t offset); +extern int SYSIO_INTERFACE_NAME(ftruncate64)(int fd, off64_t length); #endif -extern ssize_t pread(int fd, void *buf, size_t count, off_t offset); +extern int SYSIO_INTERFACE_NAME(rmdir)(const char *path); +extern int SYSIO_INTERFACE_NAME(symlink)(const char *path1, const char *path2); +extern int SYSIO_INTERFACE_NAME(link)(const char *oldpath, const char *newpath); +extern int SYSIO_INTERFACE_NAME(unlink)(const char *path); +extern int SYSIO_INTERFACE_NAME(rename)(const char *oldpath, + const char *newpath); +extern int SYSIO_INTERFACE_NAME(fdatasync)(int fd); +extern int SYSIO_INTERFACE_NAME(ioctl)(int fd, unsigned long request, ...); +extern mode_t SYSIO_INTERFACE_NAME(umask)(mode_t mask); +extern int SYSIO_INTERFACE_NAME(iodone)(ioid_t ioid); +extern ssize_t SYSIO_INTERFACE_NAME(iowait)(ioid_t ioid); +extern ioid_t SYSIO_INTERFACE_NAME(ipreadv)(int fd, const struct iovec *iov, + size_t count, off_t offset); #if _LARGEFILE64_SOURCE -extern ssize_t pread64(int fd, void *buf, size_t count, off64_t offset); +extern ioid_t SYSIO_INTERFACE_NAME(ipread64v)(int fd, const struct iovec *iov, + 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); -extern ioid_t ipwritev(int fd, const struct iovec *iov, size_t count, +extern ioid_t SYSIO_INTERFACE_NAME(ipread)(int fd, void *buf, size_t count, off_t offset); #if _LARGEFILE64_SOURCE -extern ioid_t ipwrite64v(int fd, const struct iovec *iov, size_t count, +extern ioid_t SYSIO_INTERFACE_NAME(ipread64)(int fd, void *buf, size_t count, off64_t offset); #endif -extern ioid_t ipwrite(int fd, const void *buf, size_t count, off_t offset); +extern ssize_t SYSIO_INTERFACE_NAME(preadv)(int fd, const struct iovec *iov, + size_t count, off_t offset); #if _LARGEFILE64_SOURCE -extern ioid_t ipwrite64(int fd, const void *buf, size_t count, off64_t offset); +extern ssize_t SYSIO_INTERFACE_NAME(pread64v)(int fd, const struct iovec *iov, + size_t count, off64_t offset); #endif -extern ssize_t pwritev(int fd, const struct iovec *iov, size_t count, +extern ssize_t SYSIO_INTERFACE_NAME(pread)(int fd, void *buf, size_t count, off_t offset); #if _LARGEFILE64_SOURCE -extern ssize_t pwrite64v(int fd, const struct iovec *iov, size_t count, +extern ssize_t SYSIO_INTERFACE_NAME(pread64)(int fd, void *buf, size_t count, off64_t offset); #endif -extern ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset); -#if _LARGEFILE64_SOURCE -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); -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, +extern ioid_t SYSIO_INTERFACE_NAME(ireadv)(int fd, const struct iovec *iov, + int count); +extern ioid_t SYSIO_INTERFACE_NAME(iread)(int fd, void *buf, size_t count); +extern ssize_t SYSIO_INTERFACE_NAME(readv)(int fd, const struct iovec *iov, + int count); +extern ssize_t SYSIO_INTERFACE_NAME(read)(int fd, void *buf, size_t count); +extern ioid_t SYSIO_INTERFACE_NAME(ipwritev)(int fd, const struct iovec *iov, + size_t count, off_t offset); +#if _LARGEFILE64_SOURCE +extern ioid_t SYSIO_INTERFACE_NAME(ipwrite64v)(int fd, const struct iovec *iov, + size_t count, off64_t offset); +#endif +extern ioid_t SYSIO_INTERFACE_NAME(ipwrite)(int fd, const void *buf, + size_t count, off_t offset); +#if _LARGEFILE64_SOURCE +extern ioid_t SYSIO_INTERFACE_NAME(ipwrite64)(int fd, const void *buf, + size_t count, off64_t offset); +#endif +extern ssize_t SYSIO_INTERFACE_NAME(pwritev)(int fd, const struct iovec *iov, + size_t count, off_t offset); +#if _LARGEFILE64_SOURCE +extern ssize_t SYSIO_INTERFACE_NAME(pwrite64v)(int fd, const struct iovec *iov, + size_t count, off64_t offset); +#endif +extern ssize_t SYSIO_INTERFACE_NAME(pwrite)(int fd, const void *buf, + size_t count, off_t offset); +#if _LARGEFILE64_SOURCE +extern ssize_t SYSIO_INTERFACE_NAME(pwrite64)(int fd, const void *buf, + size_t count, off64_t offset); +#endif +extern ioid_t SYSIO_INTERFACE_NAME(iwritev)(int fd, + const struct iovec *iov, + int count); +extern ioid_t SYSIO_INTERFACE_NAME(iwrite)(int fd, const void *buf, + size_t count); +extern ssize_t SYSIO_INTERFACE_NAME(writev)(int fd, const struct iovec *iov, + int count); +extern ssize_t SYSIO_INTERFACE_NAME(write)(int fd, const void *buf, + size_t count); +extern int SYSIO_INTERFACE_NAME(mknod)(const char *path, + mode_t mode, dev_t dev); +extern int SYSIO_INTERFACE_NAME(utime)(const char *path, + const struct utimbuf *buf); +extern int SYSIO_INTERFACE_NAME(mount)(const char *source, const char *target, const char *filesystemtype, unsigned long mountflags, const void *data); -extern int umount(const char *target); +extern int SYSIO_INTERFACE_NAME(umount)(const char *target); /* for debugging */ #if 0 @@ -319,15 +353,6 @@ extern int umount(const char *target); /* * SYSIO interface frame macros */ -#define XPREPEND(p,x) p ## x -#define PREPEND(p,x) XPREPEND(p,x) -#define SYSIO_LABEL_NAMES 0 -#if SYSIO_LABEL_NAMES -#define SYSIO_INTERFACE_NAME(x) PREPEND(sysio__,x) -#else -#define SYSIO_INTERFACE_NAME(x) x -#endif - #define SYSIO_INTERFACE_DISPLAY_BLOCK \ int _saved_errno; #define SYSIO_INTERFACE_ENTER \ |
From: Ruth K. <rk...@us...> - 2004-04-19 16:16:07
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14103 Modified Files: Tag: gmdev access.c chdir.c chmod.c chown.c dup.c fcntl.c fsync.c getdirentries.c inode.c ioctl.c ioctx.c iowait.c link.c lseek.c mkdir.c mknod.c mmap.c mount.c namei.c open.c rename.c rmdir.c rw.c stat.c stat64.c statvfs.c statvfs64.c symlink.c truncate.c unlink.c utime.c Log Message: sysio interface frame macros and name label macros: SYSIO_INTERFACE_NAME(x) prepends a label defined in sysio.h, or does nothing SYSIO_DISPLAY_BLOCK frame variables, currently _saved_errno SYSIO_INTERFACE_ENTER store incoming errno, and call SYSIO_ENTER SYSIO_INTERFACE_RETURN(rtn, err) calls SYSIO_LEAVE restores saved errno val if err == 0, returns rtn Index: access.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/access.c,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -w -b -B -p -r1.3 -r1.3.2.1 --- access.c 26 Jan 2004 16:34:54 -0000 1.3 +++ access.c 19 Apr 2004 16:15:49 -0000 1.3.2.1 @@ -48,16 +48,19 @@ #include <unistd.h> #include "sysio-symbols.h" +#include "sysio.h" int -access(const char *path, int amode) +SYSIO_INTERFACE_NAME(access)(const char *path, int amode) { gid_t *list, *entry; size_t n; int err = 0; unsigned mask, mode; struct stat stbuf; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = 0; n = getgroups(0, NULL); @@ -108,10 +111,10 @@ out: if (list) free(list); - return err; + SYSIO_INTERFACE_RETURN(err, err); } #ifdef REDSTORM #undef __access -sysio_sym_weak_alias(access, __access) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(access), __access) #endif Index: chdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chdir.c,v retrieving revision 1.13 retrieving revision 1.13.2.1 diff -u -w -b -B -p -r1.13 -r1.13.2.1 --- chdir.c 8 Feb 2004 21:37:26 -0000 1.13 +++ chdir.c 19 Apr 2004 16:15:50 -0000 1.13.2.1 @@ -114,42 +114,39 @@ _sysio_p_chdir(struct pnode *pno) } int -chdir(const char *path) +SYSIO_INTERFACE_NAME(chdir)(const char *path) { int err; struct pnode *pno; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); if (err) { errno = -err; - SYSIO_LEAVE; - return -1; + SYSIO_INTERFACE_RETURN(-1, err); } err = _sysio_p_chdir(pno); - if (err) - P_RELE(pno); - - SYSIO_LEAVE; if (err) { + P_RELE(pno); errno = -err; err = -1; } - return err; + SYSIO_INTERFACE_RETURN(err, err); } +#ifdef REDSTORM +#undef __chdir +sysio_sym_weak_alias(chdir, __chdir) +#endif + /* * Return path tracked by the path ancestor chain. * * If the buf pointer is NULL, a buffer large enough to hold the path * is allocated from the heap. */ -#ifdef REDSTORM -#undef __chdir -sysio_sym_weak_alias(chdir, __chdir) -#endif - static int _sysio_p_path(struct pnode *pno, char **buf, size_t size) { @@ -231,28 +228,27 @@ _sysio_p_path(struct pnode *pno, char ** } char * -getcwd(char *buf, size_t size) +SYSIO_INTERFACE_NAME(getcwd)(char *buf, size_t size) { int err; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = _sysio_p_path(_sysio_cwd, &buf, buf ? size : 0); if (err) { errno = -err; - SYSIO_LEAVE; - return NULL; + SYSIO_INTERFACE_RETURN(NULL, err); } - SYSIO_LEAVE; - return buf; + SYSIO_INTERFACE_RETURN(buf, err); } #ifdef __GLIBC__ -sysio_sym_weak_alias(getcwd, __getcwd) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(getcwd), __getcwd) #endif #if defined(PATH_MAX) && !(defined(REDSTORM)) char * -getwd(char *buf) +SYSIO_INTERFACE_NAME(getwd)(char *buf) { if (!buf) { Index: chmod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chmod.c,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -u -w -b -B -p -r1.7 -r1.7.2.1 --- chmod.c 25 Feb 2004 16:23:59 -0000 1.7 +++ chmod.c 19 Apr 2004 16:15:50 -0000 1.7.2.1 @@ -69,12 +69,13 @@ do_chmod(struct pnode *pno, struct inode } int -chmod(const char *path, mode_t mode) +SYSIO_INTERFACE_NAME(chmod)(const char *path, mode_t mode) { int err; struct pnode *pno; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); if (err) goto out; @@ -85,21 +86,22 @@ out: errno = -err; err = -1; } - SYSIO_LEAVE; - return err; + SYSIO_INTERFACE_RETURN(err, err); } #ifdef REDSTORM #undef __chmod -sysio_sym_weak_alias(chmod, __chmod) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(chmod)), __chmod) #endif int -fchmod(int fd, mode_t mode) +SYSIO_INTERFACE_NAME(fchmod)(int fd, mode_t mode) { int err; struct file *fil; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = 0; fil = _sysio_fd_find(fd); if (!fil) { @@ -113,10 +115,10 @@ out: errno = -err; err = -1; } - return err; + SYSIO_INTERFACE_RETURN(err, err); } #ifdef REDSTORM #undef __fchmod -sysio_sym_weak_alias(fchmod, __fchmod) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(fchmod)), __chmod) #endif Index: chown.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chown.c,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -w -b -B -p -r1.6 -r1.6.2.1 --- chown.c 26 Jan 2004 16:34:54 -0000 1.6 +++ chown.c 19 Apr 2004 16:15:50 -0000 1.6.2.1 @@ -60,7 +60,6 @@ _do_chown(struct pnode *pno, struct inod int err; struct intnl_stat stbuf; unsigned mask; - SYSIO_ENTER; (void )memset(&stbuf, 0, sizeof(struct intnl_stat)); mask = 0; @@ -77,11 +76,13 @@ _do_chown(struct pnode *pno, struct inod } int -chown(const char *path, uid_t owner, gid_t group) +SYSIO_INTERFACE_NAME(chown)(const char *path, uid_t owner, gid_t group) { int err; struct pnode *pno; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); if (err) goto out; @@ -93,21 +94,23 @@ out: errno = -err; err = -1; } - SYSIO_LEAVE; - return err; + + SYSIO_INTERFACE_RETURN(err, err); +} + #ifdef REDSTORM #undef __chown -sysio_sym_weak_alias(chown, __chown) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(chown)), __chown) #endif -} - int -fchown(int fd, uid_t owner, gid_t group) +SYSIO_INTERFACE_NAME(fchown)(int fd, uid_t owner, gid_t group) { int err; struct file *fil; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = 0; fil = _sysio_fd_find(fd); if (!fil) { @@ -121,10 +124,11 @@ out: errno = -err; err = -1; } + SYSIO_INTERFACE_RETURN(err, err); +} #ifdef REDSTORM #undef __fchown -sysio_sym_weak_alias(fchown, __fchown) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(fchown)), __fchown) #endif - return err; -} + Index: dup.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/dup.c,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -u -w -b -B -p -r1.5 -r1.5.2.1 --- dup.c 6 Feb 2004 20:07:30 -0000 1.5 +++ dup.c 19 Apr 2004 16:15:50 -0000 1.5.2.1 @@ -50,56 +50,54 @@ #include "file.h" #include "sysio-symbols.h" -#include "sysio-symbols.h" - int -dup2(int oldfd, int newfd) +SYSIO_INTERFACE_NAME(dup2)(int oldfd, int newfd) { int rc; - SYSIO_ENTER; + int err; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; + err = 0; if (newfd < 0) { errno = EBADF; - SYSIO_LEAVE; - return -1; + SYSIO_INTERFACE_RETURN(-1, -EBADF); } - if (oldfd == newfd) { - SYSIO_LEAVE; - return newfd; - } + if (oldfd == newfd) + SYSIO_INTERFACE_RETURN(newfd, 0); rc = _sysio_fd_dup2(oldfd, newfd); if (rc < 0) { - errno = -rc; + errno = err = -rc; rc = -1; } - SYSIO_LEAVE; - return rc; + SYSIO_INTERFACE_RETURN(rc, err); } #ifdef REDSTORM #undef __dup2 -sysio_sym_weak_alias(dup2, __dup2) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(dup2), __dup2) #endif int -dup(int oldfd) +SYSIO_INTERFACE_NAME(dup)(int oldfd) { int rc; - SYSIO_ENTER; + int err; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; + err = 0; rc = _sysio_fd_dup2(oldfd, -1); if (rc < 0) { - errno = -rc; + errno = err = -rc; rc = -1; } - - SYSIO_LEAVE; - return rc; + SYSIO_INTERFACE_RETURN(rc, err); } #ifdef __GLIBC__ #undef __dup -sysio_sym_weak_alias(dup, __dup) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(dup), __dup) #endif Index: fcntl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fcntl.c,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -u -w -b -B -p -r1.8 -r1.8.2.1 --- fcntl.c 26 Jan 2004 16:34:54 -0000 1.8 +++ fcntl.c 19 Apr 2004 16:15:50 -0000 1.8.2.1 @@ -54,13 +54,14 @@ #include "sysio-symbols.h" int -fcntl(int fd, int cmd, ...) +SYSIO_INTERFACE_NAME(fcntl)(int fd, int cmd, ...) { int err; struct file *fil; va_list ap; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = 0; fil = _sysio_fd_find(fd); if (!fil) { @@ -84,8 +85,7 @@ fcntl(int fd, int cmd, ...) } rc = _sysio_fd_dup2(fd, (int )newfd); - SYSIO_LEAVE; - return rc; + SYSIO_INTERFACE_RETURN(rc, err); } break; default: @@ -100,16 +100,15 @@ out: errno = -err; err = -1; } - SYSIO_LEAVE; - return err; + SYSIO_INTERFACE_RETURN(err, err); } #ifdef __GLIBC__ #undef __fcntl -sysio_sym_weak_alias(fcntl, __fcntl) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(fcntl), __fcntl) #endif #ifdef BSD #undef _fcntl -sysio_sym_weak_alias(fcntl, _fcntl) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(fcntl), _fcntl) #endif Index: fsync.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fsync.c,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -w -b -B -p -r1.3 -r1.3.2.1 --- fsync.c 21 Jan 2004 14:44:53 -0000 1.3 +++ fsync.c 19 Apr 2004 16:15:50 -0000 1.3.2.1 @@ -55,23 +55,20 @@ fsync(int fd) { struct file *fil; int err; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find(fd); if (!(fil && fil->f_ino)) { errno = -EBADF; - SYSIO_LEAVE; - return -1; + SYSIO_INTERFACE_RETURN(-1, -EBADF); } err = (*fil->f_ino->i_ops.inop_sync)(fil->f_ino); if (err) { errno = -err; - SYSIO_LEAVE; - return -1; + SYSIO_INTERFACE_RETURN(-1, err); } - - SYSIO_LEAVE; - return 0; + SYSIO_INTERFACE_RETURN(err, err); } int @@ -79,21 +76,18 @@ fdatasync(int fd) { struct file *fil; int err; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find(fd); if (!(fil && fil->f_ino)) { errno = -EBADF; - SYSIO_LEAVE; - return -1; + SYSIO_INTERFACE_RETURN(-1, -EBADF); } err = (*fil->f_ino->i_ops.inop_datasync)(fil->f_ino); if (err) { errno = -err; - SYSIO_LEAVE; - return -1; + SYSIO_INTERFACE_RETURN(-1, err); } - - SYSIO_LEAVE; - return 0; + SYSIO_INTERFACE_RETURN(err, err); } Index: getdirentries.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/getdirentries.c,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -u -w -b -B -p -r1.8 -r1.8.2.1 --- getdirentries.c 24 Feb 2004 14:58:26 -0000 1.8 +++ getdirentries.c 19 Apr 2004 16:15:50 -0000 1.8.2.1 @@ -1,3 +1,69 @@ +/* + * 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-2004 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 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-2004 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... + */ + +#include <unistd.h> #include <stdlib.h> #ifdef __GLIBC__ #include <alloca.h> @@ -5,6 +71,7 @@ #include <string.h> #include <errno.h> #include <sys/types.h> +#include <sys/stat.h> #include <dirent.h> #include <sys/queue.h> @@ -32,6 +99,11 @@ _getdirentries64(int fd, return -1; } + if (!S_ISDIR(fil->f_ino->i_mode)) { + errno = ENOTDIR; + return -1; + } + cc = (*fil->f_ino->i_ops.inop_getdirentries)(fil->f_ino, buf, @@ -69,7 +141,7 @@ sysio_sym_strong_alias(_getdirentries64, ((((n) + (boundary) - 1 ) / (boundary)) * (boundary)) #endif -#if !(defined(BSD) || defined(REDSTORM)) +#ifndef BSD ssize_t getdirentries(int fd, char *buf, @@ -77,7 +149,7 @@ getdirentries(int fd, off_t * __restrict basep) #else int -getdirentries(int fd, +SYSIO_INTERFACE_NAME(getdirentries)(int fd, char *buf, int nbytes, long * __restrict basep) @@ -95,7 +167,7 @@ getdirentries(int fd, size_t n; size_t reclen; char *cp; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; #define _dbaselen ((size_t )&((struct dirent *)0)->d_name[0]) @@ -116,6 +188,7 @@ getdirentries(int fd, #define _fast_free(p) free(p) #endif + SYSIO_INTERFACE_ENTER; #if defined(BSD) || defined(REDSTORM) if (nbytes < 0) { errno = -EINVAL; @@ -205,8 +278,7 @@ out: if (dp == (struct dirent *)buf && cc < 0) { errno = (int )-cc; - SYSIO_LEAVE; - return -1; + SYSIO_INTERFACE_RETURN(-1, cc); } cc = (char *)dp - buf; if (cc) @@ -216,8 +288,7 @@ out: #else off; #endif - SYSIO_LEAVE; - return cc; + SYSIO_INTERFACE_RETURN(cc, cc >= 0 ? 0 : -1); #ifdef __GLIBC__ #undef _fast_alloc @@ -232,9 +303,9 @@ sysio_sym_strong_alias(_getdirentries64, #ifdef REDSTORM #undef __getdirentries -sysio_sym_weak_alias(getdirentries, __getdirentries) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(getdirentries)), __getdirentries) #endif #if defined(BSD) || defined(REDSTORM) #undef _getdirentries -sysio_sym_weak_alias(getdirentries, _getdirentries) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(getdirentries)), __getdirentries) #endif Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.14.2.1 retrieving revision 1.14.2.2 diff -u -w -b -B -p -r1.14.2.1 -r1.14.2.2 --- inode.c 4 Mar 2004 18:08:07 -0000 1.14.2.1 +++ inode.c 19 Apr 2004 16:15:50 -0000 1.14.2.2 @@ -876,3 +876,83 @@ _sysio_setattr(struct pnode *pno, ino = pno->p_base->pb_ino; return (*ino->i_ops.inop_setattr)(pno, ino, mask, stbuf); } + +/* + * Do nothing. + */ +void +_sysio_do_noop() +{ + + return; +} + +/* + * Abort. + */ +void +_sysio_do_illop() +{ + + abort(); +} + +/* + * Return -EBADF + */ +int +_sysio_do_ebadf() +{ + + return -EBADF; +} + +/* + * Return -EINVAL + */ +int +_sysio_do_einval() +{ + + return -EINVAL; +} + +/* + * Return -ENOENT + */ +int +_sysio_do_enoent() +{ + + return -ENOENT; +} + +/* + * Return -ESPIPE + */ +int +_sysio_do_espipe() +{ + + return -ESPIPE; +} + +/* + * Return -EISDIR + */ +int +_sysio_do_eisdir() +{ + + return -EISDIR; +} + +/* + * Return -ENOSYS + */ +int +_sysio_do_enosys() +{ + + return -ENOSYS; +} Index: ioctl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctl.c,v retrieving revision 1.6.2.1 retrieving revision 1.6.2.2 diff -u -w -b -B -p -r1.6.2.1 -r1.6.2.2 --- ioctl.c 4 Mar 2004 18:08:07 -0000 1.6.2.1 +++ ioctl.c 19 Apr 2004 16:15:50 -0000 1.6.2.2 @@ -53,13 +53,14 @@ #include "sysio-symbols.h" int -ioctl(int fd, unsigned long request, ...) +SYSIO_INTERFACE_NAME(ioctl)(int fd, unsigned long request, ...) { int err; struct file *fil; va_list ap; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = 0; fil = _sysio_fd_find(fd); if (!fil) { @@ -76,17 +77,16 @@ out: errno = -err; err = -1; } - SYSIO_LEAVE; - return err; + SYSIO_INTERFACE_RETURN(err, err); } #ifdef __GLIBC__ #undef __ioctl -sysio_sym_weak_alias(ioctl, __ioctl) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(ioctl), __ioctl) #endif #ifdef BSD #undef _ioctl -sysio_sym_weak_alias(ioctl, _ioctl) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(ioctl), _ioctl) #endif Index: ioctx.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctx.c,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -u -w -b -B -p -r1.11 -r1.11.2.1 --- ioctx.c 1 Mar 2004 19:03:46 -0000 1.11 +++ ioctx.c 19 Apr 2004 16:15:50 -0000 1.11.2.1 @@ -372,6 +372,10 @@ _sysio_enumerate_extents(const struct in } while (xtvec.xtv_len) { if (iovec.iov_len) { + tmp = iovec.iov_len; + if (iovec.iov_len > xtvec.xtv_len) { + iovec.iov_len = xtvec.xtv_len; + } cc = (*f)(&iovec, 1, xtvec.xtv_off, @@ -383,7 +387,7 @@ _sysio_enumerate_extents(const struct in return cc; } iovec.iov_base = (char *)iovec.iov_base + cc; - iovec.iov_len -= cc; + iovec.iov_len = tmp - cc; tmp = cc + acc; if (acc && tmp <= acc) abort(); /* paranoia */ @@ -403,8 +407,11 @@ _sysio_enumerate_extents(const struct in } while (--iovlen); if (iov == start) { iovec = *iov++; - if (iovec.iov_len > n) +#if 0 + if (iovec.iov_len > n) { iovec.iov_len = n; + } +#endif continue; } remain = xtvec.xtv_len - n; @@ -418,11 +425,16 @@ _sysio_enumerate_extents(const struct in return acc; return cc; } - remain -= cc; + tmp = cc + acc; if (acc && tmp <= acc) abort(); /* paranoia */ acc = tmp; + + if (remain && !iovlen) + return acc; + + remain -= cc; if (remain) return acc; /* short */ } Index: iowait.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/iowait.c,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -u -w -b -B -p -r1.5 -r1.5.2.1 --- iowait.c 21 Jan 2004 14:44:53 -0000 1.5 +++ iowait.c 19 Apr 2004 16:15:50 -0000 1.5.2.1 @@ -71,18 +71,17 @@ iodone(ioid_t ioid) { struct ioctx *ioctx; int rc; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; ioctx = lookup_ioid(ioid); - if (!ioctx) { - SYSIO_LEAVE; - return -1; - } + if (!ioctx) + SYSIO_INTERFACE_RETURN(-1, -1); rc = (ioctx->ioctx_done || (*ioctx->ioctx_ino->i_ops.inop_iodone)(ioctx)); - SYSIO_LEAVE; - return rc; + + SYSIO_INTERFACE_RETURN(rc, rc >= 0 ? 0 : -1); } /* @@ -96,19 +95,17 @@ iowait(ioid_t ioid) { struct ioctx *ioctx; ssize_t cc; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; ioctx = lookup_ioid(ioid); - if (!ioctx) { - SYSIO_LEAVE; - return -1; - } + if (!ioctx) + SYSIO_INTERFACE_RETURN(-1, -1); cc = _sysio_ioctx_wait(ioctx); if (cc < 0) { errno = -(int )cc; cc = -1; } - SYSIO_LEAVE; - return cc; + SYSIO_INTERFACE_RETURN(cc, cc >= 0 ? 0 : -1); } Index: link.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/link.c,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -w -b -B -p -r1.4 -r1.4.2.1 --- link.c 14 Feb 2004 19:42:59 -0000 1.4 +++ link.c 19 Apr 2004 16:15:50 -0000 1.4.2.1 @@ -55,12 +55,14 @@ #include "sysio-symbols.h" int -link(const char *oldpath, const char *newpath) +SYSIO_INTERFACE_NAME(link)(const char *oldpath, const char *newpath) { struct intent intent; int err; struct pnode *old, *new; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; INTENT_INIT(&intent, 0, NULL, NULL); err = _sysio_namei(_sysio_cwd, oldpath, 0, &intent, &old); if (err) @@ -101,10 +103,10 @@ error1: err = -1; } out: - return err; + SYSIO_INTERFACE_RETURN(err, err); } #ifdef REDSTORM #undef __link -sysio_sym_weak_alias(link, __link) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(link), __link) #endif Index: lseek.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/lseek.c,v retrieving revision 1.13 retrieving revision 1.13.2.1 diff -u -w -b -B -p -r1.13 -r1.13.2.1 --- lseek.c 14 Feb 2004 19:42:59 -0000 1.13 +++ lseek.c 19 Apr 2004 16:15:50 -0000 1.13.2.1 @@ -60,7 +60,9 @@ _sysio_lseek(int fd, _SYSIO_OFF_T offset struct file *fil; _SYSIO_OFF_T off, pos; struct intnl_stat stbuf; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find(fd); if (!fil) return -EBADF; @@ -83,7 +85,8 @@ _sysio_lseek(int fd, _SYSIO_OFF_T offset fil->f_ino, &stbuf); if (err) - return err; + SYSIO_INTERFACE_RETURN(err, err); + } off = stbuf.st_size; break; @@ -91,22 +94,23 @@ _sysio_lseek(int fd, _SYSIO_OFF_T offset return -EINVAL; } pos = off + offset; - if ((offset < 0 && -offset > off) || - (off && offset && pos <= off)) - return -EINVAL; + if ((offset < 0 && -offset >= off) || + (offset > 0 && pos <= off)) + SYSIO_INTERFACE_RETURN(-EINVAL, -EINVAL); + #ifdef O_LARGEFILE if (pos >= ((fil->f_flags & O_LARGEFILE) ? _SYSIO_OFF_T_MAX : LONG_MAX)) - return -EOVERFLOW; + SYSIO_INTERFACE_RETURN(-EOVERFLOW, -EOVERFLOW); #else if (pos >= _SYSIO_OFF_T_MAX) - return -EOVERFLOW; + SYSIO_INTERFACE_RETURN(-EOVERFLOW, -EOVERFLOW); #endif - return fil->f_pos = pos; + SYSIO_INTERFACE_RETURN(pos, 0); } #if _LARGEFILE64_SOURCE #undef lseek64 -sysio_sym_weak_alias(_sysio_lseek, lseek64) +sysio_sym_weak_alias(_sysio_lseek, SYSIO_INTERFACE_NAME(lseek64)) #ifdef __GLIBC__ #undef __lseek64 sysio_sym_weak_alias(_sysio_lseek, __lseek64) @@ -120,34 +124,33 @@ sysio_sym_weak_alias(_sysio_lseek, __lib #undef lseek extern off_t -lseek(int fd, off_t offset, int whence) +SYSIO_INTERFACE_NAME(lseek)(int fd, off_t offset, int whence) { _SYSIO_OFF_T off; off_t rtn; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; off = _sysio_lseek(fd, offset, whence); if (off < 0) { errno = -off; - SYSIO_LEAVE; - return -1; + SYSIO_INTERFACE_RETURN((off_t )-1, off); } rtn = (off_t )off; assert(rtn == off); - SYSIO_LEAVE; - return rtn; + SYSIO_INTERFACE_RETURN(rtn, 0); } #ifdef __GLIBC__ #undef __lseek -sysio_sym_weak_alias(lseek, __lseek) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(lseek), __lseek) #endif #if 0 #ifdef __linux__ #undef llseek int -llseek(unsigned int fd __IS_UNUSED, +SYSIO_INTERFACE_NAME(llseek)(unsigned int fd __IS_UNUSED, unsigned long offset_high __IS_UNUSED, unsigned long offset_low __IS_UNUSED, loff_t *result __IS_UNUSED, @@ -162,6 +165,6 @@ llseek(unsigned int fd __IS_UNUSED, } #undef __llseek -sysio_sym_weak_alias(llseek, __llseek) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(llseek), __llseek) #endif #endif Index: mkdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mkdir.c,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -w -b -B -p -r1.6 -r1.6.2.1 --- mkdir.c 6 Feb 2004 20:07:30 -0000 1.6 +++ mkdir.c 19 Apr 2004 16:15:50 -0000 1.6.2.1 @@ -54,13 +54,14 @@ #include "sysio-symbols.h" int -mkdir(const char *path, mode_t mode) +SYSIO_INTERFACE_NAME(mkdir)(const char *path, mode_t mode) { int err; struct intent intent; struct pnode *pno; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; INTENT_INIT(&intent, INT_CREAT, &mode, NULL); err = _sysio_namei(_sysio_cwd, path, ND_NEGOK, &intent, &pno); if (err) @@ -82,12 +83,11 @@ out: errno = -err; err = -1; } - - SYSIO_LEAVE; - return err; + SYSIO_INTERFACE_RETURN(err, err); } #ifdef REDSTORM #undef __mkdir sysio_sym_weak_alias(mkdir, __mkdir) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(mkdir)), __mkdir) #endif Index: mknod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mknod.c,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -u -w -b -B -p -r1.7 -r1.7.2.1 --- mknod.c 26 Jan 2004 16:34:54 -0000 1.7 +++ mknod.c 19 Apr 2004 16:15:50 -0000 1.7.2.1 @@ -67,23 +67,27 @@ #endif int -__xmknod(int __ver, const char *path, mode_t mode, dev_t *dev) +PREPEND(__,SYSIO_INTERFACE_NAME(xmknod))(int __ver, + const char *path, + mode_t mode, + dev_t *dev) { int err; struct intent intent; struct pnode *pno; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; if (__ver != _MKNOD_VER) { err = -ENOSYS; goto out; } /* - * Support only character-special right now. + * Support only character-special and fifos right now. */ - if (((mode & S_IFMT) != S_IFIFO) && - ((mode & S_IFMT) != S_IFCHR)) { - err = -EPERM; + if (!(S_ISDIR(mode) || S_ISFIFO(mode))) { + err = -EINVAL; goto out; } @@ -109,24 +113,28 @@ out: errno = -err; err = -1; } - return err; + SYSIO_INTERFACE_RETURN(err, err); } + #ifdef REDSTORM #undef _xmknod -sysio_sym_weak_alias(__xmknod, _xmknod) +sysio_sym_weak_alias(PREPEND(__,SYSIO_INTERFACE_NAME(xmknod)), _xmknod) #endif - static int -__mknod(const char *path, mode_t mode, dev_t dev) +PREPEND(__,SYSIO_INTERFACE_NAME(mknod))(const char *path, + mode_t mode, + dev_t dev) { int rc; - SYSIO_ENTER; - rc = __xmknod(_MKNOD_VER, path, mode, &dev); + rc = PREPEND(__,SYSIO_INTERFACE_NAME(xmknod))(_MKNOD_VER, + path, + mode, + &dev); - SYSIO_LEAVE; return rc; } -sysio_sym_weak_alias(__mknod, mknod) +sysio_sym_weak_alias(PREPEND(__,SYSIO_INTERFACE_NAME(mknod)), \ + SYSIO_INTERFACE_NAME(mknod)) Index: mmap.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/Attic/mmap.c,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -w -b -B -p -r1.1.2.1 -r1.1.2.2 --- mmap.c 4 Mar 2004 18:08:07 -0000 1.1.2.1 +++ mmap.c 19 Apr 2004 16:15:50 -0000 1.1.2.2 @@ -63,21 +63,20 @@ mmap(void *start, { void *loc; struct file *fil; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find(fd); if (!fil) { errno = EBADF; - SYSIO_LEAVE; - return (void *)-1; + SYSIO_INTERFACE_RETURN((void *)-1, -EBADF); } loc = fil->f_ino->i_ops.inop_mmap(fil->f_ino, start, length, prot, flags, offset); - SYSIO_LEAVE; - return loc; + SYSIO_INTERFACE_RETURN(loc, 0); } #if 0 Index: mount.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mount.c,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -u -w -b -B -p -r1.11 -r1.11.2.1 --- mount.c 14 Feb 2004 19:42:59 -0000 1.11 +++ mount.c 19 Apr 2004 16:15:50 -0000 1.11.2.1 @@ -323,14 +323,16 @@ _sysio_mount(struct pnode *cwd, } int -mount(const char *source, +SYSIO_INTERFACE_NAME(mount)(const char *source, const char *target, const char *filesystemtype, unsigned long mountflags, const void *data) { int err; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = _sysio_mount(_sysio_cwd, source, @@ -342,15 +344,17 @@ mount(const char *source, errno = -err; err = -1; } - return err; + SYSIO_INTERFACE_RETURN(err, err); } int -umount(const char *target) +SYSIO_INTERFACE_NAME(umount)(const char *target) { int err; struct pnode *pno; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; /* * Look up the target path node. */ @@ -376,7 +380,7 @@ out: errno = -err; err = -1; } - return err; + SYSIO_INTERFACE_RETURN(err, err); } /* Index: namei.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/namei.c,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -u -w -b -B -p -r1.11 -r1.11.2.1 --- namei.c 14 Feb 2004 19:42:59 -0000 1.11 +++ namei.c 19 Apr 2004 16:15:50 -0000 1.11.2.1 @@ -252,7 +252,7 @@ _sysio_path_walk(struct pnode *parent, s S_ISDIR(ino->i_mode) && (nd->nd_pno->p_mount->mnt_flags & MOUNT_F_AUTO) && nd->nd_amcnt < MAX_MOUNT_DEPTH && - ino->i_mode & S_ISVTX) { + ino->i_mode & S_ISUID) { struct pnode *pno; /* Index: open.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/open.c,v retrieving revision 1.14 retrieving revision 1.14.2.1 diff -u -w -b -B -p -r1.14 -r1.14.2.1 --- open.c 25 Feb 2004 16:24:00 -0000 1.14 +++ open.c 19 Apr 2004 16:15:50 -0000 1.14.2.1 @@ -41,6 +41,11 @@ * le...@sa... */ +/* + * Incorporate the GNU flags for open if we can. + */ +#define _GNU_SOURCE + #include <stdlib.h> #include <string.h> #include <errno.h> @@ -122,7 +127,7 @@ _sysio_open(struct pnode *pno, int flags #undef open int -open(const char *path, int flags, ...) +SYSIO_INTERFACE_NAME(open)(const char *path, int flags, ...) { mode_t mode; unsigned ndflags; @@ -130,8 +135,9 @@ open(const char *path, int flags, ...) int err; struct pnode *pno; struct file *fil; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; /* * Get mode argument and determine parameters for namei */ @@ -157,7 +163,7 @@ open(const char *path, int flags, ...) va_arg(ap, int); #endif va_end(ap); - mode &= ~_sysio_umask & 0777; /* apply umask */ + mode &= ~(_sysio_umask & 0777) | 07000; /* apply umask */ if (flags & O_EXCL) { /* @@ -166,6 +172,10 @@ open(const char *path, int flags, ...) intent.int_opmask |= INT_CREAT; } } +#ifdef O_NOFOLLOW + if (flags & O_NOFOLLOW) + ndflags |= ND_NOFOLLOW; +#endif /* * Find the file. @@ -198,8 +208,7 @@ open(const char *path, int flags, ...) P_RELE(pno); - SYSIO_LEAVE; - return err; + SYSIO_INTERFACE_RETURN(err, 0); error: if (fil) @@ -207,54 +216,53 @@ error: if (pno) P_RELE(pno); errno = -err; - SYSIO_LEAVE; - return -1; + SYSIO_INTERFACE_RETURN(-1, err); } #ifdef __GLIBC__ #undef __open -sysio_sym_weak_alias(open, __open) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(open), __open) #undef open64 -sysio_sym_weak_alias(open, open64) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(open), open64) #undef __open64 -sysio_sym_weak_alias(open, __open64) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(open), __open64) #endif #ifdef REDSTORM #undef __libc_open64 -sysio_sym_weak_alias(open, __libc_open64) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(open), __libc_open64) #endif #ifdef BSD #undef _open -sysio_sym_weak_alias(open, _open) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(open), _open) #endif int -close(int fd) +SYSIO_INTERFACE_NAME(close)(int fd) { int err; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = _sysio_fd_close(fd); if (err) errno = -err; - SYSIO_LEAVE; - return err ? -1 : 0; + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } #ifdef __GLIBC__ #undef __close -sysio_sym_weak_alias(close, __close) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(close), __close) #endif #ifdef BSD #undef _close -sysio_sym_weak_alias(close, _close) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(close), _close) #endif int -creat(const char *path, mode_t mode) +SYSIO_INTERFACE_NAME(creat)(const char *path, mode_t mode) { return open(path, O_CREAT|O_WRONLY|O_TRUNC, mode); @@ -262,25 +270,25 @@ creat(const char *path, mode_t mode) #ifdef __GLIBC__ #undef __creat -sysio_sym_weak_alias(creat, __creat) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(creat), __creat) #undef creat64 -sysio_sym_weak_alias(creat, creat64) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(creat), creat64) #undef __creat64 -sysio_sym_weak_alias(creat, __creat64) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(creat), __creat64) #endif #ifdef REDSTORM #undef __libc_creat -sysio_sym_weak_alias(creat, __libc_creat) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(creat), __libc_creat) #endif #ifdef BSD #undef _creat -sysio_sym_weak_alias(creat, _creat) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(creat), _creat) #endif mode_t -umask(mode_t mask) +SYSIO_INTERFACE_NAME(umask)(mode_t mask) { mode_t omask; @@ -291,5 +299,5 @@ umask(mode_t mask) #ifdef REDSTORM #undef __umask -sysio_sym_weak_alias(umask, __umask) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(umask), __umask) #endif Index: rename.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rename.c,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -w -b -B -p -r1.3 -r1.3.2.1 --- rename.c 14 Feb 2004 19:42:59 -0000 1.3 +++ rename.c 19 Apr 2004 16:15:50 -0000 1.3.2.1 @@ -62,7 +62,9 @@ rename(const char *oldpath, const char * struct pnode *old, *new; struct pnode_base *nxtpb, *pb; struct intnl_stat ostbuf, nstbuf; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; /* * Resolve oldpath to a path node. */ @@ -178,5 +180,5 @@ error3: } _sysio_p_gone(old); /* kill it! */ out: - return err; + SYSIO_INTERFACE_RETURN(err, err); } Index: rmdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rmdir.c,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -u -w -b -B -p -r1.8 -r1.8.2.1 --- rmdir.c 14 Feb 2004 19:42:59 -0000 1.8 +++ rmdir.c 19 Apr 2004 16:15:50 -0000 1.8.2.1 @@ -60,8 +60,9 @@ rmdir(const char *path) int err; struct pnode *pno; struct inode *ino; + SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_ENTER; + SYSIO_INTERFACE_ENTER; INTENT_INIT(&intent, INT_UPDPARENT, NULL, NULL); err = _sysio_namei(_sysio_cwd, path, 0, &intent, &pno); if (err) @@ -86,12 +87,10 @@ out: errno = -err; err = -1; } - - SYSIO_LEAVE; - return err; + SYSIO_INTERFACE_RETURN(err, err); } #ifdef REDSTORM #undef __rmdir -sysio_sym_weak_alias(rmdir, __rmdir) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(rmdir)), __rmdir) #endif Index: rw.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rw.c,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -w -b -B -p -r1.3 -r1.3.2.1 --- rw.c 14 Feb 2004 19:42:59 -0000 1.3 +++ rw.c 19 Apr 2004 16:15:50 -0000 1.3.2.1 @@ -184,7 +184,7 @@ _sysio_sum_iovec(const struct iovec *iov while (count--) { tmp = cc; cc += iov->iov_len; - if (tmp && cc <= tmp) + if (tmp && iov->iov_len && cc <= tmp) return -EINVAL; iov++; } @@ -210,7 +210,7 @@ _sysio_iiov(int (*f)(struct inode *, str cc = _sysio_sum_iovec(iov, count); [...1190 lines suppressed...] #if _LARGEFILE64_SOURCE -#undef iwrite64x +#undef write64x ssize_t -write64x(int fd, +SYSIO_INTERFACE_NAME(write64x)(int fd, const struct iovec *iov, size_t iov_count, const struct xtvec64 *xtv, size_t xtv_count) { ioid_t ioid; - if ((ioid = iwrite64x(fd, iov, iov_count, xtv, xtv_count)) == IOID_FAIL) + if ((ioid = SYSIO_INTERFACE_NAME(iwrite64x)(fd, + iov, + iov_count, + xtv, + xtv_count)) == IOID_FAIL) return -1; return iowait(ioid); } Index: stat.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/stat.c,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -u -w -b -B -p -r1.9 -r1.9.2.1 --- stat.c 26 Jan 2004 16:34:54 -0000 1.9 +++ stat.c 19 Apr 2004 16:15:50 -0000 1.9.2.1 @@ -54,9 +54,11 @@ #include "sysio-symbols.h" +#ifndef REDSTORM #undef fstat #undef stat #undef lstat +#endif #undef __fxstat #undef __xstat @@ -88,7 +90,9 @@ convstat(struct stat64 *st64_buf, struct #endif int -__fxstat(int __ver, int __fildes, struct stat *__stat_buf) +PREPEND(__,SYSIO_INTERFACE_NAME(fxstat))(int __ver, + int __fildes, + struct stat *__stat_buf) { struct file *fil; int err; @@ -96,14 +100,11 @@ __fxstat(int __ver, int __fildes, struct #if _LARGEFILE64_SOURCE struct stat64 st64; #endif + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; if (__ver != _STAT_VER) { err = -ENOSYS; -#ifdef REDSTORM -#undef _fxstat -sysio_sym_weak_alias(__fxstat, _fxstat) -#endif - goto out; } @@ -128,30 +129,42 @@ out: #if _LARGEFILE64_SOURCE convstat(buf, __stat_buf); #endif - return err; + SYSIO_INTERFACE_RETURN(err, err); } +#ifdef REDSTORM +#undef _fxstat +sysio_sym_weak_alias(PREPEND(__,SYSIO_INTERFACE_NAME(fxstat)), _fxstat) +#endif + +#ifndef REDSTORM static int -__fstat(int fd, struct stat *buf) +PREPEND(__,SYSIO_INTERFACE_NAME(fstat))(int fd, struct stat *buf) { int rc; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; - rc = __fxstat(_STAT_VER, fd, buf); + SYSIO_INTERFACE_ENTER; + rc = PREPEND(__,SYSIO_INTERFACE_NAME(fxstat))(_STAT_VER, + fd, + buf); - SYSIO_LEAVE; - return rc; + SYSIO_INTERFACE_RETURN(rc, rc); } -sysio_sym_weak_alias(__fstat, fstat) +sysio_sym_weak_alias(PREPEND(__, SYSIO_INTERFACE_NAME(fstat)), + SYSIO_INTERFACE_NAME(fstat)) #ifdef BSD #undef _fstat -sysio_sym_weak_alias(__fstat, _fstat) +sysio_sym_weak_alias(PREPEND(__, SYSIO_INTERFACE_NAME(fstat)), _fstat) +#endif #endif int -__xstat(int __ver, const char *__filename, struct stat *__stat_buf) +PREPEND(__,SYSIO_INTERFACE_NAME(xstat))(int __ver, + const char *__filename, + struct stat *__stat_buf) { struct intent intent; int err; @@ -161,7 +174,9 @@ __xstat(int __ver, const char *__filenam #if _LARGEFILE64_SOURCE struct stat64 st64; #endif + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; if (__ver != _STAT_VER) { err = -ENOSYS; goto out; @@ -181,10 +196,6 @@ __xstat(int __ver, const char *__filenam ino->i_ops.inop_getattr(pno, pno->p_base->pb_ino, buf); -#ifdef REDSTORM -#undef _xstat -sysio_sym_weak_alias(__xstat, _xstat) -#endif P_RELE(pno); #if _LARGEFILE64_SOURCE @@ -195,30 +206,42 @@ out: errno = -err; err = -1; } - return err; + SYSIO_INTERFACE_RETURN(err, err); } +#ifdef REDSTORM +#undef _xstat +sysio_sym_weak_alias(PREPEND(__,SYSIO_INTERFACE_NAME(xstat)), _xstat) +#endif + +#ifndef REDSTORM static int -__stat(const char *filename, struct stat *buf) +PREPEND(__,SYSIO_INTERFACE_NAME(stat))(const char *filename, + struct stat *buf) { int rc; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; - rc = __xstat(_STAT_VER, filename, buf); + SYSIO_INTERFACE_ENTER; + rc = PREPEND(__,SYSIO_INTERFACE_NAME(xstat))(_STAT_VER, + filename, + buf); - SYSIO_LEAVE; - return rc; + SYSIO_INTERFACE_RETURN(rc, rc); } -sysio_sym_weak_alias(__stat, stat) +sysio_sym_weak_alias(PREPEND(__,SYSIO_INTERFACE_NAME(stat)), stat) #ifdef BSD #undef _stat -sysio_sym_weak_alias(__stat, _stat) +sysio_sym_weak_alias(PREPEND(__,SYSIO_INTERFACE_NAME(stat)), _stat) +#endif #endif int -__lxstat(int __ver, const char *__filename, struct stat *__stat_buf) +PREPEND(__,SYSIO_INTERFACE_NAME(lxstat))(int __ver, + const char *__filename, + struct stat *__stat_buf) { struct intent intent; int err; @@ -228,7 +251,9 @@ __lxstat(int __ver, const char *__filena #if _LARGEFILE64_SOURCE struct stat64 st64; #endif + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; if (__ver != _STAT_VER) { err = -ENOSYS; goto out; @@ -248,10 +273,6 @@ __lxstat(int __ver, const char *__filena ino->i_ops.inop_getattr(pno, pno->p_base->pb_ino, buf); -#ifdef REDSTORM -#undef _lxstat -sysio_sym_weak_alias(__lxstat, _lxstat) -#endif P_RELE(pno); #if _LARGEFILE64_SOURCE @@ -262,24 +283,32 @@ out: errno = -err; err = -1; } - return err; + SYSIO_INTERFACE_RETURN(err, err); } +#ifdef REDSTORM +#undef _lxstat +sysio_sym_weak_alias(PREPEND(__,SYSIO_INTERFACE_NAME(lxstat)), _lxstat) +#endif + +#ifndef REDSTORM static int -__lstat(const char *filename, struct stat *buf) +PREPEND(__,SYSIO_INTERFACE_NAME(lstat))(const char *filename, struct stat *buf) { int rc; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; - rc = __lxstat(_STAT_VER, filename, buf); - - SYSIO_LEAVE; - return rc; + SYSIO_INTERFACE_ENTER; + rc = PREPEND(__,SYSIO_INTERFACE_NAME(lxstat))(_STAT_VER, + filename, + buf); + SYSIO_INTERFACE_RETURN(rc, rc); } -sysio_sym_weak_alias(__lstat, lstat) +sysio_sym_weak_alias(PREPEND(__,SYSIO_INTERFACE_NAME(lstat)), lstat) #ifdef BSD #undef _lstat -sysio_sym_weak_alias(__lstat, _lstat) +sysio_sym_weak_alias(PREPEND(__,SYSIO_INTERFACE_NAME(lstat)), _lstat) +#endif #endif Index: stat64.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/stat64.c,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -w -b -B -p -r1.6 -r1.6.2.1 --- stat64.c 21 Jan 2004 14:44:53 -0000 1.6 +++ stat64.c 19 Apr 2004 16:15:50 -0000 1.6.2.1 @@ -54,9 +54,11 @@ #include "inode.h" #include "file.h" +#ifndef REDSTORM #undef fstat64 #undef stat64 #undef lstat64 +#endif #undef __fxstat64 #undef __xstat64 @@ -88,17 +90,19 @@ out: return err; } +#ifndef REDSTORM int -fstat64(int fd, struct stat64 *buf) +SYSIO_INTERFACE_NAME(fstat64)(int fd, struct stat64 *buf) { int rc; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; rc = __fxstat64(_STAT_VER, fd, buf); - SYSIO_LEAVE; - return rc; + SYSIO_INTERFACE_RETURN(rc, rc); } +#endif int __xstat64(int __ver, const char *__filename, struct stat64 *__stat_buf) @@ -129,17 +133,19 @@ out: return err; } +#ifndef REDSTORM int -stat64(const char *filename, struct stat64 *buf) +SYSIO_INTERFACE_NAME(stat64)(const char *filename, struct stat64 *buf) { int rc; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; rc = __xstat64(_STAT_VER, filename, buf); - SYSIO_LEAVE; - return rc; + SYSIO_INTERFACE_RETURN(rc, rc); } +#endif int __lxstat64(int __ver, const char *__filename, struct stat64 *__stat_buf) @@ -170,15 +176,17 @@ out: return err; } +#ifndef REDSTORM int -lstat64(const char *filename, struct stat64 *buf) +SYSIO_INTERFACE_NAME(lstat64)(const char *filename, struct stat64 *buf) { int rc; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; rc = __lxstat64(_STAT_VER, filename, buf); - SYSIO_LEAVE; - return rc; + SYSIO_INTERFACE_RETURN(rc, rc); } +#endif #endif /* !_LARGEFILE64_SOURCE */ Index: statvfs.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/statvfs.c,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -u -w -b -B -p -r1.7 -r1.7.2.1 --- statvfs.c 24 Feb 2004 14:58:26 -0000 1.7 +++ statvfs.c 19 Apr 2004 16:15:50 -0000 1.7.2.1 @@ -77,7 +77,7 @@ convstatvfs(struct statvfs *stvfsbuf, st #endif int -statvfs(const char *path, struct statvfs *buf) +SYSIO_INTERFACE_NAME(statvfs)(const char *path, struct statvfs *buf) { int err; struct pnode *pno; @@ -87,8 +87,9 @@ statvfs(const char *path, struct statvfs struct intnl_statvfs _call_buffer; struct intnl_statvfs *_call_buf = &_call_buffer; #endif - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); if (err) goto out; @@ -105,17 +106,16 @@ err: errno = -err; err = -1; out: - SYSIO_LEAVE; - return err; + SYSIO_INTERFACE_RETURN(err, err); +} + #ifdef REDSTORM #undef __statvfs -sysio_sym_weak_alias(statvfs, __statvfs) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(statvfs), __statvfs) #endif -} - int -fstatvfs(int fd, struct statvfs *buf) +SYSIO_INTERFACE_NAME(fstatvfs)(int fd, struct statvfs *buf) { int err; struct file *filp; @@ -125,8 +125,9 @@ fstatvfs(int fd, struct statvfs *buf) struct intnl_statvfs _call_buffer; struct intnl_statvfs *_call_buf = &_call_buffer; #endif - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = 0; filp = _sysio_fd_find(fd); if (!filp) { @@ -145,13 +146,12 @@ err: errno = -err; err = -1; out: - SYSIO_LEAVE; - return err; + SYSIO_INTERFACE_RETURN(err, err); } #ifdef REDSTORM #undef __fstatvfs -sysio_sym_weak_alias(fstatvfs, __fstatvfs) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(fstatvfs), __fstatvfs) #endif #endif /* ifndef BSD */ Index: statvfs64.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/statvfs64.c,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -u -w -b -B -p -r1.9 -r1.9.2.1 --- statvfs64.c 24 Feb 2004 14:58:26 -0000 1.9 +++ statvfs64.c 19 Apr 2004 16:15:50 -0000 1.9.2.1 @@ -55,12 +55,13 @@ #include "sysio-symbols.h" int -statvfs64(const char *path, struct statvfs64 *buf) +SYSIO_INTERFACE_NAME(statvfs64)(const char *path, struct statvfs64 *buf) { int err; struct pnode *pno; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); if (err) goto out; @@ -72,23 +73,22 @@ out: errno = -err; err = -1; } - - SYSIO_LEAVE; - return err; + SYSIO_INTERFACE_RETURN(err, err); } #ifdef REDSTORM #undef __statvfs64 -sysio_sym_weak_alias(statvfs64, __statvfs64) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(statvfs64), __statvfs64) #endif int -fstatvfs64(int fd, struct statvfs64 *buf) +SYSIO_INTERFACE_NAME(fstatvfs64)(int fd, struct statvfs64 *buf) { int err; struct file *filp; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = 0; filp = _sysio_fd_find(fd); if (!filp) { @@ -102,14 +102,12 @@ out: errno = -err; err = -1; } - - SYSIO_LEAVE; - return err; + SYSIO_INTERFACE_RETURN(err, err); } #ifdef REDSTORM #undef __fstatvfs64 -sysio_sym_weak_alias(fstatvfs64, __fstatvfs64) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(fstatvfs64), __fstatvfs64) #endif #endif /* ifndef BSD */ Index: symlink.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/symlink.c,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -w -b -B -p -r1.6 -r1.6.2.1 --- symlink.c 6 Feb 2004 20:07:30 -0000 1.6 +++ symlink.c 19 Apr 2004 16:15:50 -0000 1.6.2.1 @@ -54,13 +54,14 @@ #include "sysio-symbols.h" int -symlink(const char *oldpath, const char *newpath) +SYSIO_INTERFACE_NAME(symlink)(const char *oldpath, const char *newpath) { int err; struct intent intent; struct pnode *pno; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; INTENT_INIT(&intent, INT_CREAT, NULL, NULL); err = _sysio_namei(_sysio_cwd, newpath, ND_NEGOK, &intent, &pno); if (err) @@ -83,11 +84,10 @@ out: errno = -err; err = -1; } - SYSIO_LEAVE; - return err; + SYSIO_INTERFACE_RETURN(err, err); } #ifdef REDSTORM #undef __symlink -sysio_sym_weak_alias(symlink, __symlink) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(symlink), __symlink) #endif Index: truncate.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/truncate.c,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -u -w -b -B -p -r1.7 -r1.7.2.1 --- truncate.c 6 Feb 2004 20:07:30 -0000 1.7 +++ truncate.c 19 Apr 2004 16:15:50 -0000 1.7.2.1 @@ -83,12 +83,14 @@ do_truncate(struct pnode *pno, struct in } static int -_truncate(const char *path, _SYSIO_OFF_T length) +PREPEND(_,SYSIO_INTERFACE_NAME(truncate))(const char *path, + _SYSIO_OFF_T length) { int err; struct pnode *pno; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); if (err) goto out; @@ -100,33 +102,35 @@ out: errno = -err; err = -1; } - SYSIO_LEAVE; - return err; + SYSIO_INTERFACE_RETURN(err, err); } #if _LARGEFILE64_SOURCE #undef truncate64 -sysio_sym_weak_alias(_truncate, truncate64) +sysio_sym_weak_alias(PREPEND(_,SYSIO_INTERFACE_NAME(truncate)), \ + SYSIO_INTERFACE_NAME(truncate64)) #undef truncate int -truncate(const char *path, off_t length) +SYSIO_INTERFACE_NAME(truncate)(const char *path, off_t length) { - return _truncate(path, length); + return PREPEND(_,SYSIO_INTERFACE_NAME(truncate))(path, length); } #else #undef truncate -sysio_sym_weak_alias(_truncate, truncate) +sysio_sym_weak_alias(PREPEND(_,SYSIO_INTERFACE_NAME(truncate)), \ + SYSIO_INTERFACE_NAME(truncate)) #endif static int -_ftruncate(int fd, _SYSIO_OFF_T length) +PREPEND(_,SYSIO_INTERFACE_NAME(ftruncate))(int fd, _SYSIO_OFF_T length) { int err; struct file *fil; - SYSIO_ENTER; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = 0; fil = _sysio_fd_find(fd); if (!fil) { @@ -139,22 +143,21 @@ out: errno = -err; err = -1; } - SYSIO_LEAVE; - return err; + SYSIO_INTERFACE_RETURN(err, err); } #if _LARGEFILE64_SOURCE #undef ftruncate64 -sysio_sym_weak_alias(_ftruncate, ftruncate64) +sysio_sym_weak_alias(PREPEND(_,SYSIO_INTERFACE_NAME(ftruncate)), SYSIO_INTERFACE_NAME(ftruncate64)) #undef ftruncate int -ftruncate(int fd, off_t length) +SYSIO_INTERFACE_NAME(ftruncate)(int fd, off_t length) { - return _ftruncate(fd, length); + return PREPEND(_,SYSIO_INTERFACE_NAME(ftruncate))(fd, length); } #else #undef ftruncate -sysio_sym_weak_alias(_ftruncate, ftruncate) +sysio_sym_weak_alias(PREPEND(_,SYSIO_INTERFACE_NAME(ftruncate)), SYSIO_INTERFACE_NAME(ftruncate)) #endif Index: unlink.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/unlink.c,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -u -w -b -B -p -r1.9 -r1.9.2.1 --- unlink.c 14 Feb 2004 19:42:59 -0000 1.9 +++ unlink.c 19 Apr 2004 16:15:50 -0000 1.9.2.1 @@ -54,14 +54,15 @@ #include "sysio-symbols.h" int -unlink(const char *path) +SYSIO_INTERFACE_NAME(unlink)(const char *path) { struct intent intent; int err; struct pnode *pno; struct inode *ino; + SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_ENTER; + SYSIO_INTERFACE_ENTER; INTENT_INIT(&intent, INT_UPDPARENT, NULL, NULL); err = _sysio_namei(_sysio_cwd, path, ND_NOFOLLOW, &intent, &pno); if (err) @@ -96,11 +97,10 @@ out: errno = -err; err = -1; } - SYSIO_LEAVE; - return err; + SYSIO_INTERFACE_RETURN(err, err); } #ifdef REDSTORM #undef __unlink -sysio_sym_weak_alias(unlink, __unlink) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(unlink), __unlink) #endif Index: utime.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/utime.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -w -b -B -p -r1.2 -r1.2.2.1 --- utime.c 21 Jan 2004 14:44:53 -0000 1.2 +++ utime.c 19 Apr 2004 16:15:50 -0000 1.2.2.1 @@ -56,13 +56,15 @@ #include "file.h" int -utime(const char *path, const struct utimbuf *buf) +SYSIO_INTERFACE_NAME(utime)(const char *path, const struct utimbuf *buf) { int err; struct pnode *pno; struct utimbuf _utbuffer; struct intnl_stat stbuf; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); if (err) goto out; @@ -84,5 +86,5 @@ out: errno = -err; err = -1; } - return err; + SYSIO_INTERFACE_RETURN(err, err); } |
From: Ruth K. <rk...@us...> - 2004-04-19 16:14:57
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13045 Modified Files: Tag: gmdev sysio.h sysio-symbols.h Log Message: sysio interface frame macros and name label macros: SYSIO_INTERFACE_NAME(x) prepends a label defined in sysio.h, or does nothing SYSIO_DISPLAY_BLOCK frame variables, currently _saved_errno SYSIO_INTERFACE_ENTER store incoming errno, and call SYSIO_ENTER SYSIO_INTERFACE_RETURN(rtn, err) calls SYSIO_LEAVE restores saved errno val if err == 0, returns rtn Index: sysio.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio.h,v retrieving revision 1.18 retrieving revision 1.18.2.1 diff -u -w -b -B -p -r1.18 -r1.18.2.1 --- sysio.h 24 Feb 2004 14:03:55 -0000 1.18 +++ sysio.h 19 Apr 2004 16:14:47 -0000 1.18.2.1 @@ -188,7 +188,7 @@ extern off_t lseek(int fd, off_t offset, 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) +#ifdef BSD 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); @@ -316,6 +316,32 @@ extern int umount(const char *target); #define ASSERT do{}while(0) #endif +/* + * SYSIO interface frame macros + */ +#define XPREPEND(p,x) p ## x +#define PREPEND(p,x) XPREPEND(p,x) +#define SYSIO_LABEL_NAMES 0 +#if SYSIO_LABEL_NAMES +#define SYSIO_INTERFACE_NAME(x) PREPEND(sysio__,x) +#else +#define SYSIO_INTERFACE_NAME(x) x +#endif + +#define SYSIO_INTERFACE_DISPLAY_BLOCK \ + int _saved_errno; +#define SYSIO_INTERFACE_ENTER \ + do { \ + _saved_errno = errno; \ + SYSIO_ENTER; \ + } while (0) +#define SYSIO_INTERFACE_RETURN(rtn, err) \ + do { \ + SYSIO_LEAVE; \ + if (err) errno = _saved_errno; \ + return (rtn); \ + } while(0) + /* syscall enter/leave hook functions */ #if 0 extern void _sysio_sysenter(); Index: sysio-symbols.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio-symbols.h,v retrieving revision 1.2 retrieving revision 1.2.24.1 diff -u -w -b -B -p -r1.2 -r1.2.24.1 --- sysio-symbols.h 7 Mar 2003 03:31:36 -0000 1.2 +++ sysio-symbols.h 19 Apr 2004 16:14:48 -0000 1.2.24.1 @@ -2,11 +2,13 @@ #define HAVE_WEAK_SYMBOLS #endif +#define STRINGOF(x) #x + /* * Define alias, asym, as a strong alias for symbol, sym. */ #define sysio_sym_strong_alias(sym, asym) \ - extern __typeof(sym) asym __attribute__((alias(#sym))); + extern __typeof(sym) asym __attribute__((alias(STRINGOF(sym)))); #ifdef HAVE_WEAK_SYMBOLS @@ -14,7 +16,7 @@ * Define alias, asym, as a strong alias for symbol, sym. */ #define sysio_sym_weak_alias(sym, asym) \ - extern __typeof(sym) asym __attribute__((weak, alias(#sym))); + extern __typeof(sym) asym __attribute__((weak, alias(STRINGOF(sym)))); #else /* !defined(HAVE_ASM_WEAK_DIRECTIVE) */ /* |
From: Lee W. <lw...@us...> - 2004-04-17 21:15:23
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17314/native Modified Files: fs_native.c Log Message: From Kevin Pedretti; Build is broken on Linux/Opteron. There is no p{read,write}64 system call but _LARGEFILE64_SOURCE is defined. Altered to check for the presence of these calls as well as _LARGEFILE64_SOURCE. If any are not found, it assumes p{read,write} system calls are present. Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -w -b -B -p -r1.35 -r1.36 --- fs_native.c 16 Apr 2004 20:38:34 -0000 1.35 +++ fs_native.c 17 Apr 2004 21:15:03 -0000 1.36 @@ -1295,7 +1295,9 @@ out: static ssize_t dopio(void *buf, size_t count, _SYSIO_OFF_T off, struct native_io *nio) { -#ifdef _LARGEFILE64_SOURCE +#if defined(_LARGEFILE64_SOURCE) && \ + defined(SYS_pread64) && \ + defined(SYS_pwrite64) #define _NATIVE_SYSCALL_PREAD SYS_pread64 #define _NATIVE_SYSCALL_PWRITE SYS_pwrite64 #else |