libsysio-commit Mailing List for libsysio (Page 34)
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: Lee W. <lw...@us...> - 2004-01-26 17:22:59
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26398/drivers/native Modified Files: Tag: strided-io fs_native.c Log Message: Merged with head, again, after adding Kevin Pedretti's patches. This did not go cleanly. Some remedial testing indicates no problem but... Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.25.6.4 retrieving revision 1.25.6.5 diff -u -w -b -B -p -r1.25.6.4 -r1.25.6.5 --- fs_native.c 26 Jan 2004 16:27:47 -0000 1.25.6.4 +++ fs_native.c 26 Jan 2004 17:21:51 -0000 1.25.6.5 @@ -80,7 +80,6 @@ #ifdef REDSTORM #include <sys/uio.h> -#include <catamount/syscall.h> /* ! in sys include? */ #endif /* @@ -1420,9 +1419,9 @@ native_inop_fcntl(struct inode *ino, arg = va_arg(ap, long); return syscall(SYS_fcntl, nino->ni_fd, cmd, arg); default: - abort(); + break; } - return -1; + return -EINVAL; } static int |
|
From: Lee W. <lw...@us...> - 2004-01-26 16:49:32
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15788/src Modified Files: getdirentries.c Log Message: Problems with the patch from Kevin Pedretti. I *think* this is what he intended. Index: getdirentries.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/getdirentries.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -w -b -B -p -r1.6 -r1.7 --- getdirentries.c 26 Jan 2004 16:34:54 -0000 1.6 +++ getdirentries.c 26 Jan 2004 16:48:34 -0000 1.7 @@ -99,11 +99,11 @@ getdirentries(int fd, #define _dbaselen ((size_t )&((struct dirent *)0)->d_name[0]) -#ifdef __GLIBC +#ifdef __GLIBC__ #define _dreclen(namlen) \ ((_dbaselen + (namlen) + __alignof__ (struct dirent)) & \ ~(__alignof__ (struct dirent) - 1)) -#else /* !define(__GLIBC__) */ +#else /* !defined(__GLIBC__) */ #define _dreclen(namlen) \ _rndup(_dbaselen + (namlen) + 1, sizeof(int)) #endif @@ -230,11 +230,10 @@ out: sysio_sym_strong_alias(_getdirentries64, getdirentries) #endif -#endif - #ifdef REDSTORM #undef __getdirentries sysio_sym_weak_alias(getdirentries, __getdirentries) +#endif #if defined(BSD) || defined(REDSTORM) #undef _getdirentries sysio_sym_weak_alias(getdirentries, _getdirentries) |
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11610/src Modified Files: access.c chdir.c chmod.c chown.c dup.c fcntl.c getdirentries.c ioctl.c link.c lseek.c mkdir.c mknod.c open.c read.c rmdir.c stat.c statvfs.c statvfs64.c symlink.c unlink.c write.c Log Message: Patches from Kevin Pedretti (kt...@sa...) allowing for the change from a BSD-based libc to glibc-based on Red Storm. Index: access.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/access.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -b -B -p -r1.2 -r1.3 --- access.c 6 Aug 2003 19:10:26 -0000 1.2 +++ access.c 26 Jan 2004 16:34:54 -0000 1.3 @@ -47,6 +47,8 @@ #include <sys/stat.h> #include <unistd.h> +#include "sysio-symbols.h" + int access(const char *path, int amode) { @@ -108,3 +110,8 @@ out: return err; } + +#ifdef REDSTORM +#undef __access +sysio_sym_weak_alias(access, __access) +#endif Index: chdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chdir.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -b -B -p -r1.11 -r1.12 --- chdir.c 21 Jan 2004 14:44:53 -0000 1.11 +++ chdir.c 26 Jan 2004 16:34:54 -0000 1.12 @@ -140,6 +139,11 @@ chdir(const char *path) * 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) { @@ -240,7 +244,7 @@ getcwd(char *buf, size_t size) sysio_sym_weak_alias(getcwd, __getcwd) #endif -#ifdef PATH_MAX +#if defined(PATH_MAX) && !(defined(REDSTORM)) char * getwd(char *buf) { Index: chmod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chmod.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -b -B -p -r1.5 -r1.6 --- chmod.c 21 Jan 2004 14:44:53 -0000 1.5 +++ chmod.c 26 Jan 2004 16:34:54 -0000 1.6 @@ -52,6 +52,7 @@ #include "sysio.h" #include "inode.h" #include "file.h" +#include "sysio-symbols.h" static int do_chmod(struct pnode *pno, struct inode *ino, mode_t mode) @@ -88,6 +89,11 @@ out: return err; } +#ifdef REDSTORM +#undef __chmod +sysio_sym_weak_alias(chmod, __chmod) +#endif + int fchmod(int fd, mode_t mode) { @@ -109,3 +115,8 @@ out: } return err; } + +#ifdef REDSTORM +#undef __fchmod +sysio_sym_weak_alias(fchmod, __fchmod) +#endif Index: chown.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chown.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -b -B -p -r1.5 -r1.6 --- chown.c 21 Jan 2004 14:44:53 -0000 1.5 +++ chown.c 26 Jan 2004 16:34:54 -0000 1.6 @@ -52,6 +52,7 @@ #include "sysio.h" #include "inode.h" #include "file.h" +#include "sysio-symbols.h" static int _do_chown(struct pnode *pno, struct inode *ino, uid_t owner, gid_t group) @@ -94,6 +95,11 @@ out: } SYSIO_LEAVE; return err; +#ifdef REDSTORM +#undef __chown +sysio_sym_weak_alias(chown, __chown) +#endif + } int @@ -115,5 +121,10 @@ out: errno = -err; err = -1; } + +#ifdef REDSTORM +#undef __fchown +sysio_sym_weak_alias(fchown, __fchown) +#endif return err; } Index: dup.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/dup.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -b -B -p -r1.3 -r1.4 --- dup.c 21 Jan 2004 14:44:53 -0000 1.3 +++ dup.c 26 Jan 2004 16:34:54 -0000 1.4 @@ -48,6 +48,7 @@ #include "sysio.h" #include "file.h" +#include "sysio-symbols.h" #include "sysio-symbols.h" @@ -64,12 +65,22 @@ dup2(int oldfd, int newfd) } if (oldfd == newfd) { +#ifdef REDSTORM +#undef __dup2 +sysio_sym_weak_alias(dup2, __dup2) +#endif + SYSIO_LEAVE; return newfd; } rc = _sysio_fd_dup2(oldfd, newfd); if (rc < 0) { + +#ifdef REDSTORM +#undef __dup +sysio_sym_weak_alias(dup, __dup) +#endif errno = -rc; rc = -1; } Index: fcntl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fcntl.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -b -B -p -r1.7 -r1.8 --- fcntl.c 21 Jan 2004 14:44:53 -0000 1.7 +++ fcntl.c 26 Jan 2004 16:34:54 -0000 1.8 @@ -109,7 +109,7 @@ out: sysio_sym_weak_alias(fcntl, __fcntl) #endif -#if defined(BSD) || defined(REDSTORM) +#ifdef BSD #undef _fcntl sysio_sym_weak_alias(fcntl, _fcntl) #endif Index: getdirentries.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/getdirentries.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -b -B -p -r1.5 -r1.6 --- getdirentries.c 21 Jan 2004 14:44:53 -0000 1.5 +++ getdirentries.c 26 Jan 2004 16:34:54 -0000 1.6 @@ -99,15 +98,20 @@ getdirentries(int fd, SYSIO_ENTER; #define _dbaselen ((size_t )&((struct dirent *)0)->d_name[0]) -#ifdef __GLIBC__ + +#ifdef __GLIBC #define _dreclen(namlen) \ ((_dbaselen + (namlen) + __alignof__ (struct dirent)) & \ ~(__alignof__ (struct dirent) - 1)) -#define _fast_alloc(n) alloca(n) -#define _fast_free(p) -#else /* !defined(__GLIBC__) */ +#else /* !define(__GLIBC__) */ #define _dreclen(namlen) \ _rndup(_dbaselen + (namlen) + 1, sizeof(int)) +#endif + +#if defined(__GLIBC__) && !(defined(REDSTORM)) +#define _fast_alloc(n) alloca(n) +#define _fast_free(p) +#else /* !defined(__GLIBC__) || defined(REDSTORM) */ #define _fast_alloc(n) malloc(n) #define _fast_free(p) free(p) #endif @@ -226,6 +230,11 @@ out: sysio_sym_strong_alias(_getdirentries64, getdirentries) #endif +#endif + +#ifdef REDSTORM +#undef __getdirentries +sysio_sym_weak_alias(getdirentries, __getdirentries) #if defined(BSD) || defined(REDSTORM) #undef _getdirentries sysio_sym_weak_alias(getdirentries, _getdirentries) Index: ioctl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctl.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -b -B -p -r1.5 -r1.6 --- ioctl.c 21 Jan 2004 14:44:53 -0000 1.5 +++ ioctl.c 26 Jan 2004 16:34:54 -0000 1.6 @@ -86,7 +86,7 @@ out: sysio_sym_weak_alias(ioctl, __ioctl) #endif -#if defined(BSD) || defined(REDSTORM) +#ifdef BSD #undef _ioctl sysio_sym_weak_alias(ioctl, _ioctl) #endif Index: link.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/link.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -b -B -p -r1.2 -r1.3 --- link.c 20 Oct 2003 16:31:23 -0000 1.2 +++ link.c 26 Jan 2004 16:34:54 -0000 1.3 @@ -52,6 +52,7 @@ #include "sysio.h" #include "mount.h" #include "inode.h" +#include "sysio-symbols.h" int link(const char *oldpath, const char *newpath) @@ -100,3 +101,8 @@ error2: out: return err; } + +#ifdef REDSTORM +#undef __link +sysio_sym_weak_alias(link, __link) +#endif Index: lseek.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/lseek.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- lseek.c 21 Jan 2004 14:44:53 -0000 1.10 +++ lseek.c 26 Jan 2004 16:34:54 -0000 1.11 @@ -110,6 +110,10 @@ sysio_sym_weak_alias(_sysio_lseek, lseek #undef __lseek64 sysio_sym_weak_alias(_sysio_lseek, __lseek64) #endif +#ifdef REDSTORM +#undef __libc_lseek64 +sysio_sym_weak_alias(_sysio_lseek, __libc_lseek64) +#endif #endif #undef lseek Index: mkdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mkdir.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -b -B -p -r1.4 -r1.5 --- mkdir.c 21 Jan 2004 14:44:53 -0000 1.4 +++ mkdir.c 26 Jan 2004 16:34:54 -0000 1.5 @@ -51,6 +51,7 @@ #include "inode.h" #include "fs.h" #include "mount.h" +#include "sysio-symbols.h" int mkdir(const char *path, mode_t mode) @@ -82,6 +83,11 @@ out: err = -1; } + +#ifdef REDSTORM +#undef __mkdir +sysio_sym_weak_alias(mkdir, __mkdir) +#endif SYSIO_LEAVE; return err; } Index: mknod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mknod.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -w -b -B -p -r1.6 -r1.7 --- mknod.c 21 Jan 2004 14:44:53 -0000 1.6 +++ mknod.c 26 Jan 2004 16:34:54 -0000 1.7 @@ -111,6 +111,11 @@ out: } return err; } +#ifdef REDSTORM +#undef _xmknod +sysio_sym_weak_alias(__xmknod, _xmknod) +#endif + static int __mknod(const char *path, mode_t mode, dev_t dev) Index: open.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/open.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -w -b -B -p -r1.12 -r1.13 --- open.c 21 Jan 2004 14:44:53 -0000 1.12 +++ open.c 26 Jan 2004 16:34:54 -0000 1.13 @@ -220,7 +220,12 @@ sysio_sym_weak_alias(open, open64) sysio_sym_weak_alias(open, __open64) #endif -#if defined(BSD) || defined(REDSTORM) +#ifdef REDSTORM +#undef __libc_open64 +sysio_sym_weak_alias(open, __libc_open64) +#endif + +#ifdef BSD #undef _open sysio_sym_weak_alias(open, _open) #endif @@ -243,7 +248,7 @@ close(int fd) sysio_sym_weak_alias(close, __close) #endif -#if defined(BSD) || defined(REDSTORM) +#ifdef BSD #undef _close sysio_sym_weak_alias(close, _close) #endif @@ -264,7 +269,12 @@ sysio_sym_weak_alias(creat, creat64) sysio_sym_weak_alias(creat, __creat64) #endif -#if defined(BSD) || defined(REDSTORM) +#ifdef REDSTORM +#undef __libc_creat +sysio_sym_weak_alias(creat, __libc_creat) +#endif + +#ifdef BSD #undef _creat sysio_sym_weak_alias(creat, _creat) #endif @@ -278,3 +288,8 @@ umask(mode_t mask) _sysio_umask = mask & 0777; return omask; } + +#ifdef REDSTORM +#undef __umask +sysio_sym_weak_alias(umask, __umask) +#endif Index: read.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/read.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -b -B -p -r1.11 -r1.12 --- read.c 21 Jan 2004 15:06:31 -0000 1.11 +++ read.c 26 Jan 2004 16:34:54 -0000 1.12 @@ -181,6 +180,13 @@ pread(int fd, void *buf, size_t count, o } #else #undef pread +#ifdef REDSTORM +#undef __libc_pread +sysio_sym_weak_alias(pread, __libc_pread) +#undef __libc_pread64 +sysio_sym_weak_alias(pread64, __libc_pread64) +#endif + sysio_sym_weak_alias(_pread, pread) #endif @@ -235,11 +241,18 @@ readv(int fd, const struct iovec *iov, i return iowait(ioid); } -#if defined(BSD) || defined(REDSTORM) +#ifdef BSD #undef _readv sysio_sym_weak_alias(readv, _readv) #endif +#ifdef REDSTORM +#undef __libc_readv +sysio_sym_weak_alias(readv, __libc_readv) +#undef __readv +sysio_sym_weak_alias(readv, __readv) +#endif + ssize_t read(int fd, void *buf, size_t count) { @@ -256,7 +269,12 @@ read(int fd, void *buf, size_t count) sysio_sym_weak_alias(read, __read) #endif -#if defined(BSD) || defined(REDSTORM) +#ifdef REDSTORM +#undef __libc_read +sysio_sym_weak_alias(read, __libc_read) +#endif + +#ifdef BSD #undef _read sysio_sym_weak_alias(read, _read) #endif Index: rmdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rmdir.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -b -B -p -r1.5 -r1.6 --- rmdir.c 21 Jan 2004 14:44:53 -0000 1.5 +++ rmdir.c 26 Jan 2004 16:34:54 -0000 1.6 @@ -51,6 +51,7 @@ #include "inode.h" #include "fs.h" #include "mount.h" +#include "sysio-symbols.h" int rmdir(const char *path) @@ -84,5 +85,10 @@ out: err = -1; } SYSIO_LEAVE; + +#ifdef REDSTORM +#undef __rmdir +sysio_sym_weak_alias(rmdir, __rmdir) +#endif return err; } Index: stat.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/stat.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -w -b -B -p -r1.8 -r1.9 --- stat.c 21 Jan 2004 14:44:53 -0000 1.8 +++ stat.c 26 Jan 2004 16:34:54 -0000 1.9 @@ -99,6 +99,11 @@ __fxstat(int __ver, int __fildes, struct if (__ver != _STAT_VER) { err = -ENOSYS; +#ifdef REDSTORM +#undef _fxstat +sysio_sym_weak_alias(__fxstat, _fxstat) +#endif + goto out; } @@ -140,7 +145,7 @@ __fstat(int fd, struct stat *buf) sysio_sym_weak_alias(__fstat, fstat) -#if defined(BSD) || defined(REDSTORM) +#ifdef BSD #undef _fstat sysio_sym_weak_alias(__fstat, _fstat) #endif @@ -176,6 +181,11 @@ __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 convstat(buf, __stat_buf); @@ -202,7 +212,7 @@ __stat(const char *filename, struct stat sysio_sym_weak_alias(__stat, stat) -#if defined(BSD) || defined(REDSTORM) +#ifdef BSD #undef _stat sysio_sym_weak_alias(__stat, _stat) #endif @@ -238,6 +248,11 @@ __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 convstat(buf, __stat_buf); @@ -264,7 +279,7 @@ __lstat(const char *filename, struct sta sysio_sym_weak_alias(__lstat, lstat) -#if defined(BSD) || defined(REDSTORM) +#ifdef BSD #undef _lstat sysio_sym_weak_alias(__lstat, _lstat) #endif Index: statvfs.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/statvfs.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -b -B -p -r1.5 -r1.6 --- statvfs.c 21 Jan 2004 14:44:53 -0000 1.5 +++ statvfs.c 26 Jan 2004 16:34:54 -0000 1.6 @@ -43,7 +43,7 @@ #ifdef _HAVE_STATVFS -#if !(defined(BSD) || defined(REDSTORM)) +#ifndef BSD #include <unistd.h> #include <errno.h> @@ -55,6 +55,7 @@ #include "sysio.h" #include "inode.h" #include "file.h" +#include "sysio-symbols.h" #undef statvfs #undef fstatvfs @@ -108,6 +109,11 @@ err: out: SYSIO_LEAVE; return err; +#ifdef REDSTORM +#undef __statvfs +sysio_sym_weak_alias(statvfs, __statvfs) +#endif + } int @@ -144,5 +150,11 @@ out: SYSIO_LEAVE; return err; } -#endif /* if !(defined(BSD) || defined(REDSTORM)) */ + +#ifdef REDSTORM +#undef __fstatvfs +sysio_sym_weak_alias(fstatvfs, __fstatvfs) +#endif + +#endif /* ifndef BSD */ #endif /* defined(_HAVE_STATVFS) */ Index: statvfs64.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/statvfs64.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -w -b -B -p -r1.6 -r1.7 --- statvfs64.c 21 Jan 2004 14:44:53 -0000 1.6 +++ statvfs64.c 26 Jan 2004 16:34:54 -0000 1.7 @@ -43,7 +43,7 @@ #ifdef _HAVE_STATVFS -#if !(defined(BSD) || defined(REDSTORM)) +#ifndef BSD #include <unistd.h> #include <errno.h> #include <assert.h> @@ -54,6 +54,7 @@ #include "sysio.h" #include "inode.h" #include "file.h" +#include "sysio-symbols.h" int statvfs64(const char *path, struct statvfs64 *buf) @@ -75,6 +76,11 @@ out: } SYSIO_LEAVE; +#ifdef REDSTORM +#undef __statvfs64 +sysio_sym_weak_alias(statvfs64, __statvfs64) +#endif + return err; } @@ -102,5 +108,11 @@ out: SYSIO_LEAVE; return err; } -#endif /* if !(defined(BSD) || defined(REDSTORM)) */ + +#ifdef REDSTORM +#undef __fstatvfs64 +sysio_sym_weak_alias(fstatvfs64, __fstatvfs64) +#endif + +#endif /* ifndef BSD */ #endif /* define(_HAVE_STATVFS) */ Index: symlink.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/symlink.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -b -B -p -r1.4 -r1.5 --- symlink.c 21 Jan 2004 14:44:53 -0000 1.4 +++ symlink.c 26 Jan 2004 16:34:54 -0000 1.5 @@ -51,6 +51,7 @@ #include "inode.h" #include "fs.h" #include "mount.h" +#include "sysio-symbols.h" int symlink(const char *oldpath, const char *newpath) @@ -83,5 +84,10 @@ out: err = -1; } SYSIO_LEAVE; + +#ifdef REDSTORM +#undef __symlink +sysio_sym_weak_alias(symlink, __symlink) +#endif return err; } Index: unlink.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/unlink.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -w -b -B -p -r1.6 -r1.7 --- unlink.c 21 Jan 2004 14:44:53 -0000 1.6 +++ unlink.c 26 Jan 2004 16:34:54 -0000 1.7 @@ -51,6 +51,7 @@ #include "inode.h" #include "fs.h" #include "mount.h" +#include "sysio-symbols.h" int unlink(const char *path) @@ -84,5 +85,10 @@ out: err = -1; } SYSIO_LEAVE; + +#ifdef REDSTORM +#undef __unlink +sysio_sym_weak_alias(unlink, __unlink) +#endif return err; } Index: write.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/write.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -w -b -B -p -r1.12 -r1.13 --- write.c 21 Jan 2004 15:06:31 -0000 1.12 +++ write.c 26 Jan 2004 16:34:54 -0000 1.13 @@ -181,6 +180,17 @@ pwrite(int fd, const void *buf, size_t c } #else #undef pwrite +#ifdef REDSTORM +#undef __libc_pwrite +sysio_sym_weak_alias(pwrite, __libc_pwrite) +#undef __libc_pwrite64 +sysio_sym_weak_alias(pwrite, __libc_pwrite64) +#undef __pwrite +sysio_sym_weak_alias(pwrite, __pwrite) +#undef __pwrite64 +sysio_sym_weak_alias(pwrite, __pwrite64) +#endif + sysio_sym_weak_alias(_pwrite, pwrite) #endif @@ -235,11 +245,18 @@ writev(int fd, const struct iovec *iov, return iowait(ioid); } -#if defined(BSD) || defined(REDSTORM) +#ifdef BSD #undef _writev sysio_sym_weak_alias(writev, _writev) #endif +#ifdef REDSTORM +#undef __libc_writev +sysio_sym_weak_alias(writev, __libc_writev) +#undef __writev +sysio_sym_weak_alias(writev, __writev) +#endif + ssize_t write(int fd, const void *buf, size_t count) { @@ -256,7 +273,12 @@ write(int fd, const void *buf, size_t co sysio_sym_weak_alias(write, __write) #endif -#if defined(BSD) || defined(REDSTORM) +#ifdef REDSTORM +#undef __libc_write +sysio_sym_weak_alias(write, __libc_write) +#endif + +#ifdef BSD #undef _write sysio_sym_weak_alias(write, _write) #endif |
|
From: Lee W. <lw...@us...> - 2004-01-26 16:35:51
|
Update of /cvsroot/libsysio/libsysio/dev/stdfd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11610/dev/stdfd Modified Files: stdfd.c Log Message: Patches from Kevin Pedretti (kt...@sa...) allowing for the change from a BSD-based libc to glibc-based on Red Storm. Index: stdfd.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/dev/stdfd/stdfd.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -w -b -B -p -r1.6 -r1.7 --- stdfd.c 13 Oct 2003 01:04:34 -0000 1.6 +++ stdfd.c 26 Jan 2004 16:34:53 -0000 1.7 @@ -58,10 +58,6 @@ #include "stdfd.h" -#ifdef REDSTORM -#include <catamount/syscall.h> /* ! in sys include? */ -#endif - #ifdef CPLANT_YOD #include <sys/statfs.h> #include "cplant-yod.h" |
|
From: Lee W. <lw...@us...> - 2004-01-26 16:35:51
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11610/drivers/native Modified Files: fs_native.c Log Message: Patches from Kevin Pedretti (kt...@sa...) allowing for the change from a BSD-based libc to glibc-based on Red Storm. Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -w -b -B -p -r1.28 -r1.29 --- fs_native.c 21 Jan 2004 15:01:11 -0000 1.28 +++ fs_native.c 26 Jan 2004 16:34:53 -0000 1.29 @@ -76,7 +76,6 @@ #ifdef REDSTORM #include <sys/uio.h> -#include <catamount/syscall.h> /* ! in sys include? */ #endif #ifdef REDSTORM |
|
From: Lee W. <lw...@us...> - 2004-01-26 16:28:47
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9381/src Modified Files: Tag: strided-io chdir.c chmod.c chown.c dev.c dup.c fcntl.c fsync.c getdirentries.c init.c inode.c ioctl.c iowait.c lseek.c mkdir.c mknod.c namei.c open.c rmdir.c stat.c stat64.c statvfs.c statvfs64.c symlink.c truncate.c unlink.c utime.c Log Message: Merged in changes from HEAD. Added a little note in ChangeLog about the internal interface change. Index: chdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chdir.c,v retrieving revision 1.10 retrieving revision 1.10.6.1 diff -u -w -b -B -p -r1.10 -r1.10.6.1 --- chdir.c 27 Oct 2003 23:42:29 -0000 1.10 +++ chdir.c 26 Jan 2004 16:27:47 -0000 1.10.6.1 @@ -119,14 +119,19 @@ chdir(const char *path) { int err; struct pnode *pno; + SYSIO_ENTER; err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); if (err) { errno = -err; + SYSIO_LEAVE; return -1; } - return _sysio_p_chdir(pno); + err = _sysio_p_chdir(pno); + + SYSIO_LEAVE; + return err; } /* @@ -219,12 +224,15 @@ char * getcwd(char *buf, size_t size) { int err; + SYSIO_ENTER; err = _sysio_p_path(_sysio_cwd, &buf, buf ? size : 0); if (err) { errno = -err; + SYSIO_LEAVE; return NULL; } + SYSIO_LEAVE; return buf; } Index: chmod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chmod.c,v retrieving revision 1.4 retrieving revision 1.4.6.1 diff -u -w -b -B -p -r1.4 -r1.4.6.1 --- chmod.c 27 Sep 2003 19:42:02 -0000 1.4 +++ chmod.c 26 Jan 2004 16:27:47 -0000 1.4.6.1 @@ -70,12 +70,11 @@ do_chmod(struct pnode *pno, struct inode int chmod(const char *path, mode_t mode) { - struct intent intent; int err; struct pnode *pno; + SYSIO_ENTER; - INTENT_INIT(&intent, INT_SETATTR, NULL, NULL); - err = _sysio_namei(_sysio_cwd, path, 0, &intent, &pno); + err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); if (err) goto out; err = do_chmod(pno, pno->p_base->pb_ino, mode); @@ -85,6 +84,7 @@ out: errno = -err; err = -1; } + SYSIO_LEAVE; return err; } Index: chown.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chown.c,v retrieving revision 1.4 retrieving revision 1.4.6.1 diff -u -w -b -B -p -r1.4 -r1.4.6.1 --- chown.c 27 Sep 2003 19:42:02 -0000 1.4 +++ chown.c 26 Jan 2004 16:27:47 -0000 1.4.6.1 @@ -59,6 +59,7 @@ _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; @@ -91,6 +92,7 @@ out: errno = -err; err = -1; } + SYSIO_LEAVE; return err; } Index: dev.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/dev.c,v retrieving revision 1.4.6.1 retrieving revision 1.4.6.2 diff -u -w -b -B -p -r1.4.6.1 -r1.4.6.2 --- dev.c 26 Jan 2004 07:24:29 -0000 1.4.6.1 +++ dev.c 26 Jan 2004 16:27:47 -0000 1.4.6.2 @@ -158,7 +158,7 @@ _sysio_dev_lookup(mode_t mode, dev_t dev struct device *devtbl; dev_t major; - if (S_ISCHR(mode)) + if (S_ISCHR(mode) || S_ISFIFO(mode)) devtbl = cdev; else return (struct inode_ops *)&_sysio_nodev_ops; Index: dup.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/dup.c,v retrieving revision 1.2 retrieving revision 1.2.6.1 diff -u -w -b -B -p -r1.2 -r1.2.6.1 --- dup.c 23 Oct 2003 15:16:05 -0000 1.2 +++ dup.c 26 Jan 2004 16:27:47 -0000 1.2.6.1 @@ -54,23 +54,44 @@ int dup2(int oldfd, int newfd) { + int rc; + SYSIO_ENTER; if (newfd < 0) { errno = EBADF; + SYSIO_LEAVE; return -1; } - if (oldfd == newfd) + if (oldfd == newfd) { + SYSIO_LEAVE; return newfd; + } + + rc = _sysio_fd_dup2(oldfd, newfd); + if (rc < 0) { + errno = -rc; + rc = -1; + } - return _sysio_fd_dup2(oldfd, newfd); + SYSIO_LEAVE; + return rc; } int dup(int oldfd) { + int rc; + SYSIO_ENTER; + + rc = _sysio_fd_dup2(oldfd, -1); + if (rc < 0) { + errno = -rc; + rc = -1; + } - return _sysio_fd_dup2(oldfd, -1); + SYSIO_LEAVE; + return rc; } #ifdef __GLIBC__ Index: fcntl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fcntl.c,v retrieving revision 1.6 retrieving revision 1.6.6.1 diff -u -w -b -B -p -r1.6 -r1.6.6.1 --- fcntl.c 14 Oct 2003 18:00:29 -0000 1.6 +++ fcntl.c 26 Jan 2004 16:27:47 -0000 1.6.6.1 @@ -59,6 +59,7 @@ fcntl(int fd, int cmd, ...) int err; struct file *fil; va_list ap; + SYSIO_ENTER; err = 0; fil = _sysio_fd_find(fd); @@ -72,6 +73,7 @@ fcntl(int fd, int cmd, ...) case F_DUPFD: { long newfd; + int rc; va_start(ap, cmd); newfd = va_arg(ap, long); @@ -80,7 +82,10 @@ fcntl(int fd, int cmd, ...) err = -EBADF; goto out; } - return _sysio_fd_dup2(fd, (int )newfd); + rc = _sysio_fd_dup2(fd, (int )newfd); + + SYSIO_LEAVE; + return rc; } break; default: @@ -95,6 +100,7 @@ out: errno = -err; err = -1; } + SYSIO_LEAVE; return err; } Index: fsync.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fsync.c,v retrieving revision 1.2 retrieving revision 1.2.20.1 diff -u -w -b -B -p -r1.2 -r1.2.20.1 --- fsync.c 9 Mar 2003 06:22:43 -0000 1.2 +++ fsync.c 26 Jan 2004 16:27:47 -0000 1.2.20.1 @@ -55,17 +55,22 @@ fsync(int fd) { struct file *fil; int err; + SYSIO_ENTER; fil = _sysio_fd_find(fd); if (!(fil && fil->f_ino)) { errno = -EBADF; + SYSIO_LEAVE; return -1; } err = (*fil->f_ino->i_ops.inop_sync)(fil->f_ino); if (err) { errno = -err; + SYSIO_LEAVE; return -1; } + + SYSIO_LEAVE; return 0; } @@ -74,16 +79,21 @@ fdatasync(int fd) { struct file *fil; int err; + SYSIO_ENTER; fil = _sysio_fd_find(fd); if (!(fil && fil->f_ino)) { errno = -EBADF; + SYSIO_LEAVE; return -1; } err = (*fil->f_ino->i_ops.inop_datasync)(fil->f_ino); if (err) { errno = -err; + SYSIO_LEAVE; return -1; } + + SYSIO_LEAVE; return 0; } Index: getdirentries.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/getdirentries.c,v retrieving revision 1.4 retrieving revision 1.4.6.1 diff -u -w -b -B -p -r1.4 -r1.4.6.1 --- getdirentries.c 14 Oct 2003 18:00:29 -0000 1.4 +++ getdirentries.c 26 Jan 2004 16:27:47 -0000 1.4.6.1 @@ -96,6 +96,7 @@ getdirentries(int fd, size_t n; size_t reclen; char *cp; + SYSIO_ENTER; #define _dbaselen ((size_t )&((struct dirent *)0)->d_name[0]) #ifdef __GLIBC__ @@ -128,6 +129,7 @@ getdirentries(int fd, ibuf = _fast_alloc(inbytes); if (!ibuf) { errno = ENOMEM; + SYSIO_LEAVE; return -1; } @@ -199,6 +201,7 @@ out: if (dp == (struct dirent *)buf && cc < 0) { errno = (int )-cc; + SYSIO_LEAVE; return -1; } cc = (char *)dp - buf; @@ -209,6 +212,7 @@ out: #else off; #endif + SYSIO_LEAVE; return cc; #ifdef __GLIBC__ Index: init.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/init.c,v retrieving revision 1.3 retrieving revision 1.3.16.1 diff -u -w -b -B -p -r1.3 -r1.3.16.1 --- init.c 24 Mar 2003 22:09:06 -0000 1.3 +++ init.c 26 Jan 2004 16:27:47 -0000 1.3.16.1 @@ -64,6 +64,9 @@ int _sysio_init() { int err; +#ifdef WITH_SOCKETS + int _sysio_sockets_init(void); +#endif err = _sysio_ioctx_init(); if (err) @@ -83,6 +86,11 @@ _sysio_init() if (err) goto error; #endif +#ifdef WITH_SOCKETS + err = _sysio_sockets_init(); + if (err) + goto error; +#endif goto out; error: Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.11.6.1 retrieving revision 1.11.6.2 diff -u -w -b -B -p -r1.11.6.1 -r1.11.6.2 --- inode.c 26 Jan 2004 07:24:29 -0000 1.11.6.1 +++ inode.c 26 Jan 2004 16:27:47 -0000 1.11.6.2 @@ -217,7 +217,7 @@ _sysio_i_new(struct filesys *fs, if (!ino) return NULL; ino->i_ops = *ops; - if (S_ISBLK(type) || S_ISCHR(type)) { + if (S_ISBLK(type) || S_ISCHR(type) || S_ISFIFO(type)) { struct inode_ops *o; /* Index: ioctl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctl.c,v retrieving revision 1.4 retrieving revision 1.4.6.1 diff -u -w -b -B -p -r1.4 -r1.4.6.1 --- ioctl.c 14 Oct 2003 18:00:30 -0000 1.4 +++ ioctl.c 26 Jan 2004 16:27:48 -0000 1.4.6.1 @@ -58,6 +58,7 @@ ioctl(int fd, unsigned long request, ... int err; struct file *fil; va_list ap; + SYSIO_ENTER; err = 0; fil = _sysio_fd_find(fd); @@ -75,6 +76,7 @@ out: errno = -err; err = -1; } + SYSIO_LEAVE; return err; } Index: iowait.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/iowait.c,v retrieving revision 1.4 retrieving revision 1.4.6.1 diff -u -w -b -B -p -r1.4 -r1.4.6.1 --- iowait.c 17 Oct 2003 21:30:29 -0000 1.4 +++ iowait.c 26 Jan 2004 16:27:48 -0000 1.4.6.1 @@ -70,13 +70,19 @@ int iodone(ioid_t ioid) { struct ioctx *ioctx; + int rc; + SYSIO_ENTER; ioctx = lookup_ioid(ioid); - if (!ioctx) + if (!ioctx) { + SYSIO_LEAVE; return -1; + } - return (ioctx->ioctx_done || + rc = (ioctx->ioctx_done || (*ioctx->ioctx_ino->i_ops.inop_iodone)(ioctx)); + SYSIO_LEAVE; + return rc; } /* @@ -90,15 +96,19 @@ iowait(ioid_t ioid) { struct ioctx *ioctx; ssize_t cc; + SYSIO_ENTER; ioctx = lookup_ioid(ioid); - if (!ioctx) + if (!ioctx) { + SYSIO_LEAVE; return -1; + } cc = _sysio_ioctx_wait(ioctx); if (cc < 0) { errno = -(int )cc; cc = -1; } + SYSIO_LEAVE; return cc; } Index: lseek.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/lseek.c,v retrieving revision 1.9.6.2 retrieving revision 1.9.6.3 diff -u -w -b -B -p -r1.9.6.2 -r1.9.6.3 --- lseek.c 26 Jan 2004 07:10:57 -0000 1.9.6.2 +++ lseek.c 26 Jan 2004 16:27:48 -0000 1.9.6.3 @@ -119,14 +119,17 @@ lseek(int fd, off_t offset, int whence) { _SYSIO_OFF_T off; off_t rtn; + SYSIO_ENTER; off = _sysio_lseek(fd, offset, whence); if (off < 0) { errno = -off; + SYSIO_LEAVE; return -1; } rtn = (off_t )off; assert(rtn == off); + SYSIO_LEAVE; return rtn; } Index: mkdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mkdir.c,v retrieving revision 1.3 retrieving revision 1.3.16.1 diff -u -w -b -B -p -r1.3 -r1.3.16.1 --- mkdir.c 24 Mar 2003 22:09:06 -0000 1.3 +++ mkdir.c 26 Jan 2004 16:27:48 -0000 1.3.16.1 @@ -58,6 +58,7 @@ mkdir(const char *path, mode_t mode) int err; struct intent intent; struct pnode *pno; + SYSIO_ENTER; INTENT_INIT(&intent, INT_CREAT, &mode, NULL); err = _sysio_namei(_sysio_cwd, path, ND_NEGOK, &intent, &pno); @@ -80,5 +81,7 @@ out: errno = -err; err = -1; } + + SYSIO_LEAVE; return err; } Index: mknod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mknod.c,v retrieving revision 1.4 retrieving revision 1.4.6.1 diff -u -w -b -B -p -r1.4 -r1.4.6.1 --- mknod.c 10 Oct 2003 18:50:31 -0000 1.4 +++ mknod.c 26 Jan 2004 16:27:48 -0000 1.4.6.1 @@ -81,7 +81,8 @@ __xmknod(int __ver, const char *path, mo /* * Support only character-special right now. */ - if ((mode & S_IFMT) != S_IFCHR) { + if (((mode & S_IFMT) != S_IFIFO) && + ((mode & S_IFMT) != S_IFCHR)) { err = -EPERM; goto out; } @@ -114,8 +115,13 @@ out: static int __mknod(const char *path, mode_t mode, dev_t dev) { + int rc; + SYSIO_ENTER; - return __xmknod(_MKNOD_VER, path, mode, &dev); + rc = __xmknod(_MKNOD_VER, path, mode, &dev); + + SYSIO_LEAVE; + return rc; } sysio_sym_weak_alias(__mknod, mknod) Index: namei.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/namei.c,v retrieving revision 1.8 retrieving revision 1.8.6.1 diff -u -w -b -B -p -r1.8 -r1.8.6.1 --- namei.c 28 Oct 2003 20:59:39 -0000 1.8 +++ namei.c 26 Jan 2004 16:27:48 -0000 1.8.6.1 @@ -435,28 +435,12 @@ _sysio_path_walk(struct pnode *parent, s } #ifdef CPLANT_YOD -static const char * -strip_prefix(const char *path) -{ - /* * for backward compatibility w/protocol switch - * remove 'prefix:' iff first ':' immediately - * precedes first '/' + * remove everything up to the first ':' + * fortran libs prepend cwd to path, so not much choice */ - - char *colon, *slash; - - colon = strchr(path, ':'); - slash = strchr(path, '/'); - - if (slash == colon + 1) - return(slash); - else - return(path); - -} -#define STRIP_PREFIX(p) strip_prefix(p) +#define STRIP_PREFIX(p) strchr(p,':') ? strchr(p,':')+1 : p #else #define STRIP_PREFIX(p) p #endif Index: open.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/open.c,v retrieving revision 1.11 retrieving revision 1.11.6.1 diff -u -w -b -B -p -r1.11 -r1.11.6.1 --- open.c 14 Oct 2003 18:00:30 -0000 1.11 +++ open.c 26 Jan 2004 16:27:48 -0000 1.11.6.1 @@ -55,6 +55,7 @@ #include "file.h" #include "fs.h" #include "mount.h" +#include "sysio-symbols.h" #include "sysio-symbols.h" @@ -129,6 +130,7 @@ open(const char *path, int flags, ...) int err; struct pnode *pno; struct file *fil; + SYSIO_ENTER; /* * Get mode argument and determine parameters for namei @@ -169,7 +171,7 @@ open(const char *path, int flags, ...) * Find the file. */ fil = NULL; - INTENT_INIT(&intent, intent.int_opmask, &mode, NULL); + INTENT_INIT(&intent, intent.int_opmask, &mode, &flags); pno = NULL; err = _sysio_namei(_sysio_cwd, path, ndflags, &intent, &pno); if (err) { @@ -196,6 +198,7 @@ open(const char *path, int flags, ...) P_RELE(pno); + SYSIO_LEAVE; return err; error: @@ -204,6 +207,7 @@ error: if (pno) P_RELE(pno); errno = -err; + SYSIO_LEAVE; return -1; } @@ -225,10 +229,12 @@ int close(int fd) { int err; + SYSIO_ENTER; err = _sysio_fd_close(fd); if (err) errno = -err; + SYSIO_LEAVE; return err ? -1 : 0; } Index: rmdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rmdir.c,v retrieving revision 1.4 retrieving revision 1.4.6.1 diff -u -w -b -B -p -r1.4 -r1.4.6.1 --- rmdir.c 27 Sep 2003 19:42:03 -0000 1.4 +++ rmdir.c 26 Jan 2004 16:27:48 -0000 1.4.6.1 @@ -58,6 +58,7 @@ rmdir(const char *path) struct intent intent; int err; struct pnode *pno; + SYSIO_ENTER; INTENT_INIT(&intent, INT_UPDPARENT, NULL, NULL); err = _sysio_namei(_sysio_cwd, path, 0, &intent, &pno); @@ -82,5 +83,6 @@ out: errno = -err; err = -1; } + SYSIO_LEAVE; return err; } Index: stat.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/stat.c,v retrieving revision 1.7 retrieving revision 1.7.6.1 diff -u -w -b -B -p -r1.7 -r1.7.6.1 --- stat.c 24 Oct 2003 18:49:24 -0000 1.7 +++ stat.c 26 Jan 2004 16:27:48 -0000 1.7.6.1 @@ -129,8 +129,13 @@ out: static int __fstat(int fd, struct stat *buf) { + int rc; + SYSIO_ENTER; - return __fxstat(_STAT_VER, fd, buf); + rc = __fxstat(_STAT_VER, fd, buf); + + SYSIO_LEAVE; + return rc; } sysio_sym_weak_alias(__fstat, fstat) @@ -186,8 +191,13 @@ out: static int __stat(const char *filename, struct stat *buf) { + int rc; + SYSIO_ENTER; + + rc = __xstat(_STAT_VER, filename, buf); - return __xstat(_STAT_VER, filename, buf); + SYSIO_LEAVE; + return rc; } sysio_sym_weak_alias(__stat, stat) @@ -243,8 +253,13 @@ out: static int __lstat(const char *filename, struct stat *buf) { + int rc; + SYSIO_ENTER; + + rc = __lxstat(_STAT_VER, filename, buf); - return __lxstat(_STAT_VER, filename, buf); + SYSIO_LEAVE; + return rc; } sysio_sym_weak_alias(__lstat, lstat) Index: stat64.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/stat64.c,v retrieving revision 1.5 retrieving revision 1.5.6.1 diff -u -w -b -B -p -r1.5 -r1.5.6.1 --- stat64.c 21 Oct 2003 01:13:58 -0000 1.5 +++ stat64.c 26 Jan 2004 16:27:48 -0000 1.5.6.1 @@ -91,8 +91,13 @@ out: int fstat64(int fd, struct stat64 *buf) { + int rc; + SYSIO_ENTER; - return __fxstat64(_STAT_VER, fd, buf); + rc = __fxstat64(_STAT_VER, fd, buf); + + SYSIO_LEAVE; + return rc; } int @@ -127,8 +132,13 @@ out: int stat64(const char *filename, struct stat64 *buf) { + int rc; + SYSIO_ENTER; + + rc = __xstat64(_STAT_VER, filename, buf); - return __xstat64(_STAT_VER, filename, buf); + SYSIO_LEAVE; + return rc; } int @@ -163,7 +173,12 @@ out: int lstat64(const char *filename, struct stat64 *buf) { + int rc; + SYSIO_ENTER; + + rc = __lxstat64(_STAT_VER, filename, buf); - return __lxstat64(_STAT_VER, filename, buf); + SYSIO_LEAVE; + return rc; } #endif /* !_LARGEFILE64_SOURCE */ Index: statvfs.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/statvfs.c,v retrieving revision 1.4 retrieving revision 1.4.6.1 diff -u -w -b -B -p -r1.4 -r1.4.6.1 --- statvfs.c 10 Oct 2003 18:50:31 -0000 1.4 +++ statvfs.c 26 Jan 2004 16:27:48 -0000 1.4.6.1 @@ -88,6 +88,7 @@ statvfs(const char *path, struct statvfs struct intnl_statvfs _call_buffer; struct intnl_statvfs *_call_buf = &_call_buffer; #endif + SYSIO_ENTER; err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); if (err) @@ -105,6 +106,7 @@ err: errno = -err; err = -1; out: + SYSIO_LEAVE; return err; } @@ -119,6 +121,7 @@ fstatvfs(int fd, struct statvfs *buf) struct intnl_statvfs _call_buffer; struct intnl_statvfs *_call_buf = &_call_buffer; #endif + SYSIO_ENTER; err = 0; filp = _sysio_fd_find(fd); @@ -138,6 +141,7 @@ err: errno = -err; err = -1; out: + SYSIO_LEAVE; return err; } #endif /* if !(defined(BSD) || defined(REDSTORM)) */ Index: statvfs64.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/statvfs64.c,v retrieving revision 1.5 retrieving revision 1.5.6.1 diff -u -w -b -B -p -r1.5 -r1.5.6.1 --- statvfs64.c 21 Oct 2003 13:38:47 -0000 1.5 +++ statvfs64.c 26 Jan 2004 16:27:48 -0000 1.5.6.1 @@ -60,6 +60,7 @@ statvfs64(const char *path, struct statv { int err; struct pnode *pno; + SYSIO_ENTER; err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); if (err) @@ -72,6 +73,8 @@ out: errno = -err; err = -1; } + + SYSIO_LEAVE; return err; } @@ -80,6 +83,7 @@ fstatvfs64(int fd, struct statvfs64 *buf { int err; struct file *filp; + SYSIO_ENTER; err = 0; filp = _sysio_fd_find(fd); @@ -94,6 +98,8 @@ out: errno = -err; err = -1; } + + SYSIO_LEAVE; return err; } #endif /* if !(defined(BSD) || defined(REDSTORM)) */ Index: symlink.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/symlink.c,v retrieving revision 1.3 retrieving revision 1.3.16.1 diff -u -w -b -B -p -r1.3 -r1.3.16.1 --- symlink.c 24 Mar 2003 22:09:07 -0000 1.3 +++ symlink.c 26 Jan 2004 16:27:48 -0000 1.3.16.1 @@ -58,6 +58,7 @@ symlink(const char *oldpath, const char int err; struct intent intent; struct pnode *pno; + SYSIO_ENTER; INTENT_INIT(&intent, INT_CREAT, NULL, NULL); err = _sysio_namei(_sysio_cwd, newpath, ND_NEGOK, &intent, &pno); @@ -81,5 +82,6 @@ out: errno = -err; err = -1; } + SYSIO_LEAVE; return err; } Index: truncate.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/truncate.c,v retrieving revision 1.5.6.1 retrieving revision 1.5.6.2 diff -u -w -b -B -p -r1.5.6.1 -r1.5.6.2 --- truncate.c 23 Jan 2004 16:12:51 -0000 1.5.6.1 +++ truncate.c 26 Jan 2004 16:27:48 -0000 1.5.6.2 @@ -87,6 +87,7 @@ _truncate(const char *path, _SYSIO_OFF_T { int err; struct pnode *pno; + SYSIO_ENTER; err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); if (err) @@ -99,6 +100,7 @@ out: errno = -err; err = -1; } + SYSIO_LEAVE; return err; } @@ -123,6 +125,7 @@ _ftruncate(int fd, _SYSIO_OFF_T length) { int err; struct file *fil; + SYSIO_ENTER; err = 0; fil = _sysio_fd_find(fd); @@ -136,6 +139,7 @@ out: errno = -err; err = -1; } + SYSIO_LEAVE; return err; } Index: unlink.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/unlink.c,v retrieving revision 1.5 retrieving revision 1.5.6.1 diff -u -w -b -B -p -r1.5 -r1.5.6.1 --- unlink.c 30 Oct 2003 15:20:49 -0000 1.5 +++ unlink.c 26 Jan 2004 16:27:48 -0000 1.5.6.1 @@ -58,6 +58,7 @@ unlink(const char *path) struct intent intent; int err; struct pnode *pno; + SYSIO_ENTER; INTENT_INIT(&intent, INT_UPDPARENT, NULL, NULL); err = _sysio_namei(_sysio_cwd, path, ND_NOFOLLOW, &intent, &pno); @@ -82,5 +83,6 @@ out: errno = -err; err = -1; } + SYSIO_LEAVE; return err; } Index: utime.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/utime.c,v retrieving revision 1.1 retrieving revision 1.1.14.1 diff -u -w -b -B -p -r1.1 -r1.1.14.1 --- utime.c 27 Sep 2003 19:42:03 -0000 1.1 +++ utime.c 26 Jan 2004 16:27:48 -0000 1.1.14.1 @@ -58,14 +58,12 @@ int utime(const char *path, const struct utimbuf *buf) { - struct intent intent; int err; struct pnode *pno; struct utimbuf _utbuffer; struct intnl_stat stbuf; - INTENT_INIT(&intent, INT_SETATTR, NULL, NULL); - err = _sysio_namei(_sysio_cwd, path, 0, &intent, &pno); + err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); if (err) goto out; if (!buf) { |
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9381/tests Modified Files: Tag: strided-io Makefile.am cleanup.pl setup.pl sysio_stubs.c sysio_tests.c test_all.pl test_copy.pl test_driver.c test_getcwd.pl test_list.pl test_mounts.c test_path.pl test_stats.pl test_symlink.pl Log Message: Merged in changes from HEAD. Added a little note in ChangeLog about the internal interface change. Index: Makefile.am =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/Makefile.am,v retrieving revision 1.16.6.2 retrieving revision 1.16.6.3 diff -u -w -b -B -p -r1.16.6.2 -r1.16.6.3 --- Makefile.am 26 Jan 2004 07:09:05 -0000 1.16.6.2 +++ Makefile.am 26 Jan 2004 16:27:48 -0000 1.16.6.3 @@ -43,7 +43,16 @@ YOD_DRIVER_NAME= YOD_DRIVER_CFLAGS= endif -DRIVERS=$(NATIVE_DRIVER_NAME) $(INCORE_DRIVER_NAME) $(YOD_DRIVER_NAME) $(STFD_DEV_NAME) +if WITH_SOCKETS_DRIVER +SOCKETS_DRIVER_NAME=sockets +SOCKETS_DRIVER_CFLAGS= -I$(top_srcdir)/drivers/sockets +else +SOCKETS_DRIVER_NAME= +SOCKETS_DRIVER_CFLAGS= +endif + +DRIVERS=$(NATIVE_DRIVER_NAME) $(INCORE_DRIVER_NAME) $(YOD_DRIVER_NAME) \ + $(STFD_DEV_NAME) $(SOCKETS_DRIVER_NAME) CMNSRC=drv_init_all.c drv_data.c Index: cleanup.pl =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/cleanup.pl,v retrieving revision 1.1 retrieving revision 1.1.8.1 diff -u -w -b -B -p -r1.1 -r1.1.8.1 --- cleanup.pl 30 Oct 2003 15:22:19 -0000 1.1 +++ cleanup.pl 26 Jan 2004 16:27:48 -0000 1.1.8.1 @@ -46,8 +46,7 @@ if ((@ARGV > 1) && ($ARGV[$currarg++] eq my $cwd = $ARGV[$currarg]; # Get tests directory -my $testdir = $0; -$testdir =~ s/\/\w+.pl$//; +my $testdir = $FindBin::Bin; eval { if ($is_alpha == 0) { Index: setup.pl =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/setup.pl,v retrieving revision 1.1 retrieving revision 1.1.8.1 diff -u -w -b -B -p -r1.1 -r1.1.8.1 --- setup.pl 30 Oct 2003 15:22:19 -0000 1.1 +++ setup.pl 26 Jan 2004 16:27:48 -0000 1.1.8.1 @@ -40,8 +40,7 @@ if ((@ARGV > 1) && ($ARGV[$currarg++] eq my $cwd = $ARGV[$currarg]; # Get tests directory -my $testdir = $0; -$testdir =~ s/\/\w+.pl$//; +my $testdir = $FindBin::Bin; eval { if ($is_alpha == 0) { Index: sysio_stubs.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/sysio_stubs.c,v retrieving revision 1.6 retrieving revision 1.6.6.1 diff -u -w -b -B -p -r1.6 -r1.6.6.1 --- sysio_stubs.c 28 Oct 2003 20:59:39 -0000 1.6 +++ sysio_stubs.c 26 Jan 2004 16:27:48 -0000 1.6.6.1 @@ -241,14 +241,14 @@ int test_do_printbuf(int argc, char **ar index = mobj->obj; buf_st = buflist[index]; - DBG(2, fprintf(outfp, "buf_st is %x:\n", buf_st)); + DBG(2, fprintf(outfp, "buf_st is %p:\n", buf_st)); buf = buf_st->buf; DBG(2, fprintf(outfp, "buf %s:\n", argv[0])); if (mobj->type == STR) { sprintf(output, "\n%s", (char *)buf); } else { sprintf(output,"%s\n", output); - DBG(2, fprintf(outfp, "buf_st->len is %d, buf is %x\n", buf_st->len, buf)); + DBG(2, fprintf(outfp, "buf_st->len is %d, buf is %p\n", buf_st->len, buf)); if (argc == 1) { for (i = 0; i < buf_st->len/4; i++) DBG(2, fprintf(outfp, "%#x ", ((int *)buf)[i])); Index: sysio_tests.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/sysio_tests.c,v retrieving revision 1.3 retrieving revision 1.3.6.1 diff -u -w -b -B -p -r1.3 -r1.3.6.1 --- sysio_tests.c 10 Oct 2003 18:50:31 -0000 1.3 +++ sysio_tests.c 26 Jan 2004 16:27:48 -0000 1.3.6.1 @@ -268,7 +268,6 @@ out: int sysio_chdir(char *newdir) { - char *buf; if (chdir(newdir) != 0) { my_perror(newdir); @@ -744,12 +743,6 @@ int sysio_getdirentries(int fd, char *bu (unsigned long long )dp->d_off, dp->d_reclen, (char )dp->d_type)); - DBG(3, fprintf(outfp, "\t%s: ino %x off %x len %x type %x\n", - dp->d_name, - (unsigned long long )dp->d_ino, - (unsigned long long )dp->d_off, - dp->d_reclen, - (char )dp->d_type)); err -= dp->d_reclen; dp = (void *)dp + dp->d_reclen; } Index: test_all.pl =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_all.pl,v retrieving revision 1.6 retrieving revision 1.6.6.1 diff -u -w -b -B -p -r1.6 -r1.6.6.1 --- test_all.pl 30 Oct 2003 15:22:19 -0000 1.6 +++ test_all.pl 26 Jan 2004 16:27:48 -0000 1.6.6.1 @@ -6,6 +6,8 @@ # use strict; +use FindBin; + use Cwd 'abs_path'; my $alpha_arg = ""; @@ -31,8 +33,7 @@ my $success = 0; my $cwd = $ENV{PWD}; # Get tests directory -my $testdir = $0; -$testdir =~ s/\/\w+.pl$//; +my $testdir = $FindBin::Bin; my $res; Index: test_copy.pl =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_copy.pl,v retrieving revision 1.3 retrieving revision 1.3.6.1 diff -u -w -b -B -p -r1.3 -r1.3.6.1 --- test_copy.pl 10 Oct 2003 18:50:31 -0000 1.3 +++ test_copy.pl 26 Jan 2004 16:27:48 -0000 1.3.6.1 @@ -23,8 +23,7 @@ sub process_cmd my ($src, $dest, $is_alpha) = @_; # Get tests directory -my $testdir = $0; -$testdir =~ s/\/\w+.pl$//; + my $testdir = $FindBin::Bin; eval { if ($is_alpha == 0) { Index: test_driver.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_driver.c,v retrieving revision 1.4 retrieving revision 1.4.6.1 diff -u -w -b -B -p -r1.4 -r1.4.6.1 --- test_driver.c 28 Oct 2003 20:59:39 -0000 1.4 +++ test_driver.c 26 Jan 2004 16:27:48 -0000 1.4.6.1 @@ -118,7 +118,7 @@ void * alloc_buff32(unsigned int size, i { void* buf; long buf_ptr; - int err; + /* if ((err = memalign(&buf, align, size)) != 0) { perror("memalign"); @@ -145,10 +145,14 @@ long alloc_buff64(unsigned int size, int char * buf; long ret_value; + /* if (memalign((void **)&buf, align, size)) return 0; - - ret_value = (long)buf; + */ + size += align; + buf = malloc(size); + align--; + ret_value = (long)buf + ((long)buf & align); return ret_value; } @@ -230,7 +234,7 @@ int get_obj(char *var_name) * Check for '|', indicates that one or more values are or'd * together */ - for (i=0; i < strlen(var_name); i++) { + for (i=0; (unsigned int)i < strlen(var_name); i++) { if (var_name[i] == '|') { char *str1 = malloc(i+1); char *str2 = malloc(strlen(var_name)-i+1); Index: test_getcwd.pl =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_getcwd.pl,v retrieving revision 1.4 retrieving revision 1.4.6.1 diff -u -w -b -B -p -r1.4 -r1.4.6.1 --- test_getcwd.pl 30 Oct 2003 15:22:19 -0000 1.4 +++ test_getcwd.pl 26 Jan 2004 16:27:48 -0000 1.4.6.1 @@ -46,8 +46,7 @@ sub process_cmd my ($dir, $is_alpha) = @_; # Get tests directory - my $testdir = $0; - $testdir =~ s/\/\w+.pl$//; + my $testdir = $FindBin::Bin; eval { if ($is_alpha == 0) { Index: test_list.pl =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_list.pl,v retrieving revision 1.3 retrieving revision 1.3.6.1 diff -u -w -b -B -p -r1.3 -r1.3.6.1 --- test_list.pl 10 Oct 2003 18:50:31 -0000 1.3 +++ test_list.pl 26 Jan 2004 16:27:48 -0000 1.3.6.1 @@ -129,8 +129,7 @@ sub process_cmd my $done_files = 0; # Get tests directory -my $testdir = $0; -$testdir =~ s/\/\w+.pl$//; + my $testdir = $FindBin::Bin; eval { if ($is_alpha == 1) { Index: test_mounts.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_mounts.c,v retrieving revision 1.5 retrieving revision 1.5.6.1 diff -u -w -b -B -p -r1.5 -r1.5.6.1 --- test_mounts.c 10 Oct 2003 18:50:31 -0000 1.5 +++ test_mounts.c 26 Jan 2004 16:27:48 -0000 1.5.6.1 @@ -436,7 +436,7 @@ mountit(const char *arg) /* * Eat leading white. */ - while (*s && *s == ' ' || *s == '\t') + while (*s && ((*s == ' ') || (*s == '\t'))) s++; /* * Get opts. @@ -456,7 +456,7 @@ mountit(const char *arg) /* * Eat leading white. */ - while (*s && *s == ' ' || *s == '\t') + while (*s && ((*s == ' ') || (*s == '\t'))) s++; /* * Get target @@ -471,7 +471,7 @@ mountit(const char *arg) if (*cp) *cp++ = '\0'; - err = mkdir(target, "0777"); + err = mkdir(target, 0777); if (err && errno != EEXIST) perror(target); err = mount(source, target, fstype, 0, opts); Index: test_path.pl =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_path.pl,v retrieving revision 1.3 retrieving revision 1.3.6.1 diff -u -w -b -B -p -r1.3 -r1.3.6.1 --- test_path.pl 10 Oct 2003 18:50:31 -0000 1.3 +++ test_path.pl 26 Jan 2004 16:27:48 -0000 1.3.6.1 @@ -87,8 +87,7 @@ sub process_cmd my $path; # Get tests directory - my $testdir = $0; - $testdir =~ s/\/\w+.pl$//; + my $testdir = $FindBin::Bin; eval { if ($isalpha == 0) { Index: test_stats.pl =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_stats.pl,v retrieving revision 1.5 retrieving revision 1.5.6.1 diff -u -w -b -B -p -r1.5 -r1.5.6.1 --- test_stats.pl 30 Oct 2003 15:22:19 -0000 1.5 +++ test_stats.pl 26 Jan 2004 16:27:48 -0000 1.5.6.1 @@ -95,8 +95,7 @@ sub process_cmd my ($file, $use_system, $is_alpha) = @_; # Get tests directory -my $testdir = $0; -$testdir =~ s/\/\w+.pl$//; + my $testdir = $FindBin::Bin; eval { if ($is_alpha == 0) { Index: test_symlink.pl =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_symlink.pl,v retrieving revision 1.3 retrieving revision 1.3.8.1 diff -u -w -b -B -p -r1.3 -r1.3.8.1 --- test_symlink.pl 30 Oct 2003 15:22:19 -0000 1.3 +++ test_symlink.pl 26 Jan 2004 16:27:48 -0000 1.3.8.1 @@ -58,8 +58,7 @@ sub process_cmd my ($src, $dest, $is_alpha) = @_; # Get tests directory - my $testdir = $0; - $testdir =~ s/\/\w+.pl$//; + my $testdir = $FindBin::Bin; eval { if ($is_alpha == 0) { |
|
From: Lee W. <lw...@us...> - 2004-01-26 16:28:45
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9381/include Modified Files: Tag: strided-io sysio.h Log Message: Merged in changes from HEAD. Added a little note in ChangeLog about the internal interface change. Index: sysio.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio.h,v retrieving revision 1.14.6.2 retrieving revision 1.14.6.3 diff -u -w -b -B -p -r1.14.6.2 -r1.14.6.3 --- sysio.h 26 Jan 2004 07:10:57 -0000 1.14.6.2 +++ sysio.h 26 Jan 2004 16:27:47 -0000 1.14.6.3 @@ -295,3 +295,42 @@ extern int mount(const char *source, con unsigned long mountflags, const void *data); extern int umount(const char *target); + +/* for debugging */ +#if 1 +#define ASSERT(cond) \ + if (!(cond)) { \ + printf("ASSERTION(" #cond ") failed: " __FILE__ ":" \ + __FUNCTION__ ":%d\n", __LINE__); \ + abort(); \ + } + +#define ERROR(fmt, a...) \ + do { \ + printf("ERROR(" __FILE__ ":%d):" fmt, __LINE__, ##a); \ + while(0) + +#else +#define ERROR(fmt) do{}while(0) +#define ASSERT do{}while(0) +#endif + +/* syscall enter/leave hook functions */ +#if 1 +#define SYSIO_ENTER +#define SYSIO_LEAVE + +#else +extern void _sysio_sysenter(); +extern void _sysio_sysleave(); + +#define SYSIO_ENTER \ + do { \ + _sysio_sysenter(); \ + } while(0) + +#define SYSIO_LEAVE \ + do { \ + _sysio_sysleave(); \ + } while(0) +#endif |
|
From: Lee W. <lw...@us...> - 2004-01-26 16:28:45
|
Update of /cvsroot/libsysio/libsysio/drivers/yod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9381/drivers/yod Modified Files: Tag: strided-io fs_yod.c Log Message: Merged in changes from HEAD. Added a little note in ChangeLog about the internal interface change. Index: fs_yod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/yod/fs_yod.c,v retrieving revision 1.8 retrieving revision 1.8.6.1 diff -u -w -b -B -p -r1.8 -r1.8.6.1 --- fs_yod.c 12 Nov 2003 21:51:40 -0000 1.8 +++ fs_yod.c 26 Jan 2004 16:27:47 -0000 1.8.6.1 @@ -808,7 +808,7 @@ yod_inop_symlink(struct pnode *pno, cons if (!path) return -ENOMEM; - err = symlink_yod(path, data); + err = symlink_yod(data, path); free(path); return err; } @@ -987,7 +987,11 @@ doio(ssize_t (*f)(int, const struct iove assert(nino->ni_fd >= 0); - if (ioctx->ioctx_iovlen && (int )ioctx->ioctx_iovlen < 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; /* @@ -1002,30 +1006,29 @@ doio(ssize_t (*f)(int, const struct iove * Avoid the reposition call if we're already at the right place. * Allows us to access pipes and fifos. */ - result = nino->ni_fpos; - if (ioctx->ioctx_offset != nino->ni_fpos && - !(S_ISCHR(ino->i_mode) || - S_ISSOCK(ino->i_mode) || - S_ISFIFO(ino->i_mode)) && - (result = lseek_yod(nino->ni_fd, + result = ioctx->ioctx_offset; + if (ioctx->ioctx_offset != nino->ni_fpos) { + result = lseek_yod(nino->ni_fd, ioctx->ioctx_offset, - SEEK_SET) == -1)) { + SEEK_SET); + if (result == -1) { ioctx->ioctx_cc = -1; ioctx->ioctx_errno = errno; - } else { + goto out; + } + nino->ni_fpos = result; + } /* * Call the appropriate (read/write) IO function to * transfer the data now. */ - nino->ni_fpos = result; 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) nino->ni_fpos += ioctx->ioctx_cc; - } - +out: ioctx->ioctx_done = 1; return 0; } |
|
From: Lee W. <lw...@us...> - 2004-01-26 16:28:44
|
Update of /cvsroot/libsysio/libsysio/drivers/sockets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9381/drivers/sockets Added Files: Tag: strided-io module.mk sockets.c Log Message: Merged in changes from HEAD. Added a little note in ChangeLog about the internal interface change. --- NEW FILE --- SOCKETS_SRCS = drivers/sockets/sockets.c SOCKETS_EXTRA = drivers/sockets/module.mk --- NEW FILE --- /* * This Cplant(TM) source code is the property of Sandia National * Laboratories. * * This Cplant(TM) source code is copyrighted by Sandia National * Laboratories. * * The redistribution of this Cplant(TM) source code is subject to the * terms of the GNU Lesser General Public License * (see cit/LGPL or http://www.gnu.org/licenses/lgpl.html) * * Cplant(TM) Copyright 1998-2003 Sandia Corporation. * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive * license for use of this work by or on behalf of the US Government. * Export of this program may require a license from the United States * Government. */ /* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Questions or comments about this library should be sent to: * * Lee Ward * Sandia National Laboratories, New Mexico * P.O. Box 5800 * Albuquerque, NM 87185-1110 * * le...@sa... */ #ifdef __linux__ #define _BSD_SOURCE #endif #include <stdio.h> /* for NULL */ #include <stdlib.h> #ifdef __linux__ #include <string.h> #endif #include <unistd.h> #include <errno.h> #include <assert.h> #include <syscall.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/fcntl.h> #include <sys/queue.h> #include <sys/syscall.h> #include <sys/socket.h> #include <linux/net.h> #include "sysio.h" #include "fs.h" #include "inode.h" #include "file.h" #include "dev.h" /* _sysio_nodev_ops */ /* * Sockets interface driver */ /* * Sockets file identifiers format. */ struct sockets_ino_identifier { ino_t inum; /* i-number */ }; /* * Driver-private i-node information we keep about in-use sockets. */ struct socket_info { struct sockets_ino_identifier ski_ident; /* unique identifier */ struct file_identifier ski_fileid; /* ditto */ int ski_fd; /* host fildes */ }; static int sockets_inop_close(struct inode *ino); static int sockets_inop_ipreadv(struct inode *ino, struct ioctx *ioctx); static int sockets_inop_ipwritev(struct inode *ino, struct ioctx *ioctxp); static int sockets_inop_iodone(struct ioctx *ioctx); static int sockets_inop_sync(struct inode *ino); static int sockets_inop_datasync(struct inode *ino); static int sockets_inop_fcntl(struct inode *ino, int cmd, va_list ap); static int sockets_inop_ioctl(struct inode *ino, unsigned long int request, va_list ap); static void sockets_inop_gone(struct inode *ino); static void sockets_illop(void); /* * Given i-node, return driver private part. */ #define I2SKI(ino) ((struct socket_info *)((ino)->i_private)) struct filesys_ops sockets_filesys_ops = { (void (*)(struct filesys *))sockets_illop }; static struct filesys *sockets_fs; static struct inode_ops sockets_i_ops; /* * Initialize this driver. */ int _sysio_sockets_init() { sockets_i_ops = _sysio_nodev_ops; sockets_i_ops.inop_close = sockets_inop_close; sockets_i_ops.inop_ipreadv = sockets_inop_ipreadv; sockets_i_ops.inop_ipwritev = sockets_inop_ipwritev; sockets_i_ops.inop_iodone = sockets_inop_iodone; sockets_i_ops.inop_fcntl = sockets_inop_fcntl; sockets_i_ops.inop_sync = sockets_inop_sync; sockets_i_ops.inop_datasync = sockets_inop_datasync; sockets_i_ops.inop_ioctl = sockets_inop_ioctl; sockets_i_ops.inop_gone = sockets_inop_gone; sockets_fs = _sysio_fs_new(&sockets_filesys_ops, 0, NULL); if (!sockets_fs) return -ENOMEM; return 0; } static int sockets_inop_close(struct inode *ino) { struct socket_info *ski = I2SKI(ino); int err; if (ski->ski_fd < 0) return -EBADF; err = syscall(SYS_close, ski->ski_fd); if (err) return -errno; ski->ski_fd = -1; return 0; } /* * A helper function performing the real IO operation work. * * We don't really have async IO. We'll just perform the function * now. */ static int doio(ssize_t (*f)(int, const struct iovec *, int), struct inode *ino, struct ioctx *ioctx) { struct socket_info *ski = I2SKI(ino); assert(ski->ski_fd >= 0); if (ioctx->ioctx_iovlen && (int) ioctx->ioctx_iovlen < 0) return -EINVAL; /* * Call the appropriate (read/write) IO function to * transfer the data now. */ ioctx->ioctx_cc = (*f)(ski->ski_fd, ioctx->ioctx_iovec, ioctx->ioctx_iovlen); if (ioctx->ioctx_cc < 0) ioctx->ioctx_errno = errno; 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) { return syscall(SYS_readv, fd, vector, count); } static int sockets_inop_ipreadv(struct inode *ino, struct ioctx *ioctx) { return doio(_readv, ino, ioctx); } /* * Helper function passed to doio(), above, to accomplish a real writev. */ static ssize_t _writev(int fd, const struct iovec *vector, int count) { return syscall(SYS_writev, fd, vector, count); } static int sockets_inop_ipwritev(struct inode *ino, struct ioctx *ioctx) { return doio(_writev, ino, ioctx); } static int sockets_inop_iodone(struct ioctx *ioctxp __IS_UNUSED) { /* * It's always done in this driver. It completed when posted. */ return 1; } static int sockets_inop_fcntl(struct inode *ino __IS_UNUSED, int cmd __IS_UNUSED, va_list ap __IS_UNUSED) { long arg; assert(I2SKI(ino)->ski_fd >= 0); switch (cmd) { case F_GETFD: case F_GETFL: case F_GETOWN: return syscall(SYS_fcntl, I2SKI(ino)->ski_fd, cmd); case F_DUPFD: case F_SETFD: case F_SETFL: case F_GETLK: case F_SETLK: case F_SETLKW: case F_SETOWN: arg = va_arg(ap, long); return syscall(SYS_fcntl, I2SKI(ino)->ski_fd, cmd, arg); default: printf("uncatched cmd %d\n", cmd); abort(); } return -1; } static int sockets_inop_sync(struct inode *ino) { assert(I2SKI(ino)->ski_fd >= 0); return syscall(SYS_fsync, I2SKI(ino)->ski_fd); } static int sockets_inop_datasync(struct inode *ino) { assert(I2SKI(ino)->ski_fd >= 0); return syscall(SYS_fdatasync, I2SKI(ino)->ski_fd); } static int sockets_inop_ioctl(struct inode *ino __IS_UNUSED, unsigned long int request __IS_UNUSED, va_list ap __IS_UNUSED) { /* * I'm lazy. Maybe implemented later. */ return -ENOTTY; } static void sockets_inop_gone(struct inode *ino) { (void )sockets_inop_close(ino); free(ino->i_private); } static void sockets_illop(void) { abort(); } static struct inode * _sysio_sockets_inew() { static ino_t inum = 1; struct socket_info *ski; struct inode *ino; ski = malloc(sizeof(struct socket_info)); if (!ski) return NULL; ski->ski_ident.inum = inum++; ski->ski_fileid.fid_data = &ski->ski_ident; ski->ski_fileid.fid_len = sizeof(ski->ski_ident); ski->ski_fd = -1; ino = _sysio_i_new(sockets_fs, &ski->ski_fileid, 0, 0, 0, &sockets_i_ops, ski); if (!ino) free(ski); return ino; } int socket(int domain, int type, int protocol) { int err; struct inode *ino; struct socket_info *ski; struct file *fil; err = 0; fil = NULL; ino = _sysio_sockets_inew(); if (!ino) { err = -ENOMEM; goto error; } ski = I2SKI(ino); #ifndef SYS_socketcall ski->ski_fd = syscall(SYS_socket, domain, type, protocol); #else { unsigned long avec[3] = {domain, type, protocol}; ski->ski_fd = syscall(SYS_socketcall, SYS_SOCKET, avec); } #endif if (ski->ski_fd < 0) { err = -errno; goto error; } fil = _sysio_fnew(ino, O_RDWR); if (!fil) { err = -ENOMEM; goto error; } err = _sysio_fd_set(fil, ski->ski_fd); if (err < 0) goto error; return err; error: if (fil) F_RELE(fil); if (ino) I_RELE(ino); errno = -err; return -1; } int accept(int s, struct sockaddr *addr, socklen_t *addrlen) { int err; struct inode *ino; struct socket_info *ski; struct file *ofil, *nfil; err = 0; nfil = NULL; ino = NULL; ofil = _sysio_fd_find(s); if (!ofil) { err = -EBADF; goto error; } ino = _sysio_sockets_inew(); if (!ino) { err = -ENOMEM; goto error; } nfil = _sysio_fnew(ino, O_RDWR); if (!nfil) { err = -ENOMEM; goto error; } ski = I2SKI(ino); #ifndef SYS_socketcall ski->ski_fd = syscall(SYS_accept, I2SKI(ofil->f_ino)->ski_fd, addr, addrlen); #else { unsigned long avec[3] = { (unsigned long) I2SKI(ofil->f_ino)->ski_fd, (unsigned long) addr, (unsigned long) addrlen}; ski->ski_fd = syscall(SYS_socketcall, SYS_ACCEPT, avec); } #endif if (ski->ski_fd < 0) { err = -errno; goto error; } err = _sysio_fd_set(nfil, ski->ski_fd); if (err < 0) goto error; return err; error: if (nfil) F_RELE(nfil); if (ino) I_RELE(ino); errno = -err; return -1; } #if 0 int bind(int sockfd, const struct sockaddr *my_addr, socklen_t addrlen) { int err; struct file *fil; unsigned long avec[3]; err = 0; fil = _sysio_fd_find(sockfd); if (!fil) { err = -EBADF; goto out; } avec[0] = I2SKI(fil->f_ino)->ski_fd; avec[1] = (unsigned long )my_addr; avec[2] = addrlen; #ifndef SYS_socketcall if (syscall(SYS_bind, I2SKI(fil->f_ino)->ski_fd, my_addr, addrlen)) { #else if (syscall(SYS_socketcall, SYS_BIND, avec) != 0) { #endif err = -errno; goto out; } return 0; out: errno = -err; return -1; } int listen(int s, int backlog) { int err; struct file *fil; unsigned long avec[2]; err = 0; fil = _sysio_fd_find(s); if (!fil) { err = -EBADF; goto out; } avec[0] = I2SKI(fil->f_ino)->ski_fd; avec[1] = backlog; #ifndef SYS_socketcall if (syscall(SYS_listen, I2SKI(fil->f_ino)->ski_fd, backlog) != 0) { #else if (syscall(SYS_socketcall, SYS_LISTEN, avec) != 0) { #endif err = -errno; goto out; } return 0; out: errno = -err; return -1; } int connect(int sockfd, const struct sockaddr *serv_addr, socklen_t addrlen) { int err; struct file *fil; unsigned long avec[3]; err = 0; fil = _sysio_fd_find(sockfd); if (!fil) { err = -EBADF; goto out; } avec[0] = I2SKI(fil->f_ino)->ski_fd; avec[1] = (unsigned long )serv_addr; avec[2] = addrlen; #ifndef SYS_socketcall if (syscall(SYS_connect, I2SKI(fil->f_ino)->ski_fd, serv_addr, addrlen) != 0) { #else if (syscall(SYS_socketcall, SYS_CONNECT, avec) != 0) { #endif err = -errno; goto out; } return 0; out: errno = -err; return -1; } #endif |
|
From: Lee W. <lw...@us...> - 2004-01-26 16:28:44
|
Update of /cvsroot/libsysio/libsysio In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9381 Modified Files: Tag: strided-io ChangeLog Makefile.am Rules.make configure.in Log Message: Merged in changes from HEAD. Added a little note in ChangeLog about the internal interface change. Index: ChangeLog =================================================================== RCS file: /cvsroot/libsysio/libsysio/ChangeLog,v retrieving revision 1.3 retrieving revision 1.3.16.1 diff -u -w -b -B -p -r1.3 -r1.3.16.1 --- ChangeLog 24 Mar 2003 22:06:38 -0000 1.3 +++ ChangeLog 26 Jan 2004 16:27:46 -0000 1.3.16.1 @@ -23,3 +23,9 @@ and other annoying little chicken-and-th *Added support for accessing the pre-opened standard file descriptors 0, 1, and 2 via the stdfd device driver (major number 0, minor 0, 1, and 2). + +--- +Lee -- Mon Jan 26 11:26:14 EST 2004 + +*Altered the internal interface to pass the xtvec (see .../include/xtio.h) in +order to support strided-io. Index: Makefile.am =================================================================== RCS file: /cvsroot/libsysio/libsysio/Makefile.am,v retrieving revision 1.9.6.1 retrieving revision 1.9.6.2 diff -u -w -b -B -p -r1.9.6.1 -r1.9.6.2 --- Makefile.am 23 Jan 2004 14:25:35 -0000 1.9.6.1 +++ Makefile.am 26 Jan 2004 16:27:46 -0000 1.9.6.2 @@ -13,6 +13,7 @@ include $(top_srcdir)/dev/stdfd/module.m include $(top_srcdir)/drivers/incore/module.mk include $(top_srcdir)/drivers/native/module.mk include $(top_srcdir)/drivers/yod/module.mk +include $(top_srcdir)/drivers/sockets/module.mk lib_LIBRARIES = ${LIBBUILD_DIR}/libsysio.a @@ -34,6 +35,12 @@ else OPTIONAL_NATIVE_SRCS = endif +if WITH_SOCKETS_DRIVER +OPTIONAL_SOCKETS_SRCS = $(SOCKETS_SRCS) +else +OPTIONAL_SOCKETS_SRCS = +endif + if WITH_CPLANT_YOD OPTIONAL_YOD_SRCS = $(YOD_SRCS) else @@ -44,6 +51,7 @@ __LIBBUILD_DIR__libsysio_a_SOURCES = \ $(SRCDIR_SRCS) \ $(OPTIONAL_STDFD_SRCS) \ $(OPTIONAL_INCORE_SRCS) \ + $(OPTIONAL_SOCKETS_SRCS) \ $(OPTIONAL_NATIVE_SRCS) \ $(OPTIONAL_YOD_SRCS) @@ -59,7 +67,7 @@ include $(top_srcdir)/Rules.make EXTRA_DIST = Rules.make $(TESTS_EXTRA) $(SRCDIR_EXTRA) \ $(INCLUDE_EXTRA) $(STDFD_EXTRA) $(INCORE_EXTRA) \ - $(NATIVE_EXTRA) $(YOD_EXTRA) + $(SOCKETS_EXTRA) $(NATIVE_EXTRA) $(YOD_EXTRA) AM_CPPFLAGS += ${YOD_DRIVER_FLAGS} Index: Rules.make =================================================================== RCS file: /cvsroot/libsysio/libsysio/Rules.make,v retrieving revision 1.4 retrieving revision 1.4.16.1 diff -u -w -b -B -p -r1.4 -r1.4.16.1 --- Rules.make 24 Mar 2003 22:06:38 -0000 1.4 +++ Rules.make 26 Jan 2004 16:27:46 -0000 1.4.16.1 @@ -5,6 +5,14 @@ else STFD_DEV_CPPFLAGS = endif +if WITH_SOCKETS_DRIVER +SOCKETS_CPPFLAGS=-DWITH_SOCKETS=1 +else +SOCKETS_CPPFLAGS= +endif + DEV_CPPFLAGS = $(STDFD_DEV_CPPFLAGS) -AM_CPPFLAGS = $(AUTOMOUNT) $(DEV_CPPFLAGS) -I$(top_srcdir)/include +AM_CPPFLAGS = \ + $(AUTOMOUNT) $(DEV_CPPFLAGS) $(SOCKETS_CPPFLAGS) \ + -I$(top_srcdir)/include Index: configure.in =================================================================== RCS file: /cvsroot/libsysio/libsysio/configure.in,v retrieving revision 1.12.6.1 retrieving revision 1.12.6.2 diff -u -w -b -B -p -r1.12.6.1 -r1.12.6.2 --- configure.in 23 Jan 2004 14:25:35 -0000 1.12.6.1 +++ configure.in 26 Jan 2004 16:27:46 -0000 1.12.6.2 @@ -122,6 +122,17 @@ AC_ARG_WITH(cplant_tests, [with_cplant_tests=no]) AM_CONDITIONAL(WITH_CPLANT_TESTS, test x$with_cplant_tests != xno) +AC_ARG_WITH(sockets, + AC_HELP_STRING([--with-sockets], + [build sockets interface driver (EXPERIMENTAL)]), + [ case "${withval}" in + yes) ;; + no) ;; + *) AC_MSG_ERROR(bad value ${withval} for --with-sockets) ;; + esac], + [with_sockets=no]) +AM_CONDITIONAL(WITH_SOCKETS_DRIVER, test x$with_sockets = xyes) + # We keep the original values in `$config_*' and never modify them, so we # can write them unchanged into config.make. Everything else uses # $machine, $vendor, and $os, and changes them whenever convenient. |
|
From: Lee W. <lw...@us...> - 2004-01-26 16:28:44
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9381/drivers/native Modified Files: Tag: strided-io fs_native.c Log Message: Merged in changes from HEAD. Added a little note in ChangeLog about the internal interface change. Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.25.6.3 retrieving revision 1.25.6.4 diff -u -w -b -B -p -r1.25.6.3 -r1.25.6.4 --- fs_native.c 26 Jan 2004 07:24:29 -0000 1.25.6.3 +++ fs_native.c 26 Jan 2004 16:27:47 -0000 1.25.6.4 @@ -130,11 +130,6 @@ do { (dest)->st_gen = (src)->st_gen; \ } while (0); -/* SYS_lseek has a different interface on alpha - */ -#define CALL_LSEEK(fd, off, rc, wh) \ - (rc = syscall(SYS_lseek, fd, off, wh)) - #else #define __native_stat intnl_stat @@ -1400,15 +1395,33 @@ native_inop_iodone(struct ioctx *ioctxp } static int -native_inop_fcntl(struct inode *ino __IS_UNUSED, - int cmd __IS_UNUSED, - va_list ap __IS_UNUSED) +native_inop_fcntl(struct inode *ino, + int cmd, + va_list ap) { + struct native_inode *nino = I2NI(ino); + long arg; - /* - * I'm lazy. Maybe implemented later. - */ - errno = ENOTTY; + if (nino->ni_fd < 0) + abort(); + + switch (cmd) { + case F_GETFD: + case F_GETFL: + case F_GETOWN: + return syscall(SYS_fcntl, nino->ni_fd, cmd); + case F_DUPFD: + case F_SETFD: + case F_SETFL: + case F_GETLK: + case F_SETLK: + case F_SETLKW: + case F_SETOWN: + arg = va_arg(ap, long); + return syscall(SYS_fcntl, nino->ni_fd, cmd, arg); + default: + abort(); + } return -1; } |
|
From: Lee W. <lw...@us...> - 2004-01-26 16:28:43
|
Update of /cvsroot/libsysio/libsysio/drivers/incore In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9381/drivers/incore Modified Files: Tag: strided-io fs_incore.c Log Message: Merged in changes from HEAD. Added a little note in ChangeLog about the internal interface change. Index: fs_incore.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/incore/fs_incore.c,v retrieving revision 1.11.6.2 retrieving revision 1.11.6.3 diff -u -w -b -B -p -r1.11.6.2 -r1.11.6.3 --- fs_incore.c 26 Jan 2004 07:24:29 -0000 1.11.6.2 +++ fs_incore.c 26 Jan 2004 16:27:46 -0000 1.11.6.3 @@ -1314,7 +1314,7 @@ incore_create(struct pnode *pno, struct incore_directory_insert(I2IC(dino), &pno->p_base->pb_name, st->st_ino, - INCORE_D_TYPEOF(S_IFREG)); + INCORE_D_TYPEOF(icino->ici_st.st_mode)); if (err) { I_RELE(ino); _sysio_i_gone(ino); @@ -1620,6 +1620,8 @@ _sysio_incore_dirop_mknod(struct pnode * m = mode & S_IFMT; if (S_ISCHR(m)) m &= ~S_IFCHR; + else if (S_ISFIFO(m)) + m &= ~S_IFIFO; else if (S_ISBLK(m)) m &= ~S_IFCHR; else |
|
From: Lee W. <lw...@us...> - 2004-01-26 07:11:59
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1014/src Modified Files: Tag: strided-io ioctx.c lseek.c rw.c Log Message: Use O_LARGEFILE or we don't get 64-bit file address space. Fix lots of seek/position checks. Add artificial limit check to _sysio_validx and remove the test for overflow of INT_MAX there. Index: ioctx.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctx.c,v retrieving revision 1.6.6.5 retrieving revision 1.6.6.6 diff -u -w -b -B -p -r1.6.6.5 -r1.6.6.6 --- ioctx.c 23 Jan 2004 17:04:00 -0000 1.6.6.5 +++ ioctx.c 26 Jan 2004 07:10:57 -0000 1.6.6.6 @@ -44,7 +44,6 @@ #include <stdlib.h> #include <string.h> #include <errno.h> -#include <limits.h> #include <assert.h> #include <sys/types.h> #include <sys/uio.h> @@ -257,7 +256,8 @@ _sysio_ioctx_complete(struct ioctx *ioct */ ssize_t _sysio_validx(const struct intnl_xtvec *xtv, size_t xtvlen, - const struct iovec *iov, size_t iovlen) + const struct iovec *iov, size_t iovlen, + _SYSIO_OFF_T limit) { ssize_t acc, cc; struct iovec iovec; @@ -305,18 +305,12 @@ _sysio_validx(const struct intnl_xtvec * off = xtvec.xtv_off + cc; if (xtvec.xtv_off && off <= xtvec.xtv_off) return off < 0 ? -EINVAL : -EOVERFLOW; + if (off > limit) + return -EFBIG; xtvec.xtv_off = off; cc += acc; - if (acc && cc <= acc) + if (acc && (cc <= acc)) return -EINVAL; - if (acc > INT_MAX) { - /* - * Artificially limit the transfer size to - * INT_MAX bytes so we don't overflow - * the 32-bit callers return values. - */ - return -EINVAL; - } acc = cc; } while (xtvec.xtv_len && iovlen); } while ((xtvlen || xtvec.xtv_len) && iovlen); @@ -334,17 +328,13 @@ _sysio_enumerate_extents(const struct in void *), void *arg) { - ssize_t cc, acc; + ssize_t acc, cc; struct iovec iovec; struct intnl_xtvec xtvec; const struct iovec *start; _SYSIO_OFF_T off; size_t n; - cc = _sysio_validx(xtv, xtvlen, iov, iovlen); - if (cc < 0) - return cc; - acc = 0; iovec.iov_len = 0; while (xtvlen) { @@ -458,14 +448,6 @@ _sysio_enumerate_iovec(const struct iove cc += acc; if (acc && cc <= acc) return -EINVAL; - if (acc > INT_MAX) { - /* - * Artificially limit the transfer size to - * INT_MAX bytes so we don't overflow - * the 32-bit callers return values. - */ - return -EINVAL; - } acc = cc; } if (!acc) Index: lseek.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/lseek.c,v retrieving revision 1.9.6.1 retrieving revision 1.9.6.2 diff -u -w -b -B -p -r1.9.6.1 -r1.9.6.2 --- lseek.c 23 Jan 2004 13:59:46 -0000 1.9.6.1 +++ lseek.c 26 Jan 2004 07:10:57 -0000 1.9.6.2 @@ -69,8 +69,7 @@ _sysio_lseek(int fd, _SYSIO_OFF_T offset switch (whence) { case SEEK_SET: - off = offset; - offset = 0; + off = 0; break; case SEEK_CUR: off = fil->f_pos; @@ -91,10 +90,16 @@ _sysio_lseek(int fd, _SYSIO_OFF_T offset default: return -EINVAL; } - assert(off >= 0); /* paranoia */ pos = off + offset; - if ((offset < 0 && -offset > off) || (offset > 0 && off && pos <= off)) + if (pos < 0 || (off && pos <= off)) return -EINVAL; +#ifdef O_LARGEFILE + if (pos >= ((fil->f_flags & O_LARGEFILE) ? _SYSIO_OFF_T_MAX : LONG_MAX)) + return -EOVERFLOW; +#else + if (pos >= _SYSIO_OFF_T_MAX) + return -EOVERFLOW; +#endif return fil->f_pos = pos; } @@ -116,13 +121,12 @@ lseek(int fd, off_t offset, int whence) off_t rtn; off = _sysio_lseek(fd, offset, whence); - if (off < 0) - return -1; - rtn = (off_t )off; - if ((_SYSIO_OFF_T )rtn != off) { - errno = EINVAL; + if (off < 0) { + errno = -off; return -1; } + rtn = (off_t )off; + assert(rtn == off); return rtn; } Index: rw.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/Attic/rw.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 --- rw.c 23 Jan 2004 15:23:02 -0000 1.1.2.1 +++ rw.c 26 Jan 2004 07:10:57 -0000 1.1.2.2 @@ -58,11 +58,27 @@ #include "sysio-symbols.h" /* + * Decoding the interface routine names: + * + * Much of this carries legacy from the POSIX world and the Intel ASCI + * Red programming environment. Routine names are composed of prefix, + * basic POSIX names, and postfix. The basic POSIX names are read and write. + * Prefixes, left-to-right: + * + * - 'i' -- asynchronous operation (from ASCI Red) + * - 'p' -- positional (POSIX) + * Posfixes, only one: + * - 'v' -- vectored (POSIX) + * - 'x' -- extent-based (new for Red Storm) + * + * All valid combinations are available and symmetric. + */ + +/* * Post op using iovec with regions specified by the passed extent vector. * - * Note; No checking if performed on the two vectors. They can do any or - * all of; underflow/overflow position or overflow ssize_t for result. The - * driver should check for these. + * NOTE: There are enough parameters that we should really consider + * passing them in a structure. */ static int _sysio_iiox(ssize_t (*f)(struct inode *, struct ioctx *), @@ -77,6 +93,7 @@ _sysio_iiox(ssize_t (*f)(struct inode *, struct ioctx **ioctxp) { struct inode *ino; + ssize_t cc; struct ioctx *ioctx; int err; struct ioctx_callback *cb; @@ -88,6 +105,17 @@ _sysio_iiox(ssize_t (*f)(struct inode *, */ return -EBADF; } + cc = + _sysio_validx(xtv, xtv_count, + iov, iov_count, +#if _LARGEFILE64_SOURCE && defined(O_LARGEFILE) + (fil->f_flags & O_LARGEFILE) == 0 + ? LONG_MAX + : +#endif + _SYSIO_OFF_T_MAX); + if (cc < 0) + return cc; ioctx = _sysio_ioctx_new(ino, iov, iov_count, xtv, xtv_count); if (!ioctx) { errno = ENOMEM; @@ -256,7 +284,7 @@ readv(int fd, const struct iovec *iov, i fil = _sysio_fd_find_capable(fd, O_WRONLY); if (!fil) { errno = EBADF; - return IOID_FAIL; + return -1; } err = @@ -307,7 +335,11 @@ iread(int fd, void *buf, size_t count) iov->iov_len = count; xtv = malloc(sizeof(struct intnl_xtvec)); if (!xtv) { + int oerrno; + + oerrno = errno; free(iov); + errno = oerrno; return IOID_FAIL; } err = @@ -337,7 +369,7 @@ read(int fd, void *buf, size_t count) fil = _sysio_fd_find_capable(fd, O_WRONLY); if (!fil) { errno = EBADF; - return IOID_FAIL; + return -1; } iovector.iov_base = buf; @@ -454,7 +486,7 @@ _preadv(int fd, const struct iovec *iov, fil = _sysio_fd_find_capable(fd, O_WRONLY); if (!fil) { errno = EBADF; - return IOID_FAIL; + return -1; } err = @@ -501,7 +533,7 @@ _ipread(int fd, void *buf, size_t count, xtv = malloc(sizeof(struct intnl_xtvec)); iov = malloc(sizeof(struct iovec)); if (!(xtv && iov)) { - err = ENOMEM; + err = -errno; goto error; } xtv->xtv_off = offset; @@ -550,7 +582,7 @@ _pread(int fd, void *buf, size_t count, fil = _sysio_fd_find_capable(fd, O_WRONLY); if (!fil) { errno = EBADF; - return IOID_FAIL; + return -1; } xtvec.xtv_off = offset; @@ -565,7 +597,7 @@ _pread(int fd, void *buf, size_t count, &ioctx); if (err) { errno = -err; - return IOID_FAIL; + return -1; } return _sysio_ioctx_wait(ioctx); } @@ -749,7 +781,7 @@ writev(int fd, const struct iovec *iov, fil = _sysio_fd_find_capable(fd, O_RDONLY); if (!fil) { errno = EBADF; - return IOID_FAIL; + return -1; } err = @@ -792,7 +824,11 @@ iwrite(int fd, const void *buf, size_t c iov->iov_len = count; xtv = malloc(sizeof(struct intnl_xtvec)); if (!xtv) { + int oerrno; + + oerrno = errno; free(iov); + errno = oerrno; return IOID_FAIL; } err = @@ -822,7 +858,7 @@ write(int fd, const void *buf, size_t co fil = _sysio_fd_find_capable(fd, O_RDONLY); if (!fil) { errno = EBADF; - return IOID_FAIL; + return -1; } iovector.iov_base = (void *)buf; @@ -905,7 +941,7 @@ _pwritev(int fd, const struct iovec *iov fil = _sysio_fd_find_capable(fd, O_RDONLY); if (!fil) { errno = EBADF; - return IOID_FAIL; + return -1; } err = @@ -943,7 +979,7 @@ _ipwrite(int fd, const void *buf, size_t struct ioctx *ioctx; int err; - fil = _sysio_fd_find_capable(fd, O_WRONLY); + fil = _sysio_fd_find_capable(fd, O_RDONLY); if (!fil) { errno = EBADF; return IOID_FAIL; @@ -952,7 +988,7 @@ _ipwrite(int fd, const void *buf, size_t xtv = malloc(sizeof(struct intnl_xtvec)); iov = malloc(sizeof(struct iovec)); if (!(xtv && iov)) { - err = ENOMEM; + err = -errno; goto error; } xtv->xtv_off = offset; @@ -998,10 +1034,10 @@ _pwrite(int fd, const void *buf, size_t struct ioctx *ioctx; int err; - fil = _sysio_fd_find_capable(fd, O_WRONLY); + fil = _sysio_fd_find_capable(fd, O_RDONLY); if (!fil) { errno = EBADF; - return IOID_FAIL; + return -1; } xtvec.xtv_off = offset; @@ -1016,7 +1052,7 @@ _pwrite(int fd, const void *buf, size_t &ioctx); if (err) { errno = -err; - return IOID_FAIL; + return -1; } return _sysio_ioctx_wait(ioctx); } |
|
From: Lee W. <lw...@us...> - 2004-01-23 17:05:54
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4753/src Modified Files: Tag: strided-io ioctx.c Log Message: Oops. Forgot to include limits.h in that last checkin. Index: ioctx.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctx.c,v retrieving revision 1.6.6.4 retrieving revision 1.6.6.5 diff -u -w -b -B -p -r1.6.6.4 -r1.6.6.5 --- ioctx.c 23 Jan 2004 16:18:55 -0000 1.6.6.4 +++ ioctx.c 23 Jan 2004 17:04:00 -0000 1.6.6.5 @@ -44,6 +44,7 @@ #include <stdlib.h> #include <string.h> #include <errno.h> +#include <limits.h> #include <assert.h> #include <sys/types.h> #include <sys/uio.h> |
|
From: Sonja T. <so...@us...> - 2004-01-21 15:38:48
|
Update of /cvsroot/libsysio/libsysio/tests
In directory sc8-pr-cvs1:/tmp/cvs-serv3710/tests
Modified Files:
sysio_stubs.c sysio_tests.c test_driver.c test_mounts.c
Log Message:
Fix compile warnings
Index: sysio_stubs.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/tests/sysio_stubs.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -b -B -p -r1.6 -r1.7
--- sysio_stubs.c 28 Oct 2003 20:59:39 -0000 1.6
+++ sysio_stubs.c 21 Jan 2004 15:38:45 -0000 1.7
@@ -241,14 +241,14 @@ int test_do_printbuf(int argc, char **ar
index = mobj->obj;
buf_st = buflist[index];
- DBG(2, fprintf(outfp, "buf_st is %x:\n", buf_st));
+ DBG(2, fprintf(outfp, "buf_st is %p:\n", buf_st));
buf = buf_st->buf;
DBG(2, fprintf(outfp, "buf %s:\n", argv[0]));
if (mobj->type == STR) {
sprintf(output, "\n%s", (char *)buf);
} else {
sprintf(output,"%s\n", output);
- DBG(2, fprintf(outfp, "buf_st->len is %d, buf is %x\n", buf_st->len, buf));
+ DBG(2, fprintf(outfp, "buf_st->len is %d, buf is %p\n", buf_st->len, buf));
if (argc == 1) {
for (i = 0; i < buf_st->len/4; i++)
DBG(2, fprintf(outfp, "%#x ", ((int *)buf)[i]));
Index: sysio_tests.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/tests/sysio_tests.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -b -B -p -r1.3 -r1.4
--- sysio_tests.c 10 Oct 2003 18:50:31 -0000 1.3
+++ sysio_tests.c 21 Jan 2004 15:38:45 -0000 1.4
@@ -268,7 +268,6 @@ out:
int sysio_chdir(char *newdir)
{
- char *buf;
if (chdir(newdir) != 0) {
my_perror(newdir);
@@ -744,12 +743,6 @@ int sysio_getdirentries(int fd, char *bu
(unsigned long long )dp->d_off,
dp->d_reclen,
(char )dp->d_type));
- DBG(3, fprintf(outfp, "\t%s: ino %x off %x len %x type %x\n",
- dp->d_name,
- (unsigned long long )dp->d_ino,
- (unsigned long long )dp->d_off,
- dp->d_reclen,
- (char )dp->d_type));
err -= dp->d_reclen;
dp = (void *)dp + dp->d_reclen;
}
Index: test_driver.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/tests/test_driver.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -b -B -p -r1.4 -r1.5
--- test_driver.c 28 Oct 2003 20:59:39 -0000 1.4
+++ test_driver.c 21 Jan 2004 15:38:45 -0000 1.5
@@ -118,7 +118,7 @@ void * alloc_buff32(unsigned int size, i
{
void* buf;
long buf_ptr;
- int err;
+
/*
if ((err = memalign(&buf, align, size)) != 0) {
perror("memalign");
@@ -145,10 +145,14 @@ long alloc_buff64(unsigned int size, int
char * buf;
long ret_value;
+ /*
if (memalign((void **)&buf, align, size))
return 0;
-
- ret_value = (long)buf;
+ */
+ size += align;
+ buf = malloc(size);
+ align--;
+ ret_value = (long)buf + ((long)buf & align);
return ret_value;
}
@@ -230,7 +234,7 @@ int get_obj(char *var_name)
* Check for '|', indicates that one or more values are or'd
* together
*/
- for (i=0; i < strlen(var_name); i++) {
+ for (i=0; (unsigned int)i < strlen(var_name); i++) {
if (var_name[i] == '|') {
char *str1 = malloc(i+1);
char *str2 = malloc(strlen(var_name)-i+1);
Index: test_mounts.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/tests/test_mounts.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -b -B -p -r1.5 -r1.6
--- test_mounts.c 10 Oct 2003 18:50:31 -0000 1.5
+++ test_mounts.c 21 Jan 2004 15:38:45 -0000 1.6
@@ -436,7 +436,7 @@ mountit(const char *arg)
/*
* Eat leading white.
*/
- while (*s && *s == ' ' || *s == '\t')
+ while (*s && ((*s == ' ') || (*s == '\t')))
s++;
/*
* Get opts.
@@ -456,7 +456,7 @@ mountit(const char *arg)
/*
* Eat leading white.
*/
- while (*s && *s == ' ' || *s == '\t')
+ while (*s && ((*s == ' ') || (*s == '\t')))
s++;
/*
* Get target
@@ -471,7 +471,7 @@ mountit(const char *arg)
if (*cp)
*cp++ = '\0';
- err = mkdir(target, "0777");
+ err = mkdir(target, 0777);
if (err && errno != EEXIST)
perror(target);
err = mount(source, target, fstype, 0, opts);
|
|
From: Sonja T. <so...@us...> - 2004-01-21 15:14:02
|
Update of /cvsroot/libsysio/libsysio/tests
In directory sc8-pr-cvs1:/tmp/cvs-serv30611/tests
Modified Files:
cleanup.pl setup.pl test_all.pl test_copy.pl test_getcwd.pl
test_list.pl test_path.pl test_stats.pl test_symlink.pl
Log Message:
Fixing bugs in perl test scripts.
Index: cleanup.pl
===================================================================
RCS file: /cvsroot/libsysio/libsysio/tests/cleanup.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -b -B -p -r1.1 -r1.2
--- cleanup.pl 30 Oct 2003 15:22:19 -0000 1.1
+++ cleanup.pl 21 Jan 2004 15:13:56 -0000 1.2
@@ -46,8 +46,7 @@ if ((@ARGV > 1) && ($ARGV[$currarg++] eq
my $cwd = $ARGV[$currarg];
# Get tests directory
-my $testdir = $0;
-$testdir =~ s/\/\w+.pl$//;
+my $testdir = $FindBin::Bin;
eval {
if ($is_alpha == 0) {
Index: setup.pl
===================================================================
RCS file: /cvsroot/libsysio/libsysio/tests/setup.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -b -B -p -r1.1 -r1.2
--- setup.pl 30 Oct 2003 15:22:19 -0000 1.1
+++ setup.pl 21 Jan 2004 15:13:56 -0000 1.2
@@ -40,8 +40,7 @@ if ((@ARGV > 1) && ($ARGV[$currarg++] eq
my $cwd = $ARGV[$currarg];
# Get tests directory
-my $testdir = $0;
-$testdir =~ s/\/\w+.pl$//;
+my $testdir = $FindBin::Bin;
eval {
if ($is_alpha == 0) {
Index: test_all.pl
===================================================================
RCS file: /cvsroot/libsysio/libsysio/tests/test_all.pl,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -b -B -p -r1.6 -r1.7
--- test_all.pl 30 Oct 2003 15:22:19 -0000 1.6
+++ test_all.pl 21 Jan 2004 15:13:56 -0000 1.7
@@ -6,6 +6,8 @@
#
use strict;
+use FindBin;
+
use Cwd 'abs_path';
my $alpha_arg = "";
@@ -31,8 +33,7 @@ my $success = 0;
my $cwd = $ENV{PWD};
# Get tests directory
-my $testdir = $0;
-$testdir =~ s/\/\w+.pl$//;
+my $testdir = $FindBin::Bin;
my $res;
Index: test_copy.pl
===================================================================
RCS file: /cvsroot/libsysio/libsysio/tests/test_copy.pl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -b -B -p -r1.3 -r1.4
--- test_copy.pl 10 Oct 2003 18:50:31 -0000 1.3
+++ test_copy.pl 21 Jan 2004 15:13:56 -0000 1.4
@@ -23,8 +23,7 @@ sub process_cmd
my ($src, $dest, $is_alpha) = @_;
# Get tests directory
-my $testdir = $0;
-$testdir =~ s/\/\w+.pl$//;
+ my $testdir = $FindBin::Bin;
eval {
if ($is_alpha == 0) {
Index: test_getcwd.pl
===================================================================
RCS file: /cvsroot/libsysio/libsysio/tests/test_getcwd.pl,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -b -B -p -r1.4 -r1.5
--- test_getcwd.pl 30 Oct 2003 15:22:19 -0000 1.4
+++ test_getcwd.pl 21 Jan 2004 15:13:56 -0000 1.5
@@ -46,8 +46,7 @@ sub process_cmd
my ($dir, $is_alpha) = @_;
# Get tests directory
- my $testdir = $0;
- $testdir =~ s/\/\w+.pl$//;
+ my $testdir = $FindBin::Bin;
eval {
if ($is_alpha == 0) {
Index: test_list.pl
===================================================================
RCS file: /cvsroot/libsysio/libsysio/tests/test_list.pl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -b -B -p -r1.3 -r1.4
--- test_list.pl 10 Oct 2003 18:50:31 -0000 1.3
+++ test_list.pl 21 Jan 2004 15:13:56 -0000 1.4
@@ -129,8 +129,7 @@ sub process_cmd
my $done_files = 0;
# Get tests directory
-my $testdir = $0;
-$testdir =~ s/\/\w+.pl$//;
+ my $testdir = $FindBin::Bin;
eval {
if ($is_alpha == 1) {
Index: test_path.pl
===================================================================
RCS file: /cvsroot/libsysio/libsysio/tests/test_path.pl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -b -B -p -r1.3 -r1.4
--- test_path.pl 10 Oct 2003 18:50:31 -0000 1.3
+++ test_path.pl 21 Jan 2004 15:13:56 -0000 1.4
@@ -87,8 +87,7 @@ sub process_cmd
my $path;
# Get tests directory
- my $testdir = $0;
- $testdir =~ s/\/\w+.pl$//;
+ my $testdir = $FindBin::Bin;
eval {
if ($isalpha == 0) {
Index: test_stats.pl
===================================================================
RCS file: /cvsroot/libsysio/libsysio/tests/test_stats.pl,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -b -B -p -r1.5 -r1.6
--- test_stats.pl 30 Oct 2003 15:22:19 -0000 1.5
+++ test_stats.pl 21 Jan 2004 15:13:56 -0000 1.6
@@ -95,8 +95,7 @@ sub process_cmd
my ($file, $use_system, $is_alpha) = @_;
# Get tests directory
-my $testdir = $0;
-$testdir =~ s/\/\w+.pl$//;
+ my $testdir = $FindBin::Bin;
eval {
if ($is_alpha == 0) {
Index: test_symlink.pl
===================================================================
RCS file: /cvsroot/libsysio/libsysio/tests/test_symlink.pl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -b -B -p -r1.3 -r1.4
--- test_symlink.pl 30 Oct 2003 15:22:19 -0000 1.3
+++ test_symlink.pl 21 Jan 2004 15:13:56 -0000 1.4
@@ -58,8 +58,7 @@ sub process_cmd
my ($src, $dest, $is_alpha) = @_;
# Get tests directory
- my $testdir = $0;
- $testdir =~ s/\/\w+.pl$//;
+ my $testdir = $FindBin::Bin;
eval {
if ($is_alpha == 0) {
|
|
From: Lee W. <lw...@us...> - 2004-01-21 15:06:34
|
Update of /cvsroot/libsysio/libsysio/src
In directory sc8-pr-cvs1:/tmp/cvs-serv28973
Modified Files:
init.c read.c write.c
Log Message:
Removed CYGWIN test for hacking around core devices. Bitrot.
Index: init.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/init.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -b -B -p -r1.4 -r1.5
--- init.c 21 Jan 2004 14:44:53 -0000 1.4
+++ init.c 21 Jan 2004 15:06:31 -0000 1.5
@@ -78,7 +78,6 @@ _sysio_init()
if (err)
goto error;
-#ifndef __CYGWIN__
err = _sysio_dev_init();
if (err)
goto error;
@@ -87,7 +86,6 @@ _sysio_init()
if (err)
goto error;
#endif
-#endif
#ifdef WITH_SOCKETS
err = _sysio_sockets_init();
if (err)
Index: read.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/read.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -w -b -B -p -r1.10 -r1.11
--- read.c 21 Jan 2004 14:44:53 -0000 1.10
+++ read.c 21 Jan 2004 15:06:31 -0000 1.11
@@ -112,7 +112,6 @@ ipreadv(int fd, const struct iovec *iov,
{
struct file *fil;
struct ioctx *ioctxp;
- ioid_t rc;
SYSIO_ENTER;
fil = _sysio_fd_find(fd);
@@ -193,7 +192,6 @@ ireadv(int fd, const struct iovec *iov,
{
struct file *fil;
struct ioctx *ioctxp;
- ioid_t rc;
SYSIO_ENTER;
fil = _sysio_fd_find(fd);
Index: write.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/write.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -w -b -B -p -r1.11 -r1.12
--- write.c 21 Jan 2004 14:44:53 -0000 1.11
+++ write.c 21 Jan 2004 15:06:31 -0000 1.12
@@ -112,7 +112,6 @@ ipwritev(int fd, const struct iovec *iov
{
struct file *fil;
struct ioctx *ioctxp;
- ioid_t rc;
SYSIO_ENTER;
fil = _sysio_fd_find(fd);
@@ -193,7 +192,6 @@ iwritev(int fd, const struct iovec *iov,
{
struct file *fil;
struct ioctx *ioctxp;
- ioid_t rc;
SYSIO_ENTER;
fil = _sysio_fd_find(fd);
|
|
From: Lee W. <lw...@us...> - 2004-01-21 15:01:14
|
Update of /cvsroot/libsysio/libsysio/drivers/native
In directory sc8-pr-cvs1:/tmp/cvs-serv27523
Modified Files:
fs_native.c
Log Message:
Removed the printf error message from the fcntl routine. We don't have
printf and the symbol reference madness is bad enough without calling
into the IO portions of glibc from here.
Index: fs_native.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -w -b -B -p -r1.27 -r1.28
--- fs_native.c 21 Jan 2004 14:44:53 -0000 1.27
+++ fs_native.c 21 Jan 2004 15:01:11 -0000 1.28
@@ -1362,7 +1362,6 @@ native_inop_fcntl(struct inode *ino,
arg = va_arg(ap, long);
return syscall(SYS_fcntl, nino->ni_fd, cmd, arg);
default:
- printf("uncatched cmd %d\n", cmd);
abort();
}
return -1;
|
|
From: Lee W. <lw...@us...> - 2004-01-21 14:50:55
|
Update of /cvsroot/libsysio/libsysio
In directory sc8-pr-cvs1:/tmp/cvs-serv24940
Modified Files:
configure.in
Log Message:
Noted that the sockets driver is "EXPERIMENTAL". It probably cannot link
successfully right now without other mods from CFS.
Index: configure.in
===================================================================
RCS file: /cvsroot/libsysio/libsysio/configure.in,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -w -b -B -p -r1.14 -r1.15
--- configure.in 21 Jan 2004 14:44:53 -0000 1.14
+++ configure.in 21 Jan 2004 14:50:52 -0000 1.15
@@ -124,7 +124,7 @@ AM_CONDITIONAL(WITH_CPLANT_TESTS, test x
AC_ARG_WITH(sockets,
AC_HELP_STRING([--with-sockets],
- [build sockets interface driver]),
+ [build sockets interface driver (EXPERIMENTAL)]),
[ case "${withval}" in
yes) ;;
no) ;;
|
|
From: Lee W. <lw...@us...> - 2004-01-21 14:44:59
|
Update of /cvsroot/libsysio/libsysio/src
In directory sc8-pr-cvs1:/tmp/cvs-serv23555/src
Modified Files:
chdir.c chmod.c chown.c dup.c fcntl.c fsync.c getdirentries.c
init.c ioctl.c iowait.c lseek.c mkdir.c mknod.c open.c read.c
rmdir.c stat.c stat64.c statvfs.c statvfs64.c symlink.c
truncate.c unlink.c utime.c write.c
Log Message:
A roll-up patch from CFS (Eric Mei <er...@cl...>)
- intent.diff
small changes on intent related behavior. I simply follow the lustre
kernel code here.
- open() need to pass down param 'flags'.
- 'setattr' related syscalls, like chown/chmod/utime/..., don't need
intent during path resolution.
- sockets.diff
your socket driver.
- nativefs.diff
only add fcntl code into native driver. not sure whether it's
complete, but ok for current testing.
- trace.diff
this patch add SYSIO_ENTER/SYSIO_LEAVE macros.
Index: chdir.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/chdir.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -w -b -B -p -r1.10 -r1.11
--- chdir.c 27 Oct 2003 23:42:29 -0000 1.10
+++ chdir.c 21 Jan 2004 14:44:53 -0000 1.11
@@ -119,14 +119,19 @@ chdir(const char *path)
{
int err;
struct pnode *pno;
+ SYSIO_ENTER;
err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno);
if (err) {
errno = -err;
+ SYSIO_LEAVE;
return -1;
}
- return _sysio_p_chdir(pno);
+ err = _sysio_p_chdir(pno);
+
+ SYSIO_LEAVE;
+ return err;
}
/*
@@ -219,12 +224,15 @@ char *
getcwd(char *buf, size_t size)
{
int err;
+ SYSIO_ENTER;
err = _sysio_p_path(_sysio_cwd, &buf, buf ? size : 0);
if (err) {
errno = -err;
+ SYSIO_LEAVE;
return NULL;
}
+ SYSIO_LEAVE;
return buf;
}
Index: chmod.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/chmod.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -b -B -p -r1.4 -r1.5
--- chmod.c 27 Sep 2003 19:42:02 -0000 1.4
+++ chmod.c 21 Jan 2004 14:44:53 -0000 1.5
@@ -70,12 +70,11 @@ do_chmod(struct pnode *pno, struct inode
int
chmod(const char *path, mode_t mode)
{
- struct intent intent;
int err;
struct pnode *pno;
+ SYSIO_ENTER;
- INTENT_INIT(&intent, INT_SETATTR, NULL, NULL);
- err = _sysio_namei(_sysio_cwd, path, 0, &intent, &pno);
+ err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno);
if (err)
goto out;
err = do_chmod(pno, pno->p_base->pb_ino, mode);
@@ -85,6 +84,7 @@ out:
errno = -err;
err = -1;
}
+ SYSIO_LEAVE;
return err;
}
Index: chown.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/chown.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -b -B -p -r1.4 -r1.5
--- chown.c 27 Sep 2003 19:42:02 -0000 1.4
+++ chown.c 21 Jan 2004 14:44:53 -0000 1.5
@@ -59,6 +59,7 @@ _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;
@@ -91,6 +92,7 @@ out:
errno = -err;
err = -1;
}
+ SYSIO_LEAVE;
return err;
}
Index: dup.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/dup.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -b -B -p -r1.2 -r1.3
--- dup.c 23 Oct 2003 15:16:05 -0000 1.2
+++ dup.c 21 Jan 2004 14:44:53 -0000 1.3
@@ -54,23 +54,44 @@
int
dup2(int oldfd, int newfd)
{
+ int rc;
+ SYSIO_ENTER;
if (newfd < 0) {
errno = EBADF;
+ SYSIO_LEAVE;
return -1;
}
- if (oldfd == newfd)
+ if (oldfd == newfd) {
+ SYSIO_LEAVE;
return newfd;
+ }
+
+ rc = _sysio_fd_dup2(oldfd, newfd);
+ if (rc < 0) {
+ errno = -rc;
+ rc = -1;
+ }
- return _sysio_fd_dup2(oldfd, newfd);
+ SYSIO_LEAVE;
+ return rc;
}
int
dup(int oldfd)
{
+ int rc;
+ SYSIO_ENTER;
+
+ rc = _sysio_fd_dup2(oldfd, -1);
+ if (rc < 0) {
+ errno = -rc;
+ rc = -1;
+ }
- return _sysio_fd_dup2(oldfd, -1);
+ SYSIO_LEAVE;
+ return rc;
}
#ifdef __GLIBC__
Index: fcntl.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/fcntl.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -b -B -p -r1.6 -r1.7
--- fcntl.c 14 Oct 2003 18:00:29 -0000 1.6
+++ fcntl.c 21 Jan 2004 14:44:53 -0000 1.7
@@ -59,6 +59,7 @@ fcntl(int fd, int cmd, ...)
int err;
struct file *fil;
va_list ap;
+ SYSIO_ENTER;
err = 0;
fil = _sysio_fd_find(fd);
@@ -72,6 +73,7 @@ fcntl(int fd, int cmd, ...)
case F_DUPFD:
{
long newfd;
+ int rc;
va_start(ap, cmd);
newfd = va_arg(ap, long);
@@ -80,7 +82,10 @@ fcntl(int fd, int cmd, ...)
err = -EBADF;
goto out;
}
- return _sysio_fd_dup2(fd, (int )newfd);
+ rc = _sysio_fd_dup2(fd, (int )newfd);
+
+ SYSIO_LEAVE;
+ return rc;
}
break;
default:
@@ -95,6 +100,7 @@ out:
errno = -err;
err = -1;
}
+ SYSIO_LEAVE;
return err;
}
Index: fsync.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/fsync.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -b -B -p -r1.2 -r1.3
--- fsync.c 9 Mar 2003 06:22:43 -0000 1.2
+++ fsync.c 21 Jan 2004 14:44:53 -0000 1.3
@@ -55,17 +55,22 @@ fsync(int fd)
{
struct file *fil;
int err;
+ SYSIO_ENTER;
fil = _sysio_fd_find(fd);
if (!(fil && fil->f_ino)) {
errno = -EBADF;
+ SYSIO_LEAVE;
return -1;
}
err = (*fil->f_ino->i_ops.inop_sync)(fil->f_ino);
if (err) {
errno = -err;
+ SYSIO_LEAVE;
return -1;
}
+
+ SYSIO_LEAVE;
return 0;
}
@@ -74,16 +79,21 @@ fdatasync(int fd)
{
struct file *fil;
int err;
+ SYSIO_ENTER;
fil = _sysio_fd_find(fd);
if (!(fil && fil->f_ino)) {
errno = -EBADF;
+ SYSIO_LEAVE;
return -1;
}
err = (*fil->f_ino->i_ops.inop_datasync)(fil->f_ino);
if (err) {
errno = -err;
+ SYSIO_LEAVE;
return -1;
}
+
+ SYSIO_LEAVE;
return 0;
}
Index: getdirentries.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/getdirentries.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -b -B -p -r1.4 -r1.5
--- getdirentries.c 14 Oct 2003 18:00:29 -0000 1.4
+++ getdirentries.c 21 Jan 2004 14:44:53 -0000 1.5
@@ -96,6 +96,7 @@ getdirentries(int fd,
size_t n;
size_t reclen;
char *cp;
+ SYSIO_ENTER;
#define _dbaselen ((size_t )&((struct dirent *)0)->d_name[0])
#ifdef __GLIBC__
@@ -128,6 +129,7 @@ getdirentries(int fd,
ibuf = _fast_alloc(inbytes);
if (!ibuf) {
errno = ENOMEM;
+ SYSIO_LEAVE;
return -1;
}
@@ -199,6 +201,7 @@ out:
if (dp == (struct dirent *)buf && cc < 0) {
errno = (int )-cc;
+ SYSIO_LEAVE;
return -1;
}
cc = (char *)dp - buf;
@@ -209,6 +212,7 @@ out:
#else
off;
#endif
+ SYSIO_LEAVE;
return cc;
#ifdef __GLIBC__
Index: init.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/init.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -b -B -p -r1.3 -r1.4
--- init.c 24 Mar 2003 22:09:06 -0000 1.3
+++ init.c 21 Jan 2004 14:44:53 -0000 1.4
@@ -64,6 +64,9 @@ int
_sysio_init()
{
int err;
+#ifdef WITH_SOCKETS
+ int _sysio_sockets_init(void);
+#endif
err = _sysio_ioctx_init();
if (err)
@@ -75,6 +78,7 @@ _sysio_init()
if (err)
goto error;
+#ifndef __CYGWIN__
err = _sysio_dev_init();
if (err)
goto error;
@@ -83,6 +87,12 @@ _sysio_init()
if (err)
goto error;
#endif
+#endif
+#ifdef WITH_SOCKETS
+ err = _sysio_sockets_init();
+ if (err)
+ goto error;
+#endif
goto out;
error:
Index: ioctl.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/ioctl.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -b -B -p -r1.4 -r1.5
--- ioctl.c 14 Oct 2003 18:00:30 -0000 1.4
+++ ioctl.c 21 Jan 2004 14:44:53 -0000 1.5
@@ -58,6 +58,7 @@ ioctl(int fd, unsigned long request, ...
int err;
struct file *fil;
va_list ap;
+ SYSIO_ENTER;
err = 0;
fil = _sysio_fd_find(fd);
@@ -75,6 +76,7 @@ out:
errno = -err;
err = -1;
}
+ SYSIO_LEAVE;
return err;
}
Index: iowait.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/iowait.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -b -B -p -r1.4 -r1.5
--- iowait.c 17 Oct 2003 21:30:29 -0000 1.4
+++ iowait.c 21 Jan 2004 14:44:53 -0000 1.5
@@ -70,13 +70,19 @@ int
iodone(ioid_t ioid)
{
struct ioctx *ioctx;
+ int rc;
+ SYSIO_ENTER;
ioctx = lookup_ioid(ioid);
- if (!ioctx)
+ if (!ioctx) {
+ SYSIO_LEAVE;
return -1;
+ }
- return (ioctx->ioctx_done ||
+ rc = (ioctx->ioctx_done ||
(*ioctx->ioctx_ino->i_ops.inop_iodone)(ioctx));
+ SYSIO_LEAVE;
+ return rc;
}
/*
@@ -90,15 +96,19 @@ iowait(ioid_t ioid)
{
struct ioctx *ioctx;
ssize_t cc;
+ SYSIO_ENTER;
ioctx = lookup_ioid(ioid);
- if (!ioctx)
+ if (!ioctx) {
+ SYSIO_LEAVE;
return -1;
+ }
cc = _sysio_ioctx_wait(ioctx);
if (cc < 0) {
errno = -(int )cc;
cc = -1;
}
+ SYSIO_LEAVE;
return cc;
}
Index: lseek.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/lseek.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -b -B -p -r1.9 -r1.10
--- lseek.c 29 Oct 2003 00:10:42 -0000 1.9
+++ lseek.c 21 Jan 2004 14:44:53 -0000 1.10
@@ -119,15 +119,20 @@ lseek(int fd, off_t offset, int whence)
{
_SYSIO_OFF_T off;
off_t rtn;
+ SYSIO_ENTER;
off = _sysio_lseek(fd, offset, whence);
- if (off < 0)
+ if (off < 0) {
+ SYSIO_LEAVE;
return -1;
+ }
rtn = (off_t )off;
if ((_SYSIO_OFF_T )rtn != off) {
errno = EINVAL;
+ SYSIO_LEAVE;
return -1;
}
+ SYSIO_LEAVE;
return rtn;
}
Index: mkdir.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/mkdir.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -b -B -p -r1.3 -r1.4
--- mkdir.c 24 Mar 2003 22:09:06 -0000 1.3
+++ mkdir.c 21 Jan 2004 14:44:53 -0000 1.4
@@ -58,6 +58,7 @@ mkdir(const char *path, mode_t mode)
int err;
struct intent intent;
struct pnode *pno;
+ SYSIO_ENTER;
INTENT_INIT(&intent, INT_CREAT, &mode, NULL);
err = _sysio_namei(_sysio_cwd, path, ND_NEGOK, &intent, &pno);
@@ -80,5 +81,7 @@ out:
errno = -err;
err = -1;
}
+
+ SYSIO_LEAVE;
return err;
}
Index: mknod.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/mknod.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -b -B -p -r1.5 -r1.6
--- mknod.c 12 Jan 2004 18:05:22 -0000 1.5
+++ mknod.c 21 Jan 2004 14:44:53 -0000 1.6
@@ -115,8 +115,13 @@ out:
static int
__mknod(const char *path, mode_t mode, dev_t dev)
{
+ int rc;
+ SYSIO_ENTER;
- return __xmknod(_MKNOD_VER, path, mode, &dev);
+ rc = __xmknod(_MKNOD_VER, path, mode, &dev);
+
+ SYSIO_LEAVE;
+ return rc;
}
sysio_sym_weak_alias(__mknod, mknod)
Index: open.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/open.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -w -b -B -p -r1.11 -r1.12
--- open.c 14 Oct 2003 18:00:30 -0000 1.11
+++ open.c 21 Jan 2004 14:44:53 -0000 1.12
@@ -55,6 +55,7 @@
#include "file.h"
#include "fs.h"
#include "mount.h"
+#include "sysio-symbols.h"
#include "sysio-symbols.h"
@@ -129,6 +130,7 @@ open(const char *path, int flags, ...)
int err;
struct pnode *pno;
struct file *fil;
+ SYSIO_ENTER;
/*
* Get mode argument and determine parameters for namei
@@ -169,7 +171,7 @@ open(const char *path, int flags, ...)
* Find the file.
*/
fil = NULL;
- INTENT_INIT(&intent, intent.int_opmask, &mode, NULL);
+ INTENT_INIT(&intent, intent.int_opmask, &mode, &flags);
pno = NULL;
err = _sysio_namei(_sysio_cwd, path, ndflags, &intent, &pno);
if (err) {
@@ -196,6 +198,7 @@ open(const char *path, int flags, ...)
P_RELE(pno);
+ SYSIO_LEAVE;
return err;
error:
@@ -204,6 +207,7 @@ error:
if (pno)
P_RELE(pno);
errno = -err;
+ SYSIO_LEAVE;
return -1;
}
@@ -225,10 +229,12 @@ int
close(int fd)
{
int err;
+ SYSIO_ENTER;
err = _sysio_fd_close(fd);
if (err)
errno = -err;
+ SYSIO_LEAVE;
return err ? -1 : 0;
}
Index: read.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/read.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -b -B -p -r1.9 -r1.10
--- read.c 14 Oct 2003 18:00:30 -0000 1.9
+++ read.c 21 Jan 2004 14:44:53 -0000 1.10
@@ -112,14 +112,18 @@ ipreadv(int fd, const struct iovec *iov,
{
struct file *fil;
struct ioctx *ioctxp;
+ ioid_t rc;
+ SYSIO_ENTER;
fil = _sysio_fd_find(fd);
if (!fil) {
errno = -EBADF;
+ SYSIO_LEAVE;
return IOID_FAIL;
}
ioctxp = do_ixreadv(fil, iov, count, offset, NULL);
+ SYSIO_LEAVE;
return ioctxp ? ioctxp->ioctx_id : IOID_FAIL;
}
@@ -189,16 +193,22 @@ ireadv(int fd, const struct iovec *iov,
{
struct file *fil;
struct ioctx *ioctxp;
+ ioid_t rc;
+ SYSIO_ENTER;
fil = _sysio_fd_find(fd);
if (!fil) {
errno = -EBADF;
+ SYSIO_LEAVE;
return IOID_FAIL;
}
ioctxp = do_ixreadv(fil, iov, count, fil->f_pos, _sysio_fcompletio);
- if (!ioctxp)
+ if (!ioctxp) {
+ SYSIO_LEAVE;
return IOID_FAIL;
+ }
+ SYSIO_LEAVE;
return ioctxp->ioctx_id;
}
Index: rmdir.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/rmdir.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -b -B -p -r1.4 -r1.5
--- rmdir.c 27 Sep 2003 19:42:03 -0000 1.4
+++ rmdir.c 21 Jan 2004 14:44:53 -0000 1.5
@@ -58,6 +58,7 @@ rmdir(const char *path)
struct intent intent;
int err;
struct pnode *pno;
+ SYSIO_ENTER;
INTENT_INIT(&intent, INT_UPDPARENT, NULL, NULL);
err = _sysio_namei(_sysio_cwd, path, 0, &intent, &pno);
@@ -82,5 +83,6 @@ out:
errno = -err;
err = -1;
}
+ SYSIO_LEAVE;
return err;
}
Index: stat.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/stat.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -b -B -p -r1.7 -r1.8
--- stat.c 24 Oct 2003 18:49:24 -0000 1.7
+++ stat.c 21 Jan 2004 14:44:53 -0000 1.8
@@ -129,8 +129,13 @@ out:
static int
__fstat(int fd, struct stat *buf)
{
+ int rc;
+ SYSIO_ENTER;
- return __fxstat(_STAT_VER, fd, buf);
+ rc = __fxstat(_STAT_VER, fd, buf);
+
+ SYSIO_LEAVE;
+ return rc;
}
sysio_sym_weak_alias(__fstat, fstat)
@@ -186,8 +191,13 @@ out:
static int
__stat(const char *filename, struct stat *buf)
{
+ int rc;
+ SYSIO_ENTER;
+
+ rc = __xstat(_STAT_VER, filename, buf);
- return __xstat(_STAT_VER, filename, buf);
+ SYSIO_LEAVE;
+ return rc;
}
sysio_sym_weak_alias(__stat, stat)
@@ -243,8 +253,13 @@ out:
static int
__lstat(const char *filename, struct stat *buf)
{
+ int rc;
+ SYSIO_ENTER;
+
+ rc = __lxstat(_STAT_VER, filename, buf);
- return __lxstat(_STAT_VER, filename, buf);
+ SYSIO_LEAVE;
+ return rc;
}
sysio_sym_weak_alias(__lstat, lstat)
Index: stat64.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/stat64.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -b -B -p -r1.5 -r1.6
--- stat64.c 21 Oct 2003 01:13:58 -0000 1.5
+++ stat64.c 21 Jan 2004 14:44:53 -0000 1.6
@@ -91,8 +91,13 @@ out:
int
fstat64(int fd, struct stat64 *buf)
{
+ int rc;
+ SYSIO_ENTER;
- return __fxstat64(_STAT_VER, fd, buf);
+ rc = __fxstat64(_STAT_VER, fd, buf);
+
+ SYSIO_LEAVE;
+ return rc;
}
int
@@ -127,8 +132,13 @@ out:
int
stat64(const char *filename, struct stat64 *buf)
{
+ int rc;
+ SYSIO_ENTER;
+
+ rc = __xstat64(_STAT_VER, filename, buf);
- return __xstat64(_STAT_VER, filename, buf);
+ SYSIO_LEAVE;
+ return rc;
}
int
@@ -163,7 +173,12 @@ out:
int
lstat64(const char *filename, struct stat64 *buf)
{
+ int rc;
+ SYSIO_ENTER;
+
+ rc = __lxstat64(_STAT_VER, filename, buf);
- return __lxstat64(_STAT_VER, filename, buf);
+ SYSIO_LEAVE;
+ return rc;
}
#endif /* !_LARGEFILE64_SOURCE */
Index: statvfs.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/statvfs.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -b -B -p -r1.4 -r1.5
--- statvfs.c 10 Oct 2003 18:50:31 -0000 1.4
+++ statvfs.c 21 Jan 2004 14:44:53 -0000 1.5
@@ -88,6 +88,7 @@ statvfs(const char *path, struct statvfs
struct intnl_statvfs _call_buffer;
struct intnl_statvfs *_call_buf = &_call_buffer;
#endif
+ SYSIO_ENTER;
err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno);
if (err)
@@ -105,6 +106,7 @@ err:
errno = -err;
err = -1;
out:
+ SYSIO_LEAVE;
return err;
}
@@ -119,6 +121,7 @@ fstatvfs(int fd, struct statvfs *buf)
struct intnl_statvfs _call_buffer;
struct intnl_statvfs *_call_buf = &_call_buffer;
#endif
+ SYSIO_ENTER;
err = 0;
filp = _sysio_fd_find(fd);
@@ -138,6 +141,7 @@ err:
errno = -err;
err = -1;
out:
+ SYSIO_LEAVE;
return err;
}
#endif /* if !(defined(BSD) || defined(REDSTORM)) */
Index: statvfs64.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/statvfs64.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -b -B -p -r1.5 -r1.6
--- statvfs64.c 21 Oct 2003 13:38:47 -0000 1.5
+++ statvfs64.c 21 Jan 2004 14:44:53 -0000 1.6
@@ -60,6 +60,7 @@ statvfs64(const char *path, struct statv
{
int err;
struct pnode *pno;
+ SYSIO_ENTER;
err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno);
if (err)
@@ -72,6 +73,8 @@ out:
errno = -err;
err = -1;
}
+
+ SYSIO_LEAVE;
return err;
}
@@ -80,6 +83,7 @@ fstatvfs64(int fd, struct statvfs64 *buf
{
int err;
struct file *filp;
+ SYSIO_ENTER;
err = 0;
filp = _sysio_fd_find(fd);
@@ -94,6 +98,8 @@ out:
errno = -err;
err = -1;
}
+
+ SYSIO_LEAVE;
return err;
}
#endif /* if !(defined(BSD) || defined(REDSTORM)) */
Index: symlink.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/symlink.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -b -B -p -r1.3 -r1.4
--- symlink.c 24 Mar 2003 22:09:07 -0000 1.3
+++ symlink.c 21 Jan 2004 14:44:53 -0000 1.4
@@ -58,6 +58,7 @@ symlink(const char *oldpath, const char
int err;
struct intent intent;
struct pnode *pno;
+ SYSIO_ENTER;
INTENT_INIT(&intent, INT_CREAT, NULL, NULL);
err = _sysio_namei(_sysio_cwd, newpath, ND_NEGOK, &intent, &pno);
@@ -81,5 +82,6 @@ out:
errno = -err;
err = -1;
}
+ SYSIO_LEAVE;
return err;
}
Index: truncate.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/truncate.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -b -B -p -r1.5 -r1.6
--- truncate.c 23 Oct 2003 15:20:31 -0000 1.5
+++ truncate.c 21 Jan 2004 14:44:53 -0000 1.6
@@ -84,6 +84,7 @@ _truncate(const char *path, _SYSIO_OFF_T
{
int err;
struct pnode *pno;
+ SYSIO_ENTER;
err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno);
if (err)
@@ -96,6 +97,7 @@ out:
errno = -err;
err = -1;
}
+ SYSIO_LEAVE;
return err;
}
@@ -120,6 +122,7 @@ _ftruncate(int fd, _SYSIO_OFF_T length)
{
int err;
struct file *fil;
+ SYSIO_ENTER;
err = 0;
fil = _sysio_fd_find(fd);
@@ -133,6 +136,7 @@ out:
errno = -err;
err = -1;
}
+ SYSIO_LEAVE;
return err;
}
Index: unlink.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/unlink.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -b -B -p -r1.5 -r1.6
--- unlink.c 30 Oct 2003 15:20:49 -0000 1.5
+++ unlink.c 21 Jan 2004 14:44:53 -0000 1.6
@@ -58,6 +58,7 @@ unlink(const char *path)
struct intent intent;
int err;
struct pnode *pno;
+ SYSIO_ENTER;
INTENT_INIT(&intent, INT_UPDPARENT, NULL, NULL);
err = _sysio_namei(_sysio_cwd, path, ND_NOFOLLOW, &intent, &pno);
@@ -82,5 +83,6 @@ out:
errno = -err;
err = -1;
}
+ SYSIO_LEAVE;
return err;
}
Index: utime.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/utime.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -b -B -p -r1.1 -r1.2
--- utime.c 27 Sep 2003 19:42:03 -0000 1.1
+++ utime.c 21 Jan 2004 14:44:53 -0000 1.2
@@ -58,14 +58,12 @@
int
utime(const char *path, const struct utimbuf *buf)
{
- struct intent intent;
int err;
struct pnode *pno;
struct utimbuf _utbuffer;
struct intnl_stat stbuf;
- INTENT_INIT(&intent, INT_SETATTR, NULL, NULL);
- err = _sysio_namei(_sysio_cwd, path, 0, &intent, &pno);
+ err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno);
if (err)
goto out;
if (!buf) {
Index: write.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/write.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -w -b -B -p -r1.10 -r1.11
--- write.c 20 Oct 2003 15:51:22 -0000 1.10
+++ write.c 21 Jan 2004 14:44:53 -0000 1.11
@@ -112,14 +112,18 @@ ipwritev(int fd, const struct iovec *iov
{
struct file *fil;
struct ioctx *ioctxp;
+ ioid_t rc;
+ SYSIO_ENTER;
fil = _sysio_fd_find(fd);
if (!fil) {
errno = -EBADF;
+ SYSIO_LEAVE;
return IOID_FAIL;
}
ioctxp = do_ixwritev(fil, iov, count, offset, NULL);
+ SYSIO_LEAVE;
return ioctxp ? ioctxp->ioctx_id : IOID_FAIL;
}
@@ -189,16 +193,22 @@ iwritev(int fd, const struct iovec *iov,
{
struct file *fil;
struct ioctx *ioctxp;
+ ioid_t rc;
+ SYSIO_ENTER;
fil = _sysio_fd_find(fd);
if (!fil) {
- errno = -EBADF;
+ errno = EBADF;
+ SYSIO_LEAVE;
return IOID_FAIL;
}
ioctxp = do_ixwritev(fil, iov, count, fil->f_pos, _sysio_fcompletio);
- if (!ioctxp)
+ if (!ioctxp) {
+ SYSIO_LEAVE;
return IOID_FAIL;
+ }
+ SYSIO_LEAVE;
return ioctxp->ioctx_id;
}
|
|
From: Lee W. <lw...@us...> - 2004-01-21 14:44:57
|
Update of /cvsroot/libsysio/libsysio/tests
In directory sc8-pr-cvs1:/tmp/cvs-serv23555/tests
Modified Files:
Makefile.am
Log Message:
A roll-up patch from CFS (Eric Mei <er...@cl...>)
- intent.diff
small changes on intent related behavior. I simply follow the lustre
kernel code here.
- open() need to pass down param 'flags'.
- 'setattr' related syscalls, like chown/chmod/utime/..., don't need
intent during path resolution.
- sockets.diff
your socket driver.
- nativefs.diff
only add fcntl code into native driver. not sure whether it's
complete, but ok for current testing.
- trace.diff
this patch add SYSIO_ENTER/SYSIO_LEAVE macros.
Index: Makefile.am
===================================================================
RCS file: /cvsroot/libsysio/libsysio/tests/Makefile.am,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -w -b -B -p -r1.16 -r1.17
--- Makefile.am 16 Dec 2003 15:43:15 -0000 1.16
+++ Makefile.am 21 Jan 2004 14:44:54 -0000 1.17
@@ -35,7 +35,16 @@ YOD_DRIVER_NAME=
YOD_DRIVER_CFLAGS=
endif
-DRIVERS=$(NATIVE_DRIVER_NAME) $(INCORE_DRIVER_NAME) $(YOD_DRIVER_NAME) $(STFD_DEV_NAME)
+if WITH_SOCKETS_DRIVER
+SOCKETS_DRIVER_NAME=sockets
+SOCKETS_DRIVER_CFLAGS= -I$(top_srcdir)/drivers/sockets
+else
+SOCKETS_DRIVER_NAME=
+SOCKETS_DRIVER_CFLAGS=
+endif
+
+DRIVERS=$(NATIVE_DRIVER_NAME) $(INCORE_DRIVER_NAME) $(YOD_DRIVER_NAME) \
+ $(STFD_DEV_NAME) $(SOCKETS_DRIVER_NAME)
CMNSRC=drv_init_all.c drv_data.c
|
|
From: Lee W. <lw...@us...> - 2004-01-21 14:44:57
|
Update of /cvsroot/libsysio/libsysio
In directory sc8-pr-cvs1:/tmp/cvs-serv23555
Modified Files:
Makefile.am Rules.make configure.in
Log Message:
A roll-up patch from CFS (Eric Mei <er...@cl...>)
- intent.diff
small changes on intent related behavior. I simply follow the lustre
kernel code here.
- open() need to pass down param 'flags'.
- 'setattr' related syscalls, like chown/chmod/utime/..., don't need
intent during path resolution.
- sockets.diff
your socket driver.
- nativefs.diff
only add fcntl code into native driver. not sure whether it's
complete, but ok for current testing.
- trace.diff
this patch add SYSIO_ENTER/SYSIO_LEAVE macros.
Index: Makefile.am
===================================================================
RCS file: /cvsroot/libsysio/libsysio/Makefile.am,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -b -B -p -r1.9 -r1.10
--- Makefile.am 16 Dec 2003 15:43:14 -0000 1.9
+++ Makefile.am 21 Jan 2004 14:44:53 -0000 1.10
@@ -13,17 +13,61 @@ include $(top_srcdir)/dev/stdfd/module.m
include $(top_srcdir)/drivers/incore/module.mk
include $(top_srcdir)/drivers/native/module.mk
include $(top_srcdir)/drivers/yod/module.mk
+include $(top_srcdir)/drivers/sockets/module.mk
lib_LIBRARIES = ${LIBBUILD_DIR}/libsysio.a
-__LIBBUILD_DIR__libsysio_a_SOURCES = $(SRCDIR_SRCS) $(STDFD_SRCS) \
- $(INCORE_SRCS) $(NATIVE_SRCS) $(YOD_SRCS)
+if WITH_STDFD_DEV
+OPTIONAL_STDFD_SRCS = $(STDFD_SRCS)
+else
+OPTIONAL_STDFD_SRCS =
+endif
+
+if WITH_INCORE_DRIVER
+OPTIONAL_INCORE_SRCS = $(INCORE_SRCS)
+else
+OPTIONAL_INCORE_SRCS =
+endif
+
+if WITH_NATIVE_DRIVER
+OPTIONAL_NATIVE_SRCS = $(NATIVE_SRCS)
+else
+OPTIONAL_NATIVE_SRCS =
+endif
+
+if WITH_SOCKETS_DRIVER
+OPTIONAL_SOCKETS_SRCS = $(SOCKETS_SRCS)
+else
+OPTIONAL_SOCKETS_SRCS =
+endif
+
+if WITH_CPLANT_YOD
+OPTIONAL_YOD_SRCS = $(YOD_SRCS)
+else
+OPTIONAL_YOD_SRCS =
+endif
+
+__LIBBUILD_DIR__libsysio_a_SOURCES = \
+ $(SRCDIR_SRCS) \
+ $(OPTIONAL_STDFD_SRCS) \
+ $(OPTIONAL_INCORE_SRCS) \
+ $(OPTIONAL_SOCKETS_SRCS) \
+ $(OPTIONAL_NATIVE_SRCS) \
+ $(OPTIONAL_YOD_SRCS)
+
+#
+# Cygwin related? Configure seems to do this for us when appropriate. Why
+# was this here?
+#
+# Commented out by Lee; Wed Jan 21 08:21:33 EST 2004
+#
+#__LIBBUILD_DIR__libsysio_a_CFLAGS = -fPIC
include $(top_srcdir)/Rules.make
EXTRA_DIST = Rules.make $(TESTS_EXTRA) $(SRCDIR_EXTRA) \
$(INCLUDE_EXTRA) $(STDFD_EXTRA) $(INCORE_EXTRA) \
- $(NATIVE_EXTRA) $(YOD_EXTRA)
+ $(SOCKETS_EXTRA) $(NATIVE_EXTRA) $(YOD_EXTRA)
AM_CPPFLAGS += ${YOD_DRIVER_FLAGS}
Index: Rules.make
===================================================================
RCS file: /cvsroot/libsysio/libsysio/Rules.make,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -b -B -p -r1.4 -r1.5
--- Rules.make 24 Mar 2003 22:06:38 -0000 1.4
+++ Rules.make 21 Jan 2004 14:44:53 -0000 1.5
@@ -5,6 +5,14 @@ else
STFD_DEV_CPPFLAGS =
endif
+if WITH_SOCKETS_DRIVER
+SOCKETS_CPPFLAGS=-DWITH_SOCKETS=1
+else
+SOCKETS_CPPFLAGS=
+endif
+
DEV_CPPFLAGS = $(STDFD_DEV_CPPFLAGS)
-AM_CPPFLAGS = $(AUTOMOUNT) $(DEV_CPPFLAGS) -I$(top_srcdir)/include
+AM_CPPFLAGS = \
+ $(AUTOMOUNT) $(DEV_CPPFLAGS) $(SOCKETS_CPPFLAGS) \
+ -I$(top_srcdir)/include
Index: configure.in
===================================================================
RCS file: /cvsroot/libsysio/libsysio/configure.in,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -w -b -B -p -r1.13 -r1.14
--- configure.in 12 Jan 2004 18:10:32 -0000 1.13
+++ configure.in 21 Jan 2004 14:44:53 -0000 1.14
@@ -122,6 +122,17 @@ AC_ARG_WITH(cplant_tests,
[with_cplant_tests=no])
AM_CONDITIONAL(WITH_CPLANT_TESTS, test x$with_cplant_tests != xno)
+AC_ARG_WITH(sockets,
+ AC_HELP_STRING([--with-sockets],
+ [build sockets interface driver]),
+ [ case "${withval}" in
+ yes) ;;
+ no) ;;
+ *) AC_MSG_ERROR(bad value ${withval} for --with-sockets) ;;
+ esac],
+ [with_sockets=no])
+AM_CONDITIONAL(WITH_SOCKETS_DRIVER, test x$with_sockets = xyes)
+
# We keep the original values in `$config_*' and never modify them, so we
# can write them unchanged into config.make. Everything else uses
# $machine, $vendor, and $os, and changes them whenever convenient.
|
|
From: Lee W. <lw...@us...> - 2004-01-21 14:44:57
|
Update of /cvsroot/libsysio/libsysio/drivers/native
In directory sc8-pr-cvs1:/tmp/cvs-serv23555/drivers/native
Modified Files:
fs_native.c
Log Message:
A roll-up patch from CFS (Eric Mei <er...@cl...>)
- intent.diff
small changes on intent related behavior. I simply follow the lustre
kernel code here.
- open() need to pass down param 'flags'.
- 'setattr' related syscalls, like chown/chmod/utime/..., don't need
intent during path resolution.
- sockets.diff
your socket driver.
- nativefs.diff
only add fcntl code into native driver. not sure whether it's
complete, but ok for current testing.
- trace.diff
this patch add SYSIO_ENTER/SYSIO_LEAVE macros.
Index: fs_native.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -w -b -B -p -r1.26 -r1.27
--- fs_native.c 12 Jan 2004 18:07:16 -0000 1.26
+++ fs_native.c 21 Jan 2004 14:44:53 -0000 1.27
@@ -1337,15 +1337,34 @@ native_inop_iodone(struct ioctx *ioctxp
}
static int
-native_inop_fcntl(struct inode *ino __IS_UNUSED,
- int cmd __IS_UNUSED,
- va_list ap __IS_UNUSED)
+native_inop_fcntl(struct inode *ino,
+ int cmd,
+ va_list ap)
{
+ struct native_inode *nino = I2NI(ino);
+ long arg;
- /*
- * I'm lazy. Maybe implemented later.
- */
- errno = ENOTTY;
+ if (nino->ni_fd < 0)
+ abort();
+
+ switch (cmd) {
+ case F_GETFD:
+ case F_GETFL:
+ case F_GETOWN:
+ return syscall(SYS_fcntl, nino->ni_fd, cmd);
+ case F_DUPFD:
+ case F_SETFD:
+ case F_SETFL:
+ case F_GETLK:
+ case F_SETLK:
+ case F_SETLKW:
+ case F_SETOWN:
+ arg = va_arg(ap, long);
+ return syscall(SYS_fcntl, nino->ni_fd, cmd, arg);
+ default:
+ printf("uncatched cmd %d\n", cmd);
+ abort();
+ }
return -1;
}
|
|
From: Lee W. <lw...@us...> - 2004-01-21 14:44:57
|
Update of /cvsroot/libsysio/libsysio/include
In directory sc8-pr-cvs1:/tmp/cvs-serv23555/include
Modified Files:
sysio.h
Log Message:
A roll-up patch from CFS (Eric Mei <er...@cl...>)
- intent.diff
small changes on intent related behavior. I simply follow the lustre
kernel code here.
- open() need to pass down param 'flags'.
- 'setattr' related syscalls, like chown/chmod/utime/..., don't need
intent during path resolution.
- sockets.diff
your socket driver.
- nativefs.diff
only add fcntl code into native driver. not sure whether it's
complete, but ok for current testing.
- trace.diff
this patch add SYSIO_ENTER/SYSIO_LEAVE macros.
Index: sysio.h
===================================================================
RCS file: /cvsroot/libsysio/libsysio/include/sysio.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -w -b -B -p -r1.14 -r1.15
--- sysio.h 29 Oct 2003 00:25:53 -0000 1.14
+++ sysio.h 21 Jan 2004 14:44:53 -0000 1.15
@@ -258,3 +258,42 @@ extern int mount(const char *source, con
unsigned long mountflags,
const void *data);
extern int umount(const char *target);
+
+/* for debugging */
+#if 1
+#define ASSERT(cond) \
+ if (!(cond)) { \
+ printf("ASSERTION(" #cond ") failed: " __FILE__ ":" \
+ __FUNCTION__ ":%d\n", __LINE__); \
+ abort(); \
+ }
+
+#define ERROR(fmt, a...) \
+ do { \
+ printf("ERROR(" __FILE__ ":%d):" fmt, __LINE__, ##a); \
+ while(0)
+
+#else
+#define ERROR(fmt) do{}while(0)
+#define ASSERT do{}while(0)
+#endif
+
+/* syscall enter/leave hook functions */
+#if 1
+#define SYSIO_ENTER
+#define SYSIO_LEAVE
+
+#else
+extern void _sysio_sysenter();
+extern void _sysio_sysleave();
+
+#define SYSIO_ENTER \
+ do { \
+ _sysio_sysenter(); \
+ } while(0)
+
+#define SYSIO_LEAVE \
+ do { \
+ _sysio_sysleave(); \
+ } while(0)
+#endif
|