libsysio-commit Mailing List for libsysio (Page 30)
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: Sonja T. <so...@us...> - 2004-03-11 15:07:34
|
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7290/tests Modified Files: helper.pm test_all.pl Log Message: Fixing buf in enumerate_extents. Added a somewhat less trivial test for strided I/O to test suite. Index: helper.pm =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/helper.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -b -B -p -r1.3 -r1.4 --- helper.pm 10 Oct 2003 18:50:31 -0000 1.3 +++ helper.pm 11 Mar 2004 14:40:53 -0000 1.4 @@ -27,9 +27,6 @@ sub print_and_exit my $res = <$outfh>; chop($res); - if ($res ne "0000 ") { - print STDOUT "ERROR! Failed to free buf (code $res)\n"; - } print $cmdfh "exit\n"; close $outfh; Index: test_all.pl =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_all.pl,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -b -B -p -r1.9 -r1.10 --- test_all.pl 14 Feb 2004 19:43:00 -0000 1.9 +++ test_all.pl 11 Mar 2004 14:40:53 -0000 1.10 @@ -191,6 +191,17 @@ if ($res ne "rw test successful") { print "rw test finished successfully\n"; } +# Test strided I/O +$res = `perl $testdir/test_strided.pl $alpha_arg $cwd/tmp_dir/tmp2.foo`; +chop($res); +if ($res ne "strided IO test successful") { + print "strided IO test failed with message: $res\n"; + $failures++; +} else { + $success++; + print "strided IO test finished successfully\n"; +} + print "$failures tests failed and $success tests succeeded\n"; # cleanup |
From: Lee W. <lw...@us...> - 2004-03-05 13:29:23
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25438/src Modified Files: namei.c Log Message: The indication that a directory *might* be an automount candidate is the ISUID flag. Not ISVTX. Changed to reflect that. Index: namei.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/namei.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -b -B -p -r1.11 -r1.12 --- namei.c 14 Feb 2004 19:42:59 -0000 1.11 +++ namei.c 5 Mar 2004 13:07:19 -0000 1.12 @@ -252,7 +252,7 @@ _sysio_path_walk(struct pnode *parent, s S_ISDIR(ino->i_mode) && (nd->nd_pno->p_mount->mnt_flags & MOUNT_F_AUTO) && nd->nd_amcnt < MAX_MOUNT_DEPTH && - ino->i_mode & S_ISVTX) { + ino->i_mode & S_ISUID) { struct pnode *pno; /* |
From: Lee W. <lw...@us...> - 2004-03-05 13:29:22
|
Update of /cvsroot/libsysio/libsysio/misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25438/misc Modified Files: init-env.sh Log Message: The indication that a directory *might* be an automount candidate is the ISUID flag. Not ISVTX. Changed to reflect that. Index: init-env.sh =================================================================== RCS file: /cvsroot/libsysio/libsysio/misc/init-env.sh,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -b -B -p -r1.3 -r1.4 --- init-env.sh 25 Feb 2004 15:45:31 -0000 1.3 +++ init-env.sh 5 Mar 2004 13:07:18 -0000 1.4 @@ -16,9 +16,9 @@ if [ "x${SYSIO_AUTOMOUNT}" == "xyes" ]; # _extras=" \ {mnt, dev=\"incore:0755+0+0\",dir=\"/mnt\",fl=2} \ - {creat, ft=dir,nm=\"/mnt/home\",pm=01755,ow=0,gr=0} \ + {creat, ft=dir,nm=\"/mnt/home\",pm=04755,ow=0,gr=0} \ {creat, ft=file,nm=\"/mnt/home/.mount\",pm=0600, \ - str=\"native:/usr/home\"} \ + str=\"native:/home\"} \ " fi export SYSIO_NAMESPACE="\ |
From: Lee W. <lw...@us...> - 2004-03-05 13:29:17
|
Update of /cvsroot/libsysio/libsysio In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25438 Modified Files: README Log Message: The indication that a directory *might* be an automount candidate is the ISUID flag. Not ISVTX. Changed to reflect that. Index: README =================================================================== RCS file: /cvsroot/libsysio/libsysio/README,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -b -B -p -r1.4 -r1.5 --- README 10 Oct 2003 18:50:30 -0000 1.4 +++ README 5 Mar 2004 13:07:18 -0000 1.5 @@ -31,7 +31,7 @@ For a full description of this see the " <http://www.lustre.org/docs/lustre.pdf> In short, though, whenever a component is being looked up in a directory and -that directory has the "sticky" (IS_VTX) bit set, then the directory is +that directory has the "set-UID" bit set, then the directory is searched for a special file. By default, that file is called ".mount" but you may set it to any name using the --with-automount option described earlier. |
From: Ruth K. <rk...@us...> - 2004-03-04 18:29:30
|
Update of /cvsroot/libsysio/libsysio/drivers/yod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3889/drivers/yod Modified Files: Tag: gmdev fs_yod.c Log Message: The gmdev branch records what is currently sitting in the Cplant repository. Changes to fs_yod.c also make it compatible with the strided-io mods. Index: fs_yod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/yod/fs_yod.c,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -u -w -b -B -p -r1.11 -r1.11.2.1 --- fs_yod.c 25 Feb 2004 16:23:59 -0000 1.11 +++ fs_yod.c 4 Mar 2004 18:08:06 -0000 1.11.2.1 @@ -140,12 +140,13 @@ struct yod_inode_identifier { * system objects. */ struct yod_inode { + unsigned ni_seekok : 1; /* can seek? */ struct yod_inode_identifier ni_ident; /* unique identifier */ struct file_identifier ni_fileid; /* ditto */ int ni_fd; /* host fildes */ int ni_oflags; /* flags, from open */ unsigned ni_nopens; /* soft ref count */ - off_t ni_fpos; /* current pos */ + _SYSIO_OFF_T ni_fpos; /* current pos */ }; static int yod_inop_lookup(struct pnode *pno, @@ -172,10 +173,8 @@ static int yod_inop_close(struct inode * static int yod_inop_link(struct pnode *old, struct pnode *new); static int yod_inop_unlink(struct pnode *pno); static int yod_inop_rename(struct pnode *old, struct pnode *new); -static int yod_inop_ipreadv(struct inode *ino, - struct ioctx *ioctx); -static int yod_inop_ipwritev(struct inode *ino, - struct ioctx *ioctx); +static int yod_inop_read(struct inode *ino, struct ioctx *ioctx); +static int yod_inop_write(struct inode *ino, struct ioctx *ioctx); static int yod_inop_iodone(struct ioctx *ioctx); static int yod_inop_fcntl(struct inode *ino, int cmd, va_list ap); static int yod_inop_sync(struct inode *ino); @@ -184,6 +183,12 @@ static int yod_inop_ioctl(struct inode * unsigned long int request, va_list ap); static int yod_inop_mknod(struct pnode *pno, mode_t mode, dev_t dev); +static void *yod_inop_mmap(struct inode *ino, + void *start, + size_t length, + int prot, + int flags, + _SYSIO_OFF_T offset); #ifdef _HAVE_STATVFS static int yod_inop_statvfs(struct pnode *pno, struct inode *ino, @@ -205,14 +210,15 @@ static struct inode_ops yod_i_ops = { yod_inop_link, yod_inop_unlink, yod_inop_rename, - yod_inop_ipreadv, - yod_inop_ipwritev, + yod_inop_read, + yod_inop_write, yod_inop_iodone, yod_inop_fcntl, yod_inop_sync, yod_inop_datasync, yod_inop_ioctl, yod_inop_mknod, + yod_inop_mmap, #ifdef _HAVE_STATVFS yod_inop_statvfs, #endif @@ -892,6 +898,13 @@ yod_inop_open(struct pnode *pno, int fla nino->ni_fpos = 0; nino->ni_fd = fd; + /* + * Need to know whether we can seek on this + * descriptor. + */ + nino->ni_seekok = + lseek_yod(nino->ni_fd, 0, SEEK_CUR) != 0 ? 0 : 1; + return 0; } @@ -978,75 +991,55 @@ yod_inop_unlink(struct pnode *pno) * now. */ static int -doio(ssize_t (*f)(int, const struct iovec *, int), - struct inode *ino, +doio(ssize_t (*f)(void *, size_t, _SYSIO_OFF_T, struct yod_inode *), struct ioctx *ioctx) { - struct yod_inode *nino = I2NI(ino); - loff_t result; - - assert(nino->ni_fd >= 0); - - if ((ioctx->ioctx_iovlen && (int )ioctx->ioctx_iovlen < 0) || - !(S_ISREG(ino->i_mode) || - S_ISCHR(ino->i_mode) || - S_ISSOCK(ino->i_mode) || - S_ISFIFO(ino->i_mode))) - return -EINVAL; + struct yod_inode *nino = I2NI(ioctx->ioctx_ino); + if (ioctx->ioctx_xtvlen != 1) { /* - * This implementation first positions the real system descriptor, then - * performs the operation. This is silly because it's not atomic. - * - * An alternative, more complex, less efficient but atomic, - * implementation might consider each entry of the iovec separately. - * Then, the system implementations of the POSIX p{reaad,write} calls - * could be used. - * - * Avoid the reposition call if we're already at the right place. - * Allows us to access pipes and fifos. + * No scatter/gather supported in yod I/O */ - result = ioctx->ioctx_offset; - if (ioctx->ioctx_offset != nino->ni_fpos) { - result = lseek_yod(nino->ni_fd, - ioctx->ioctx_offset, - SEEK_SET); - if (result == -1) { - ioctx->ioctx_cc = -1; - ioctx->ioctx_errno = errno; - goto out; - } - nino->ni_fpos = result; + return -EINVAL; } - /* - * Call the appropriate (read/write) IO function to - * transfer the data now. - */ + ioctx->ioctx_cc = - (*f)(nino->ni_fd, ioctx->ioctx_iovec, ioctx->ioctx_iovlen); - if (ioctx->ioctx_cc < 0) - ioctx->ioctx_errno = errno; - if (ioctx->ioctx_cc > 0) + _sysio_doio(ioctx->ioctx_xtv, ioctx->ioctx_xtvlen, + ioctx->ioctx_iov, ioctx->ioctx_iovlen, + (ssize_t (*)(void *, size_t, _SYSIO_OFF_T, void *))f, + nino); + if (ioctx->ioctx_cc < 0) { + ioctx->ioctx_errno = -ioctx->ioctx_cc; + ioctx->ioctx_cc = -1; + return -1; + } nino->ni_fpos += ioctx->ioctx_cc; -out: ioctx->ioctx_done = 1; return 0; } -/* - * Helper function passed to doio(), above, to accomplish a real readv. - */ static ssize_t -_readv(int fd, const struct iovec *vector, int count) +yod_read_simple(void *buf, + size_t nbytes, + _SYSIO_OFF_T off, + struct yod_inode *nino) { - int i; - ssize_t total = 0; + if (off != nino->ni_fpos) { + _SYSIO_OFF_T rtn; - for (i = 0; i < count; i++) - total += read_yod(fd, - vector[i].iov_base, - vector[i].iov_len); - return total; + rtn = lseek_yod(nino->ni_fd, off, SEEK_SET); + if (rtn < 0) + return -1; + nino->ni_fpos = rtn; + } + return read_yod(nino->ni_fd, buf, nbytes); +} + +static int +yod_inop_read(struct inode *ino __IS_UNUSED, struct ioctx *ioctx) +{ + + return doio(yod_read_simple, ioctx); } static int @@ -1073,36 +1066,29 @@ out: return err; } -static int -yod_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) +yod_write_simple(void *buf, + size_t nbytes, + _SYSIO_OFF_T off, + struct yod_inode *nino) { - int i; - ssize_t total = 0; - for (i = 0; i < count; i++) - total += write_yod(fd, - vector[i].iov_base, - vector[i].iov_len); - return total; + if (off != nino->ni_fpos) { + _SYSIO_OFF_T rtn; + + rtn = lseek_yod(nino->ni_fd, off, SEEK_SET); + if (rtn < 0) + return -1; + nino->ni_fpos = rtn; + } + return write_yod(nino->ni_fd, buf, nbytes); } static int -yod_inop_ipwritev(struct inode *ino, - struct ioctx *ioctx) +yod_inop_write(struct inode *ino __IS_UNUSED, struct ioctx *ioctx) { - return doio(_writev, ino, ioctx); + return doio(yod_write_simple, ioctx); } static int @@ -1237,3 +1223,14 @@ yod_fsop_gone(struct filesys *fs __IS_UN * yod file interface. */ } + +static void * +yod_inop_mmap(struct inode *ino __IS_UNUSED, + void *start __IS_UNUSED, + size_t length __IS_UNUSED, + int prot __IS_UNUSED, + int flags __IS_UNUSED, + _SYSIO_OFF_T offset __IS_UNUSED) +{ + return (void *)-ENOSYS; +} |
From: Ruth K. <rk...@us...> - 2004-03-04 18:29:30
|
Update of /cvsroot/libsysio/libsysio/drivers/incore In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3889/drivers/incore Modified Files: Tag: gmdev fs_incore.c Log Message: The gmdev branch records what is currently sitting in the Cplant repository. Changes to fs_yod.c also make it compatible with the strided-io mods. Index: fs_incore.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/incore/fs_incore.c,v retrieving revision 1.16 retrieving revision 1.16.2.1 diff -u -w -b -B -p -r1.16 -r1.16.2.1 --- fs_incore.c 25 Feb 2004 16:23:58 -0000 1.16 +++ fs_incore.c 4 Mar 2004 18:08:06 -0000 1.16.2.1 @@ -180,6 +180,13 @@ static void _sysio_incore_illop(void); (int (*)(struct inode *, \ unsigned long int, \ va_list))_sysio_incore_e_isdir +#define _sysio_incore_inop_mmap \ + (void *(*)(struct inode *, \ + void *, \ + size_t, \ + int, \ + int, \ + _SYSIO_OFF_T))_sysio_incore_illop static struct inode_ops _sysio_incore_dir_ops = { _sysio_incore_dirop_lookup, @@ -203,6 +210,7 @@ static struct inode_ops _sysio_incore_di _sysio_incore_inop_sync, _sysio_incore_dirop_ioctl, _sysio_incore_dirop_mknod, + _sysio_incore_inop_mmap, #ifdef _HAVE_STATVFS _sysio_incore_inop_statvfs, #endif @@ -258,6 +266,7 @@ static struct inode_ops _sysio_incore_fi _sysio_incore_inop_sync, _sysio_incore_filop_ioctl, _sysio_incore_filop_mknod, + _sysio_incore_inop_mmap, #ifdef _HAVE_STATVFS _sysio_incore_inop_statvfs, #endif @@ -286,6 +295,7 @@ static struct inode_ops _sysio_incore_de _sysio_nodev_inop_sync, _sysio_nodev_inop_ioctl, _sysio_incore_filop_mknod, + _sysio_incore_inop_mmap, #ifdef _HAVE_STATVFS _sysio_incore_inop_statvfs, #endif |
From: Ruth K. <rk...@us...> - 2004-03-04 18:29:29
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3889/src Modified Files: Tag: gmdev dev.c inode.c ioctl.c module.mk Added Files: Tag: gmdev mmap.c Log Message: The gmdev branch records what is currently sitting in the Cplant repository. Changes to fs_yod.c also make it compatible with the strided-io mods. --- 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... */ #include <unistd.h> #include <errno.h> #include <sys/types.h> #include <fcntl.h> #include <sys/queue.h> #include "sysio.h" #include "inode.h" #include "file.h" #include "sysio-symbols.h" void * mmap(void *start, size_t length, int prot, int flags, int fd, _SYSIO_OFF_T offset) { void *loc; struct file *fil; SYSIO_ENTER; fil = _sysio_fd_find(fd); if (!fil) { errno = EBADF; SYSIO_LEAVE; return (void *)-1; } loc = fil->f_ino->i_ops.inop_mmap(fil->f_ino, start, length, prot, flags, offset); SYSIO_LEAVE; return loc; } #if 0 #ifdef __GLIBC__ #undef __mmap sysio_sym_weak_alias(mmap, __mmap) #endif #ifdef BSD #undef _mmap sysio_sym_weak_alias(mmap, _mmap) #endif #endif Index: dev.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/dev.c,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -w -b -B -p -r1.6 -r1.6.2.1 --- dev.c 6 Feb 2004 20:07:30 -0000 1.6 +++ dev.c 4 Mar 2004 18:08:07 -0000 1.6.2.1 @@ -74,6 +74,7 @@ const struct inode_ops _sysio_nodev_ops _sysio_nodev_inop_datasync, _sysio_nodev_inop_ioctl, _sysio_nodev_inop_mknod, + _sysio_nodev_inop_mmap, #ifdef _HAVE_STATVFS _sysio_nodev_inop_statvfs, #endif Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.14 retrieving revision 1.14.2.1 diff -u -w -b -B -p -r1.14 -r1.14.2.1 --- inode.c 24 Feb 2004 14:58:26 -0000 1.14 +++ inode.c 4 Mar 2004 18:08:07 -0000 1.14.2.1 @@ -255,6 +255,7 @@ _sysio_i_new(struct filesys *fs, operations.inop_iodone = o->inop_iodone; operations.inop_datasync = o->inop_datasync; operations.inop_ioctl = o->inop_ioctl; + operations.inop_mmap = o->inop_mmap; } I_INIT(ino, fs, type, rdev, &operations, fid, immunity, private); ino->i_ref = 1; Index: ioctl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctl.c,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -w -b -B -p -r1.6 -r1.6.2.1 --- ioctl.c 26 Jan 2004 16:34:54 -0000 1.6 +++ ioctl.c 4 Mar 2004 18:08:07 -0000 1.6.2.1 @@ -72,7 +72,7 @@ ioctl(int fd, unsigned long request, ... va_end(ap); out: - if (err) { + if (err < 0) { errno = -err; err = -1; } Index: module.mk =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/module.mk,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -w -b -B -p -r1.3 -r1.3.2.1 --- module.mk 24 Feb 2004 14:58:26 -0000 1.3 +++ module.mk 4 Mar 2004 18:08:07 -0000 1.3.2.1 @@ -8,7 +8,7 @@ SRCDIR_SRCS = src/access.c src/chdir.c s src/getdirentries.c src/init.c src/inode.c \ src/ioctl.c src/ioctx.c src/iowait.c \ src/link.c src/lseek.c src/mkdir.c \ - src/mknod.c src/mount.c src/namei.c \ + src/mknod.c src/mount.c src/mmap.c src/namei.c \ src/open.c src/rw.c src/rename.c \ src/rmdir.c src/stat64.c src/stat.c \ src/symlink.c \ |
From: Ruth K. <rk...@us...> - 2004-03-04 18:29:29
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3889/drivers/native Modified Files: Tag: gmdev fs_native.c Log Message: The gmdev branch records what is currently sitting in the Cplant repository. Changes to fs_yod.c also make it compatible with the strided-io mods. Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.33 retrieving revision 1.33.2.1 diff -u -w -b -B -p -r1.33 -r1.33.2.1 --- fs_native.c 25 Feb 2004 16:23:58 -0000 1.33 +++ fs_native.c 4 Mar 2004 18:08:06 -0000 1.33.2.1 @@ -228,6 +228,12 @@ static int native_inop_ioctl(struct inod unsigned long int request, va_list ap); static int native_inop_mknod(struct pnode *pno, mode_t mode, dev_t dev); +static void *native_inop_mmap(struct inode *ino, + void *start, + size_t length, + int prot, + int flags, + _SYSIO_OFF_T offset); #ifdef _HAVE_STATVFS static int native_inop_statvfs(struct pnode *pno, struct inode *ino, @@ -257,6 +263,7 @@ static struct inode_ops native_i_ops = { native_inop_datasync, native_inop_ioctl, native_inop_mknod, + native_inop_mmap, #ifdef _HAVE_STATVFS native_inop_statvfs, #endif @@ -362,7 +369,7 @@ native_i_new(struct filesys *fs, struct #else buf->st_mode, /* all of the bits! */ #endif - 0, + buf->st_rdev, 0, &native_i_ops, nino); @@ -1580,3 +1587,14 @@ native_fsop_gone(struct filesys *fs __IS * native file interface. */ } + +static void * +native_inop_mmap(struct inode *ino __IS_UNUSED, + void *start __IS_UNUSED, + size_t length __IS_UNUSED, + int prot __IS_UNUSED, + int flags __IS_UNUSED, + _SYSIO_OFF_T offset __IS_UNUSED) +{ + return (void *)-ENOSYS; +} |
From: Ruth K. <rk...@us...> - 2004-03-04 18:29:29
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3889/include Modified Files: Tag: gmdev dev.h inode.h Log Message: The gmdev branch records what is currently sitting in the Cplant repository. Changes to fs_yod.c also make it compatible with the strided-io mods. Index: dev.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/dev.h,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -w -b -B -p -r1.6 -r1.6.2.1 --- dev.h 6 Feb 2004 20:07:29 -0000 1.6 +++ dev.h 4 Mar 2004 18:08:06 -0000 1.6.2.1 @@ -133,6 +133,13 @@ extern const struct inode_ops _sysio_nod (int (*)(struct pnode *, \ mode_t, \ dev_t))_sysio_dev_illop +#define _sysio_nodev_inop_mmap \ + (void *(*)(struct inode *, \ + void *, \ + size_t, \ + int, \ + int, \ + _SYSIO_OFF_T))_sysio_dev_illop #ifdef _HAVE_STATVFS #define _sysio_nodev_inop_statvfs \ (int (*)(struct pnode *, \ Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.15 retrieving revision 1.15.2.1 diff -u -w -b -B -p -r1.15 -r1.15.2.1 --- inode.h 14 Feb 2004 19:42:58 -0000 1.15 +++ inode.h 4 Mar 2004 18:08:06 -0000 1.15.2.1 @@ -107,6 +107,12 @@ struct inode_ops { int (*inop_datasync)(struct inode *ino); int (*inop_ioctl)(struct inode *ino, unsigned long int request, va_list ap); int (*inop_mknod)(struct pnode *pno, mode_t mode, dev_t dev); + void *(*inop_mmap)(struct inode *ino, + void *start, + size_t length, + int prot, + int flags, + _SYSIO_OFF_T offset); #ifdef _HAVE_STATVFS int (*inop_statvfs)(struct pnode *pno, struct inode *ino, |
From: Ruth K. <rk...@us...> - 2004-03-04 18:29:29
|
Update of /cvsroot/libsysio/libsysio/dev/gmdev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3889/dev/gmdev Added Files: Tag: gmdev gmdev.c gmdev.h module.mk Log Message: The gmdev branch records what is currently sitting in the Cplant repository. Changes to fs_yod.c also make it compatible with the strided-io mods. --- 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 <errno.h> #include <stdlib.h> #include <sys/syscall.h> #include <unistd.h> #include <sys/uio.h> #include <sys/types.h> #include <sys/queue.h> #include "sysio.h" #include "inode.h" #include "dev.h" #include "gmdev.h" /* * Myricom GM device driver support */ struct gmdev_private{ int g_fd; dev_t g_dev; }; #define I2GP(ino) ((struct gmdev_private *)((ino)->i_private)) static int gmdev_open(struct pnode *pno, int flags, mode_t mode); static int gmdev_close(struct inode *ino); static int gmdev_read(struct inode *ino, struct ioctx *ioctx); static int gmdev_write(struct inode *ino, struct ioctx *ioctx); static int gmdev_iodone(struct ioctx *ioctx); static int gmdev_datasync(struct inode *ino); static int gmdev_ioctl(struct inode *ino, unsigned long int request, va_list ap); static void *gmdev_mmap(struct inode *ino, void *start, size_t length, int prot, int flags, _SYSIO_OFF_T offset); int _sysio_gmdev_init() { int err = 0; struct inode_ops gmdev_operations; gmdev_operations = _sysio_nodev_ops; gmdev_operations.inop_open = gmdev_open; gmdev_operations.inop_close = gmdev_close; gmdev_operations.inop_read = gmdev_read; gmdev_operations.inop_write = gmdev_write; gmdev_operations.inop_iodone = gmdev_iodone; gmdev_operations.inop_datasync = gmdev_datasync; gmdev_operations.inop_ioctl = gmdev_ioctl; gmdev_operations.inop_mmap = gmdev_mmap; err = _sysio_char_dev_register(SYSIO_GM_DEV_MAJOR, "gmdev", &gmdev_operations); if (err < 0) return err; err = _sysio_char_dev_register(SYSIO_CTASK_MAJOR, "cTask", &gmdev_operations); if (err < 0) return err; err = _sysio_char_dev_register(SYSIO_ptRXTX_MAJOR, "ptRXTX", &gmdev_operations); return err; } static int gmdev_open(struct pnode *pno, int flags, mode_t mode) { int fd, err = 0; char *path; dev_t gdev; struct inode *ino; struct gmdev_private *gpriv; gpriv = malloc(sizeof(struct gmdev_private)); if (gpriv == NULL) { err = -ENOMEM; goto out; } path = _sysio_pb_path(pno->p_base, '/'); if (path == NULL) { err = -ENOMEM; goto out; } if ((ino = pno->p_base->pb_ino) == NULL) { err = -ENOENT; goto out; } gdev = SYSIO_MAJOR_DEV(ino->i_rdev); if (gdev == I2GP(ino)->g_dev) { /* * Disallow multiple opens */ err = -EBUSY; goto out; } fd = syscall(SYS_open, path, flags, mode); if (fd < 0) { err = -errno; goto out; } gpriv->g_fd = fd; gpriv->g_dev = ino->i_rdev; ino->i_private = gpriv; out: if (err < 0) free(gpriv); return err; } static int gmdev_close(struct inode *ino) { syscall(SYS_close, I2GP(ino)->g_fd); return 0; } static int doio(ssize_t (*f)(void *, size_t, _SYSIO_OFF_T, struct inode *), struct inode *ino, struct ioctx *ioctx) { if (ioctx->ioctx_xtvlen != 1) { /* * No scatter/gather to "file" address space (we're not * seekable) and "nowhere" makes no sense. */ return -EINVAL; } ioctx->ioctx_cc = _sysio_doio(ioctx->ioctx_xtv, ioctx->ioctx_xtvlen, ioctx->ioctx_iov, ioctx->ioctx_iovlen, (ssize_t (*)(void *, size_t, _SYSIO_OFF_T, void *))f, ino); if (ioctx->ioctx_cc < 0) { ioctx->ioctx_errno = -ioctx->ioctx_cc; ioctx->ioctx_cc = -1; } return 0; } static ssize_t gmdev_read_simple(void *buf, size_t nbytes, _SYSIO_OFF_T off __IS_UNUSED, struct inode *ino) { return syscall(SYS_read, I2GP(ino)->g_fd, buf, nbytes); } static ssize_t gmdev_write_simple(const void *buf, size_t nbytes, _SYSIO_OFF_T off __IS_UNUSED, struct inode *ino) { return syscall(SYS_write, I2GP(ino)->g_fd, buf, nbytes); } static int gmdev_read(struct inode *ino, struct ioctx *ioctx) { return doio(gmdev_read_simple, ino, ioctx); } static int gmdev_write(struct inode *ino, struct ioctx *ioctx) { return doio((ssize_t (*)(void *, size_t, _SYSIO_OFF_T, struct inode *))gmdev_write_simple, ino, ioctx); } static int gmdev_iodone(struct ioctx *iocp __IS_UNUSED) { /* * It's always done in this driver. It completed when posted. */ return 1; } static int gmdev_datasync(struct inode *ino __IS_UNUSED) { /* * We don't buffer, so nothing to do. */ return 0; } static int gmdev_ioctl(struct inode *ino, unsigned long int request, va_list ap) { int err = 0; unsigned long arg; arg = va_arg(ap, unsigned long); err = syscall(SYS_ioctl, I2GP(ino)->g_fd, request, arg); if (err < 0) err = -errno; return err; } extern void * __mmap64(void *, size_t, int, int, int, off64_t); static void * gmdev_mmap(struct inode *ino, void *start, size_t length, int prot, int flags, _SYSIO_OFF_T offset) { void *p; int fd; #if 0 long _sc_ret, _sc_err; #endif fd = I2GP(ino)->g_fd; #if 0 /* * GLIBC 2.2.4 in RH7.2 exports a syscall interface enabled for * only 5 args, see sysdeps/unix/sysv/linux/alpha/syscall.S * return is always EINVAL here. */ p = syscall(SYS_mmap, start, length, prot, flags, fd, offset); #elif 0 /* * This is the way GLIBC 2.2.4 in RH7.2 implements its own * internal 6 arg syscall (definition in gmdev.h), and it works fine, * see sysdeps/unix/alpha/sysdep.h */ inline_syscall6(mmap, start, length, prot, flags, fd, offset); if (_sc_err != 0) return (void *)_sc_err; return (void *)_sc_ret; #else p = __mmap64(start, length, prot, flags, fd, offset); #endif return p; } --- 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... */ /* * Myricom GM device driver support */ #define SYSIO_GM_DEV_MAJOR 0x29 #define SYSIO_CTASK_MAJOR 0x3f #define SYSIO_ptRXTX_MAJOR 0x41 extern int _sysio_gm_init(void); struct native_inode_identifier { dev_t dev; /* device number */ ino_t ino; /* i-number */ #ifdef HAVE_GENERATION unsigned int gen; /* generation number */ #endif }; struct native_inode { unsigned ni_seekok : 1; /* can seek? */ struct native_inode_identifier ni_ident; /* unique identifier */ struct file_identifier ni_fileid; /* ditto */ int ni_fd; /* host fildes */ int ni_oflags; /* flags, from open */ unsigned ni_nopens; /* soft ref count */ _SYSIO_OFF_T ni_fpos; /* current pos */ }; #define I2NI(ino) ((struct native_inode *)((ino)->i_private)) #if 0 /* * This is the way GLIBC 2.2.4 in RH7.2 implements its own * internal 6 arg syscall * see sysdeps/unix/alpha/sysdep.h */ #define inline_syscall_clobbers \ "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", \ "$22", "$23", "$24", "$25", "$27", "$28", "memory" #define inline_syscall6(name,arg1,arg2,arg3,arg4,arg5,arg6) \ { \ register long _sc_0 __asm__("$0"); \ register long _sc_16 __asm__("$16"); \ register long _sc_17 __asm__("$17"); \ register long _sc_18 __asm__("$18"); \ register long _sc_19 __asm__("$19"); \ register long _sc_20 __asm__("$20"); \ register long _sc_21 __asm__("$21"); \ \ _sc_0 = __NR_##name; \ _sc_16 = (long) (arg1); \ _sc_17 = (long) (arg2); \ _sc_18 = (long) (arg3); \ _sc_19 = (long) (arg4); \ _sc_20 = (long) (arg5); \ _sc_21 = (long) (arg6); \ __asm__("callsys # %0 %1 <= %2 %3 %4 %5 %6 %7 %8" \ : "=r"(_sc_0), "=r"(_sc_19) \ : "0"(_sc_0), "r"(_sc_16), "r"(_sc_17), \ "r"(_sc_18), "1"(_sc_19), "r"(_sc_20), \ "r"(_sc_21) \ : inline_syscall_clobbers); \ _sc_ret = _sc_0, _sc_err = _sc_19; \ } #endif --- NEW FILE --- GMDEV_SRCS = dev/gmdev/gmdev.c GMDEV_EXTRA = dev/gmdev/gmdev.h dev/gmdev/module.mk |
From: Ruth K. <rk...@us...> - 2004-03-04 18:29:27
|
Update of /cvsroot/libsysio/libsysio In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3889 Modified Files: Tag: gmdev Makefile.am Log Message: The gmdev branch records what is currently sitting in the Cplant repository. Changes to fs_yod.c also make it compatible with the strided-io mods. Index: Makefile.am =================================================================== RCS file: /cvsroot/libsysio/libsysio/Makefile.am,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -u -w -b -B -p -r1.11 -r1.11.2.1 --- Makefile.am 14 Feb 2004 19:42:57 -0000 1.11 +++ Makefile.am 4 Mar 2004 18:08:05 -0000 1.11.2.1 @@ -10,6 +10,7 @@ include $(top_srcdir)/src/module.mk include $(top_srcdir)/include/module.mk include $(top_srcdir)/tests/module.mk include $(top_srcdir)/dev/stdfd/module.mk +include $(top_srcdir)/dev/gmdev/module.mk include $(top_srcdir)/drivers/incore/module.mk include $(top_srcdir)/drivers/native/module.mk include $(top_srcdir)/drivers/yod/module.mk @@ -43,13 +44,16 @@ endif if WITH_CPLANT_YOD OPTIONAL_YOD_SRCS = $(YOD_SRCS) +OPTIONAL_GMDEV_SRCS = $(GMDEV_SRCS) else OPTIONAL_YOD_SRCS = +OPTIONAL_GMDEV_SRCS = endif __LIBBUILD_DIR__libsysio_a_SOURCES = \ $(SRCDIR_SRCS) \ $(OPTIONAL_STDFD_SRCS) \ + $(OPTIONAL_GMDEV_SRCS) \ $(OPTIONAL_INCORE_SRCS) \ $(OPTIONAL_SOCKETS_SRCS) \ $(OPTIONAL_NATIVE_SRCS) \ @@ -66,7 +70,7 @@ __LIBBUILD_DIR__libsysio_a_SOURCES = \ include $(top_srcdir)/Rules.make EXTRA_DIST = Rules.make misc/init-env.sh $(TESTS_EXTRA) $(SRCDIR_EXTRA) \ - $(INCLUDE_EXTRA) $(STDFD_EXTRA) $(INCORE_EXTRA) \ + $(INCLUDE_EXTRA) $(STDFD_EXTRA) $(INCORE_EXTRA) $(GMDEV_EXTRA) \ $(SOCKETS_EXTRA) $(NATIVE_EXTRA) $(YOD_EXTRA) AM_CPPFLAGS += ${YOD_DRIVER_FLAGS} |
From: Ruth K. <rk...@us...> - 2004-03-04 18:25:00
|
Update of /cvsroot/libsysio/libsysio/dev/gmdev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3189/gmdev Log Message: Directory /cvsroot/libsysio/libsysio/dev/gmdev added to the repository --> Using per-directory sticky tag `gmdev' |
From: Sonja T. <so...@us...> - 2004-03-01 23:08:17
|
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31923/tests Modified Files: test_rw.pl Log Message: Oops. Might be nice to have test_rw.pl clean up after itself... Index: test_rw.pl =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_rw.pl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -b -B -p -r1.3 -r1.4 --- test_rw.pl 1 Mar 2004 22:46:39 -0000 1.3 +++ test_rw.pl 1 Mar 2004 22:49:01 -0000 1.4 @@ -459,6 +459,7 @@ sub od_verify } close(ODFILE); + system("rm -f tmp.out.$$"); } sub process_cmd |
From: Sonja T. <so...@us...> - 2004-03-01 23:05:50
|
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31370/tests Modified Files: help.c sysio_stubs.c test_rw.pl Log Message: Make test_rw.pl a little more useful by using different integers in the buffer Index: help.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/help.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -b -B -p -r1.3 -r1.4 --- help.c 6 Feb 2004 20:07:31 -0000 1.3 +++ help.c 1 Mar 2004 22:46:39 -0000 1.4 @@ -48,7 +48,7 @@ void usage_setdebug() void usage_setbuf() { - fprintf(outfp, "setbuf val size buf: fill size bytes of buf with byte val\n"); + fprintf(outfp, "setbuf [val] [size] [buf] [off]: fill size bytes of buf with byte val\n"); } @@ -542,7 +542,8 @@ void usage_ireadx() void usage_checkbuf() { - fprintf(outfp, "checkbuf buf size val: Checks to see if val is in first size bytes of buf\n"); + fprintf(outfp, "checkbuf [buf] [size] [val] [off]: Staring at offset off, checks to see\n"); + fprintf(outfp, " if val is in first size bytes of buf\n"); } void usage_exit() Index: sysio_stubs.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/sysio_stubs.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- sysio_stubs.c 24 Feb 2004 15:46:33 -0000 1.10 +++ sysio_stubs.c 1 Mar 2004 22:46:39 -0000 1.11 @@ -425,11 +425,11 @@ int get_endian(int argc, char **argv) int do_setbuf(int argc, char **argv) { - int val, size, index; + int val, size, index, offset; void *buf; - if (argc != 3) { - DBG(2, fprintf(outfp, "Need val, size, and buffer for setbuf\n")); + if (argc != 4) { + DBG(2, fprintf(outfp, "Need val, size, buffer, and offset for setbuf\n")); return INVALID_ARGS; } val = get_obj(argv[0]); @@ -454,6 +454,15 @@ int do_setbuf(int argc, char **argv) buf = buflist[index]->buf; + offset = get_obj(argv[3]); + + if (offset < 0) { + DBG(2, fprintf(outfp, "Unable to understand %s\n", argv[3])); + return INVALID_ARGS; + } + + buf = (void *)((char *)buf +offset); + memset(buf, val, size); return SUCCESS; @@ -2308,7 +2317,7 @@ int test_do_init_iovec(int argc, char ** iov_ptr = (struct iovec *)(buflist[iov_index]->buf); iov_ptr[pos].iov_len = len; - iov_ptr[pos].iov_base = (void *)(base_ptr + (char)offset); + iov_ptr[pos].iov_base = (void *)(base_ptr + offset); DBG(3, fprintf(outfp, "iov_ptr.len is %d and base is %p\n", iov_ptr[pos].iov_len, iov_ptr[pos].iov_base)); @@ -2630,11 +2638,11 @@ int test_do_ireadx(int argc, char **argv int do_checkbuf(int argc, char **argv) { - int size, val, index, i; + int size, val, index, i, offset; int *ref_buf, *buf; - if (argc != 3) { - DBG(2, fprintf(outfp, "Need buffer and val for checkbuf\n")); + if (argc != 4) { + DBG(2, fprintf(outfp, "Need buffer, val, and offset for checkbuf\n")); return INVALID_ARGS; } @@ -2647,30 +2655,41 @@ int do_checkbuf(int argc, char **argv) buf = (int *)buflist[index]->buf; - val = get_obj(argv[1]); - if (val < 0) { + size = get_obj(argv[1]); + + if (size < 0) { DBG(2, fprintf(outfp, "Unable to understand %s\n", argv[1])); return INVALID_ARGS; } - size = get_obj(argv[2]); + val = get_obj(argv[2]); - if (size < 0) { + if (val < 0) { DBG(2, fprintf(outfp, "Unable to understand %s\n", argv[2])); return INVALID_ARGS; } + + offset = get_obj(argv[3]); + + if (offset < 0) { + DBG(2, fprintf(outfp, "Unable to understand %s\n", argv[3])); + return INVALID_ARGS; + } + + ref_buf = (int *)malloc(size); memset((void *)ref_buf, val, size); last_ret_val =0; + buf = (int *)((char *)buf + offset); for (i=0; (unsigned)i < size/sizeof(int); i++) { if (buf[i] != ref_buf[i]) { DBG(2, fprintf(stderr, "At pos %d I found a 0x%08x instead of 0x%08x\n", i, buf[i], ref_buf[i])); - fprintf(stderr, "At pos %d I found a 0x%08x instead of 0x%08x\n", - i, buf[i], ref_buf[i]); + fprintf(stderr, "At pos %d I found a 0x%08x instead of 0x%08x (val was %d)\n", + i, buf[i], ref_buf[i], val); last_ret_val = 1; break; } Index: test_rw.pl =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_rw.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -b -B -p -r1.2 -r1.3 --- test_rw.pl 6 Feb 2004 20:07:31 -0000 1.2 +++ test_rw.pl 1 Mar 2004 22:46:39 -0000 1.3 @@ -130,33 +131,74 @@ sub check_buf { my ($cmdfh, $outfh, $bufsize, $readcmd) = @_; + my $i; + my $digit = 0; + my $offset = 0; + my $cmdstr; - my $cmdstr = 'CALL checkbuf $buf '. "1 $bufsize\n"; + for ($i =0; $i < 64; $i++) { + $cmdstr = 'CALL checkbuf $buf'. " 1024 $digit $offset\n"; helper::send_cmd($cmdfh, $outfh, "checkbuf", $cmdstr); my $res = helper::verify_cmd($cmdfh, $outfh, "checkbuf"); $res = oct($res); if ($res != 0) { print STDOUT "Checkbuf returned $res\n"; - helper::print_and_exit($cmdfh, $outfh, 1, "$readcmd did not return all 1's\n"); + helper::print_and_exit($cmdfh, $outfh, 1, "$readcmd did not return all $digit 's\n"); + } + + $offset += 1024; + $digit++; + if ($digit == 10) { + $digit = 0; + } } # Now fill the buffer with 0s - $cmdstr = '$buf = CALL setbuf 1 '."$bufsize ".'$buf'."\n"; + $cmdstr = '$buf = CALL setbuf 0 '."$bufsize ".'$buf'." 0\n"; helper::send_cmd($cmdfh, $outfh, "setbuf", $cmdstr); } + +sub fill_buf +{ + my ($cmdfh, $outfh) = @_; + my $i; + my $digit=0; + my $cmdstr; + my $offset = 0; + + # Fill up the buffer with alternating digits + # from 0-9 + + for ($i=0; $i < 64 ; $i++) { + my $cmdstr = "CALL setbuf $digit 1024 ".'$buf'." $offset\n"; + helper::send_cmd($cmdfh, $outfh, "setbuf", $cmdstr); + $offset += 1024; + $digit++; + if ($digit == 10) { + $digit = 0; + } + } +} + sub do_rwcalls { my ($cmdfh, $outfh, $bufsize) = @_; my $IOID_FAIL = 0; my $NUMVECS = 8; + # Initilize buffer + fill_buf($cmdfh, $outfh); + # write 64K bytes at pos 0 my $cmdstr = 'CALL write $fd $buf '."$bufsize\n"; helper::send_cmd($cmdfh, $outfh, "write", $cmdstr); verify_result($cmdfh, $outfh, "write", $bufsize, "!="); + # Initilize buffer + fill_buf($cmdfh, $outfh); + # iwrite 64K bytes at pos 64K $cmdstr = '$id1 = CALL iwrite $fd $buf '."$bufsize\n"; helper::send_cmd($cmdfh, $outfh, "iwrite", $cmdstr); @@ -167,23 +209,35 @@ sub do_rwcalls my $iovcnt = 0; my $iovname = set_iovecs($cmdfh, $outfh, $iovcnt); + # Initilize buffer + fill_buf($cmdfh, $outfh); + # writev 64K bytes using 8 iovecs at pos 128K $cmdstr = 'CALL writev $fd $'."$iovname $NUMVECS\n"; helper::send_cmd($cmdfh, $outfh, "writev", $cmdstr); verify_result($cmdfh, $outfh, "writev", $bufsize, "!="); + # Initilize buffer + fill_buf($cmdfh, $outfh); + # iwritev 64K bytes using 8 iovecs at pos 192K $cmdstr = '$id2 = CALL iwritev $fd $'."$iovname $NUMVECS\n"; helper::send_cmd($cmdfh, $outfh, "iwritev", $cmdstr); verify_result($cmdfh, $outfh, "iwritev", $IOID_FAIL, "=="); do_iowait($cmdfh, $outfh, '$id2', "iwritev", $bufsize); + # Initilize buffer + fill_buf($cmdfh, $outfh); + # pwrite 64K bytes starting at pos 256K my $offset = 256 * 1024; $cmdstr = 'CALL pwrite $fd $buf '."$bufsize $offset\n"; helper::send_cmd($cmdfh, $outfh, "pwrite", $cmdstr); verify_result($cmdfh, $outfh, "pwrite", $bufsize, "!="); + # Initilize buffer + fill_buf($cmdfh, $outfh); + # ipwrite 64K bytes starting at pos 320K $offset = 320 * 1024; $cmdstr = '$id3 = CALL ipwrite $fd $buf '."$bufsize $offset\n"; @@ -193,12 +247,18 @@ sub do_rwcalls $iovcnt++; + # Initilize buffer + fill_buf($cmdfh, $outfh); + # pwritev using 8 8K buffers at offset 384 $offset = 384 * 1024; $cmdstr = 'CALL pwritev $fd $'."$iovname $NUMVECS $offset\n"; helper::send_cmd($cmdfh, $outfh, "pwritev", $cmdstr); verify_result($cmdfh, $outfh, "pwritev", $bufsize, "!="); + # Initilize buffer + fill_buf($cmdfh, $outfh); + # ipwritev using 8 8k buffers at offset 448 $offset = 448 * 1024; $cmdstr = '$id4 = CALL ipwritev $fd $'."$iovname $NUMVECS $offset\n"; @@ -212,6 +272,9 @@ sub do_rwcalls $iovcnt++; + # Initilize buffer + fill_buf($cmdfh, $outfh); + # Call writex using 8 8k buffers at offset 512 $cmdstr = 'CALL writex $fd $'."$iovname $NUMVECS ".'$'."$xtvname 2\n"; helper::send_cmd($cmdfh, $outfh, "writex", $cmdstr); @@ -225,6 +288,9 @@ sub do_rwcalls $iovcnt++; + # Initilize buffer + fill_buf($cmdfh, $outfh); + $cmdstr = '$id5 = CALL iwritex $fd $'."$iovname $NUMVECS ".'$'."$xtvname 2\n"; helper::send_cmd($cmdfh, $outfh, "iwritex", $cmdstr); verify_result($cmdfh, $outfh, "iwritex", $IOID_FAIL, "=="); @@ -238,7 +304,7 @@ sub do_rwcalls helper::verify_cmd($cmdfh, $outfh, "sizeof xtvec"); # fill the buffer with 0's - $cmdstr = '$buf = CALL setbuf 0 '."$bufsize ".'$buf'."\n"; + $cmdstr = '$buf = CALL setbuf 0 '."$bufsize ".'$buf'." 0\n"; helper::send_cmd($cmdfh, $outfh, "setbuf", $cmdstr); # read 64K bytes from pos 0 @@ -332,6 +398,68 @@ sub do_rwcalls } +sub check_array +{ + my ($exp_digit, @arr) = @_; + my $exp_char; + my $pos = 0; + + if ($exp_digit == 0) { + $exp_char = "\\0"; + } elsif ($exp_digit < 7) { + $exp_char = "00".$exp_digit; + } elsif ($exp_digit == 7) { + $exp_char = "\\a"; + } elsif ($exp_digit == 8) { + $exp_char = "\\b"; + } elsif ($exp_digit == 9) { + $exp_char = "\\t"; + } else { + print STDERR "Invalid expected digit $exp_digit\n"; + return(1); + } + + foreach my $str (@arr) { + if ($str ne $exp_char) { + print STDERR "At pos $pos got digit $str instead of $exp_char\n"; + return(1); + } + $pos++; + } + + return(0); +} + +# Perform an od on the output and verify that the output makes +# sense +sub od_verify +{ + my ($cmdfh, $outfh, $file) = @_; + my $exp_digit = 0; + + # Do an od in order to verify the contents of the file + system("od -c $file > tmp.out.$$"); + open(ODFILE, "<tmp.out.$$") || + helper::print_and_exit($cmdfh, $outfh, 1, "Unable to open tmp.out.$$\n"); + + while (<ODFILE>) { + if (/^\*/) { + # Do nothing... + } else { + my ($lineno, @nums) = split($_); + if (check_array($exp_digit, @nums) != 0) { + helper::print_and_exit($cmdfh, $outfh, 1, "At line $lineno, got unexpected result\n"); + } + if ($exp_digit < 9) { + $exp_digit ++; + } else { + $exp_digit = 0; + } + } + } + + close(ODFILE); +} sub process_cmd { @@ -375,30 +503,17 @@ sub process_cmd $cmdstr = '$buf = ALLOC '."$bufsize\n"; helper::send_cmd($cmdfh, $outfh, "ALLOC", $cmdstr); - # Fill it with 1's - $cmdstr = '$buf = CALL setbuf 1 '."$bufsize ".'$buf'."\n"; - helper::send_cmd($cmdfh, $outfh, "setbuf", $cmdstr); do_rwcalls($cmdfh, $outfh, $bufsize); - # Do an od and make sure that only 1's are in the file - - # This is what it should return: - my $cmpstr = "0000000 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001\n"; - $cmpstr .= "*\n"; - $cmpstr .= "2400000"; - - my $res = `od -c $file`; - chop($res); - if ($cmpstr ne $res) { - helper::print_and_exit($cmdfh, $outfh, 1, "od results indicate a ch other than 1\n"); - } - # Clean up $cmdstr = 'CALL close $fd'."\n"; helper::send_cmd($cmdfh, $outfh, "close", $cmdstr); - system("rm -f $file"); + # Verify it worked + od_verify($cmdfh, $outfh, $file); + + system("rm -f $file"); helper::print_and_exit($cmdfh, $outfh, 0, "rw test successful\n"); } |
From: Lee W. <lw...@us...> - 2004-03-01 19:22:50
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11457 Modified Files: ioctx.c Log Message: Can't use returned character count in the overflow checks. That content is used later to adjust current xtvec and iovec. Use a temproary variable now. Index: ioctx.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctx.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- ioctx.c 26 Feb 2004 17:35:43 -0000 1.10 +++ ioctx.c 1 Mar 2004 19:03:46 -0000 1.11 @@ -338,7 +338,7 @@ _sysio_enumerate_extents(const struct in void *), void *arg) { - ssize_t acc, cc; + ssize_t acc, tmp, cc; struct iovec iovec; struct intnl_xtvec xtvec; const struct iovec *start; @@ -382,12 +382,12 @@ _sysio_enumerate_extents(const struct in return acc; return cc; } - cc += acc; - if (acc && cc <= acc) - abort(); /* paranoia */ - acc = cc; iovec.iov_base = (char *)iovec.iov_base + cc; iovec.iov_len -= cc; + tmp = cc + acc; + if (acc && tmp <= acc) + abort(); /* paranoia */ + acc = tmp; } else { start = iov; n = xtvec.xtv_len; @@ -419,10 +419,10 @@ _sysio_enumerate_extents(const struct in return cc; } remain -= cc; - cc += acc; - if (acc && cc <= acc) + tmp = cc + acc; + if (acc && tmp <= acc) abort(); /* paranoia */ - acc = cc; + acc = tmp; if (remain) return acc; /* short */ } |
From: Lee W. <lw...@us...> - 2004-02-28 14:28:22
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13913/src Modified Files: file.c Log Message: Helps when I change *all* the variable names... Index: file.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/file.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -b -B -p -r1.9 -r1.10 --- file.c 27 Feb 2004 20:52:04 -0000 1.9 +++ file.c 28 Feb 2004 14:10:58 -0000 1.10 @@ -275,7 +275,7 @@ _sysio_fd_dup2(int oldfd, int newfd) fd = _sysio_fd_set(fil, newfd); if (fd >= 0) F_REF(fil); - return err; + return fd; } int |
From: Lee W. <lw...@us...> - 2004-02-27 21:08:52
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9560 Modified Files: file.c Log Message: Complimetnary to the last change, change variable named `err' to `fd'. Index: file.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/file.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -w -b -B -p -r1.8 -r1.9 --- file.c 27 Feb 2004 19:21:50 -0000 1.8 +++ file.c 27 Feb 2004 20:52:04 -0000 1.9 @@ -263,7 +263,7 @@ int _sysio_fd_dup2(int oldfd, int newfd) { struct file *fil; - int err; + int fd; if (oldfd == newfd) return 0; @@ -272,8 +272,8 @@ _sysio_fd_dup2(int oldfd, int newfd) if (!fil) return -EBADF; - err = _sysio_fd_set(fil, newfd); - if (err >= 0) + fd = _sysio_fd_set(fil, newfd); + if (fd >= 0) F_REF(fil); return err; } |
From: Ruth K. <rk...@us...> - 2004-02-27 19:38:34
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21780 Modified Files: file.c Log Message: want to ref the file if a valid fd was returned, otherwise subsequent close of dup'd fd wipes out the original fd's file struct Index: file.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/file.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -b -B -p -r1.7 -r1.8 --- file.c 6 Feb 2004 20:07:30 -0000 1.7 +++ file.c 27 Feb 2004 19:21:50 -0000 1.8 @@ -273,7 +273,7 @@ _sysio_fd_dup2(int oldfd, int newfd) return -EBADF; err = _sysio_fd_set(fil, newfd); - if (!err) + if (err >= 0) F_REF(fil); return err; } |
From: Lee W. <lw...@us...> - 2004-02-26 17:51:38
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12020/src Modified Files: ioctx.c Log Message: Fixed problems in _sysio_enumerate_iovec. It was not applying the limit correctly. It was not moving through the iovec list -- Just using the first entry count times. Index: ioctx.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctx.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -b -B -p -r1.9 -r1.10 --- ioctx.c 24 Feb 2004 14:58:26 -0000 1.9 +++ ioctx.c 26 Feb 2004 17:35:43 -0000 1.10 @@ -450,8 +450,8 @@ _sysio_enumerate_iovec(const struct iove assert(limit >= 0); acc = 0; n = limit; - for (indx = 0; indx < count; indx++) { - if (limit < 0 || iov[indx].iov_len < n) { + for (indx = 0; n && indx < count; indx++) { + if (iov[indx].iov_len < n) { cc = (ssize_t )iov[indx].iov_len; if (cc < 0) return -EINVAL; @@ -474,8 +474,8 @@ _sysio_enumerate_iovec(const struct iove continue; } n = - limit < 0 || iov[indx].iov_len < (size_t )limit - ? iov[indx].iov_len + iov->iov_len < (size_t )limit + ? iov->iov_len : (size_t )limit; cc = (*f)(iov->iov_base, n, off, arg); if (cc <= 0) { @@ -483,12 +483,13 @@ _sysio_enumerate_iovec(const struct iove return acc; return cc; } + limit -= cc; remain = iov->iov_len - cc; cc += acc; if (acc && cc <= acc) abort(); /* bad driver! */ acc = cc; - if (remain) + if (remain || !limit) break; /* short/limited read */ iov++; } while (--count); |
From: Lee W. <lw...@us...> - 2004-02-25 16:39:06
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23863/src Modified Files: chmod.c init.c open.c Log Message: All mode bit masks were incorrect. Need to preserve ISUID, ISGID, ISVTX bits. Index: chmod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chmod.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -w -b -B -p -r1.6 -r1.7 --- chmod.c 26 Jan 2004 16:34:54 -0000 1.6 +++ chmod.c 25 Feb 2004 16:23:59 -0000 1.7 @@ -62,7 +62,7 @@ do_chmod(struct pnode *pno, struct inode unsigned mask; (void )memset(&stbuf, 0, sizeof(struct intnl_stat)); - stbuf.st_mode = mode & 0777; + stbuf.st_mode = mode & 07777; mask = SETATTR_MODE; err = _sysio_setattr(pno, ino, mask, &stbuf); return err; Index: init.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/init.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -b -B -p -r1.7 -r1.8 --- init.c 14 Feb 2004 19:42:59 -0000 1.7 +++ init.c 25 Feb 2004 16:24:00 -0000 1.8 @@ -300,7 +300,7 @@ do_creat(char *args) if (*cp || perms < 0 || (perms == LONG_MAX && errno == ERANGE) || - ((unsigned)perms & ~0777)) + ((unsigned)perms & ~07777)) return -EINVAL; if (v[3].value) { owner = strtol(v[3].value, (char **)&cp, 0); @@ -532,7 +532,7 @@ do_chmd(char *args) if (*cp || perms < 0 || (perms == LONG_MAX && errno == ERANGE) || - ((unsigned)perms & ~0777)) + ((unsigned)perms & ~07777)) return -EINVAL; (void )memset(&stbuf, 0, sizeof(stbuf)); stbuf.st_mode = (mode_t)perms; Index: open.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/open.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -w -b -B -p -r1.13 -r1.14 --- open.c 26 Jan 2004 16:34:54 -0000 1.13 +++ open.c 25 Feb 2004 16:24:00 -0000 1.14 @@ -157,7 +157,7 @@ open(const char *path, int flags, ...) va_arg(ap, int); #endif va_end(ap); - mode &= ~_sysio_umask; /* apply umask */ + mode &= ~_sysio_umask & 0777; /* apply umask */ if (flags & O_EXCL) { /* |
From: Lee W. <lw...@us...> - 2004-02-25 16:39:06
|
Update of /cvsroot/libsysio/libsysio/drivers/yod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23863/drivers/yod Modified Files: fs_yod.c Log Message: All mode bit masks were incorrect. Need to preserve ISUID, ISGID, ISVTX bits. Index: fs_yod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/yod/fs_yod.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- fs_yod.c 15 Jan 2004 20:27:40 -0000 1.10 +++ fs_yod.c 25 Feb 2004 16:23:59 -0000 1.11 @@ -689,7 +689,7 @@ yod_inop_setattr(struct pnode *pno, /* * Alter permissions attribute. */ - mode = stbuf->st_mode & 0777; + mode = stbuf->st_mode & 07777; err = chmod_yod(path, mode); } if (err) @@ -734,7 +734,7 @@ yod_inop_setattr(struct pnode *pno, : (gid_t )-1); } if (mask & SETATTR_MODE) { - chmod_yod(path, st.st_mode & 0777); + chmod_yod(path, st.st_mode & 07777); } out: if (path) |
From: Lee W. <lw...@us...> - 2004-02-25 16:39:04
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23863/drivers/native Modified Files: fs_native.c Log Message: All mode bit masks were incorrect. Need to preserve ISUID, ISGID, ISVTX bits. Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -w -b -B -p -r1.32 -r1.33 --- fs_native.c 14 Feb 2004 19:42:58 -0000 1.32 +++ fs_native.c 25 Feb 2004 16:23:58 -0000 1.33 @@ -739,7 +739,7 @@ native_inop_setattr(struct pnode *pno, /* * Alter permissions attribute. */ - mode = stbuf->st_mode & 0777; + mode = stbuf->st_mode & 07777; err = fd < 0 ? syscall(SYS_chmod, path, mode) @@ -837,8 +837,8 @@ native_inop_setattr(struct pnode *pno, } if (mask & SETATTR_MODE) { fd < 0 - ? syscall(SYS_chmod, path, st.st_mode & 0777) - : syscall(SYS_fchmod, fd, st.st_mode & 0777); + ? syscall(SYS_chmod, path, st.st_mode & 07777) + : syscall(SYS_fchmod, fd, st.st_mode & 07777); } out: if (path) |
From: Lee W. <lw...@us...> - 2004-02-25 16:39:04
|
Update of /cvsroot/libsysio/libsysio/drivers/incore In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23863/drivers/incore Modified Files: fs_incore.c Log Message: All mode bit masks were incorrect. Need to preserve ISUID, ISGID, ISVTX bits. Index: fs_incore.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/incore/fs_incore.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -w -b -B -p -r1.15 -r1.16 --- fs_incore.c 24 Feb 2004 14:58:26 -0000 1.15 +++ fs_incore.c 25 Feb 2004 16:23:58 -0000 1.16 @@ -545,11 +545,11 @@ _sysio_incore_fsswop_mount(const char *s * <permissions>+<owner>+<group> */ ul = strtoul(source, &cp, 0); - mode = (mode_t )ul & 0777; + mode = (mode_t )ul & 07777; if (*cp != '+' || (ul == ULONG_MAX && errno == ERANGE) || (unsigned long)mode != ul || - mode > 0777) + mode > 07777) return -EINVAL; source = cp; l = strtol(source, &cp, 0); |
From: Lee W. <lw...@us...> - 2004-02-25 16:00:35
|
Update of /cvsroot/libsysio/libsysio/misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15618 Modified Files: init-env.sh Log Message: Changed permissions for the automount-directory in /mnt. Need the sticky bit or namei won't even try. Index: init-env.sh =================================================================== RCS file: /cvsroot/libsysio/libsysio/misc/init-env.sh,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -b -B -p -r1.2 -r1.3 --- init-env.sh 14 Feb 2004 19:42:58 -0000 1.2 +++ init-env.sh 25 Feb 2004 15:45:31 -0000 1.3 @@ -16,7 +16,7 @@ if [ "x${SYSIO_AUTOMOUNT}" == "xyes" ]; # _extras=" \ {mnt, dev=\"incore:0755+0+0\",dir=\"/mnt\",fl=2} \ - {creat, ft=dir,nm=\"/mnt/home\",pm=0755,ow=0,gr=0} \ + {creat, ft=dir,nm=\"/mnt/home\",pm=01755,ow=0,gr=0} \ {creat, ft=file,nm=\"/mnt/home/.mount\",pm=0600, \ str=\"native:/usr/home\"} \ " |
From: Sonja T. <so...@us...> - 2004-02-24 16:01:04
|
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10559 Modified Files: sysio_stubs.c sysio_tests.c test_driver.c Log Message: Code cleanup. Making it C99 compliant Index: sysio_stubs.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/sysio_stubs.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -b -B -p -r1.9 -r1.10 --- sysio_stubs.c 14 Feb 2004 19:42:59 -0000 1.9 +++ sysio_stubs.c 24 Feb 2004 15:46:33 -0000 1.10 @@ -116,7 +116,7 @@ int test_do_fillbuff(int argc, char **ar } buf = (char *)(buflist[index]->buf)+offset; - DBG(4, fprintf(outfp, "Buffer start is at %p\n", buflist[index])); + DBG(4, fprintf(outfp, "Buffer start is at %p\n", (void *)buflist[index])); typestr = argv[1]; size = get_obj(argv[2]); @@ -242,7 +242,7 @@ int test_do_printbuf(int argc, char **ar index = mobj->obj; buf_st = buflist[index]; - DBG(2, fprintf(outfp, "buf_st is %p:\n", buf_st)); + DBG(2, fprintf(outfp, "buf_st is %p:\n", (void *)buf_st)); buf = buf_st->buf; DBG(2, fprintf(outfp, "buf %s:\n", argv[0])); if (mobj->type == STR) { @@ -337,7 +337,7 @@ int test_do_list(int argc, char **argv) return INVALID_ARGS; } - DBG(5,fprintf(outfp, "In test_do_list with args %p\n", argv)); + DBG(5,fprintf(outfp, "In test_do_list with args %p\n", (void *)argv)); if (!argv) { buf = getcwd(NULL, 0); DBG(4, fprintf(outfp, "Calling list with dir of %s\n", buf)); @@ -552,7 +552,7 @@ int get_buffer(int argc, char **argv) buf->len = size; buflist[next] = buf; DBG(3, fprintf(outfp, "Your buffer (%p) (%p) is at index %d\n", - buf, buf->buf, next)); + (void *)buf, buf->buf, next)); next++; last_type = PTR; @@ -2418,7 +2418,7 @@ int test_do_writex(int argc, char **argv } DBG(3, fprintf(outfp, "writex(fd: %d, iov: %p iov_cnt: %d, xtv: %p, xtv_cnt: %d\n", - fd, iov, iov_count, xtv, xtv_count)); + fd, (void *)iov, iov_count, (void *)xtv, xtv_count)); last_ret_val = writex(fd, iov, iov_count, xtv, xtv_count); if (last_ret_val < 0) @@ -2484,7 +2484,7 @@ int test_do_iwritex(int argc, char **arg } DBG(3, fprintf(outfp, "iwritex(fd: %d, iov: %p iov_cnt: %d, xtv: %p, xtv_cnt: %d\n", - fd, iov, iov_count, xtv, xtv_count)); + fd, (void *)iov, iov_count, (void *)xtv, xtv_count)); last_ret_val = (int) iwritex(fd, iov, iov_count, xtv, xtv_count); if (last_ret_val < 0) @@ -2550,7 +2550,7 @@ int test_do_readx(int argc, char **argv) } DBG(3, fprintf(outfp, "readx(fd: %d, iov: %p iov_cnt: %d, xtv: %p, xtv_cnt: %d\n", - fd, iov, iov_count, xtv, xtv_count)); + fd, (void *)iov, iov_count, (void *)xtv, xtv_count)); last_ret_val = readx(fd, iov, iov_count, xtv, xtv_count); if (last_ret_val < 0) @@ -2616,7 +2616,7 @@ int test_do_ireadx(int argc, char **argv } DBG(3, fprintf(outfp, "ireadx(fd: %d, iov: %p iov_cnt: %d, xtv: %p, xtv_cnt: %d\n", - fd, iov, iov_count, xtv, xtv_count)); + fd, (void *)iov, iov_count, (void *)xtv, xtv_count)); last_ret_val = (int) ireadx(fd, iov, iov_count, xtv, xtv_count); if (last_ret_val < 0) @@ -2665,7 +2665,7 @@ int do_checkbuf(int argc, char **argv) memset((void *)ref_buf, val, size); last_ret_val =0; - for (i=0; i < size/sizeof(int); i++) { + for (i=0; (unsigned)i < size/sizeof(int); i++) { if (buf[i] != ref_buf[i]) { DBG(2, fprintf(stderr, "At pos %d I found a 0x%08x instead of 0x%08x\n", i, buf[i], ref_buf[i])); Index: sysio_tests.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/sysio_tests.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -b -B -p -r1.5 -r1.6 --- sysio_tests.c 14 Feb 2004 19:43:00 -0000 1.5 +++ sysio_tests.c 24 Feb 2004 15:46:33 -0000 1.6 @@ -108,7 +108,7 @@ int sysio_list(char *path) sprintf(output, "%s\n", dp->d_name); cc -= dp->d_reclen; - dp = (void *)dp + dp->d_reclen; + dp = (struct dirent *)((char *)dp + dp->d_reclen); numfiles++; } printf("Out of inner loop\n"); @@ -730,7 +730,7 @@ int sysio_getdirentries(int fd, char *bu dp->d_reclen, (char )dp->d_type)); err -= dp->d_reclen; - dp = (void *)dp + dp->d_reclen; + dp = (struct dirent *)((char *)dp + dp->d_reclen); } my_errno = errno; Index: test_driver.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_driver.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -b -B -p -r1.7 -r1.8 --- test_driver.c 14 Feb 2004 19:43:00 -0000 1.7 +++ test_driver.c 24 Feb 2004 15:46:34 -0000 1.8 @@ -904,7 +904,7 @@ int get_constant_val(char **str_ptr, int buf_ptr[j] = '\0'; DBG(3, fprintf(outfp, "Your buffer (%p) (%p) is at index %d\n", - buf, buf->buf, next)); + (void *)buf, buf->buf, next)); next++; last_type = PTR; |