libsysio-commit Mailing List for libsysio (Page 18)
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...> - 2005-08-04 19:48:58
|
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29988 Modified Files: test_list.c Log Message: Fixed to reflect the new, proper, operation of getdirentries. Previously, we were counting on the base pointer to getdirentries to return to zero at EOF. That was erroneous. The only EOF check is the number of bytes returned going to zero. Aslo, fixed a bug. Hadn't wrapped the close. Index: test_list.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_list.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- test_list.c 4 Feb 2005 00:29:26 -0000 1.10 +++ test_list.c 4 Aug 2005 19:48:49 -0000 1.11 @@ -166,7 +166,6 @@ listit(const char *path) goto out; } - base = 0; while ((cc = SYSIO_INTERFACE_NAME(getdirentries)(fd, (char *)buf, n, @@ -180,8 +179,6 @@ listit(const char *path) cc -= dp->d_reclen; dp = (struct dirent *)((char *)dp + dp->d_reclen); } - if (!base) - break; } out: @@ -192,7 +189,7 @@ out: { int oerrno = errno; - if (close(fd) != 0) { + if (SYSIO_INTERFACE_NAME(close)(fd) != 0) { perror(path); if (cc < 0) errno = oerrno; |
From: Lee W. <lw...@us...> - 2005-08-03 13:46:26
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26427 Modified Files: open.c Log Message: The CREAT intent flag was only being set if the caller specified O_EXCL. Changed so that it is set withonly O_CREAT specified. Index: open.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/open.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -w -b -B -p -r1.24 -r1.25 --- open.c 25 Jan 2005 00:37:14 -0000 1.24 +++ open.c 3 Aug 2005 13:46:10 -0000 1.25 @@ -162,14 +162,8 @@ SYSIO_INTERFACE_NAME(open)(const char *p #endif va_end(ap); mode &= ~(_sysio_umask & 0777) | 07000; /* apply umask */ - - if (flags & O_EXCL) { - /* - * Tell others we intend to create this file. - */ intent.int_opmask |= INT_CREAT; } - } #ifdef O_NOFOLLOW if (flags & O_NOFOLLOW) ndflags |= ND_NOFOLLOW; |
From: Lee W. <lw...@us...> - 2005-08-02 21:57:24
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv468/src Modified Files: lseek.c Log Message: Changes to support better detection of overflow in 32/64 mixed compiles. Index: lseek.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/lseek.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -w -b -B -p -r1.25 -r1.26 --- lseek.c 14 Oct 2004 14:59:29 -0000 1.25 +++ lseek.c 2 Aug 2005 21:57:09 -0000 1.26 @@ -46,6 +46,7 @@ #include <assert.h> #include <sys/types.h> #include <sys/stat.h> +#include <fcntl.h> #include <sys/queue.h> #include "sysio.h" @@ -54,17 +55,31 @@ #include "sysio-symbols.h" +/* + * Test whether large file support on this file. + */ +#ifdef O_LARGEFILE +#define _SEEK_MAX_TEST(fil) \ + ((fil)->f_flags & O_LARGEFILE) +#else +#define _SEEK_MAX_TEST(fil) \ + (1) +#endif +/* + * Return max seek value for this file. + */ +#define _SEEK_MAX(fil) \ + (_SEEK_MAX_TEST(fil) ? _SYSIO_OFF_T_MAX : LONG_MAX) + static _SYSIO_OFF_T -_sysio_lseek(int fd, _SYSIO_OFF_T offset, int whence) +_sysio_lseek(struct file *fil, + _SYSIO_OFF_T offset, + int whence, + _SYSIO_OFF_T max) { - struct file *fil; _SYSIO_OFF_T off, pos; struct intnl_stat stbuf; - fil = _sysio_fd_find(fd); - if (!fil) - return -EBADF; - off = -1; switch (whence) { @@ -99,14 +114,8 @@ _sysio_lseek(int fd, _SYSIO_OFF_T offset pos = off + offset; if ((offset < 0 && -offset > off) || (offset > 0 && 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) + if (pos >= max) return -EOVERFLOW; -#endif pos = (fil->f_ino->i_ops.inop_pos)(fil->f_ino, pos); if (pos < 0) return pos; @@ -120,17 +129,18 @@ _sysio_lseek(int fd, _SYSIO_OFF_T offset extern off64_t SYSIO_INTERFACE_NAME(lseek64)(int fd, off64_t offset, int whence) { - _SYSIO_OFF_T off; - off_t rtn; + struct file *fil; + off64_t off; SYSIO_INTERFACE_DISPLAY_BLOCK; SYSIO_INTERFACE_ENTER; - off = _sysio_lseek(fd, offset, whence); - if (off < 0) - SYSIO_INTERFACE_RETURN((off_t )-1, (int )off); - rtn = (off64_t )off; - assert(rtn == off); - SYSIO_INTERFACE_RETURN(rtn, 0); + fil = _sysio_fd_find(fd); + if (!fil) + SYSIO_INTERFACE_RETURN((off64_t )-1, -EBADF); + off = _sysio_lseek(fil, offset, whence, _SEEK_MAX(fil)); + SYSIO_INTERFACE_RETURN(off < 0 ? (off64_t )-1 : off, + off < 0 ? (int )off : 0); + } #ifdef __GLIBC__ #undef __lseek64 @@ -149,12 +159,16 @@ sysio_sym_weak_alias(SYSIO_INTERFACE_NAM extern off_t SYSIO_INTERFACE_NAME(lseek)(int fd, off_t offset, int whence) { + struct file *fil; _SYSIO_OFF_T off; off_t rtn; SYSIO_INTERFACE_DISPLAY_BLOCK; SYSIO_INTERFACE_ENTER; - off = _sysio_lseek(fd, offset, whence); + fil = _sysio_fd_find(fd); + if (!fil) + SYSIO_INTERFACE_RETURN((off_t )-1, -EBADF); + off = _sysio_lseek(fil, offset, whence, LONG_MAX); if (off < 0) SYSIO_INTERFACE_RETURN((off_t )-1, (int )off); rtn = (off_t )off; @@ -177,6 +191,7 @@ SYSIO_INTERFACE_NAME(llseek)(unsigned in loff_t *result __IS_UNUSED, unsigned int whence __IS_UNUSED) { + struct file *fil; loff_t off; SYSIO_INTERFACE_DISPLAY_BLOCK; @@ -184,6 +199,9 @@ SYSIO_INTERFACE_NAME(llseek)(unsigned in * This is just plain goofy. */ SYSIO_INTERFACE_ENTER; + fil = _sysio_fd_find(fd); + if (!fil) + SYSIO_INTERFACE_RETURN(-1, -EBADF); #if !_LARGEFILE64_SOURCE if (offset_high) { /* @@ -197,7 +215,7 @@ SYSIO_INTERFACE_NAME(llseek)(unsigned in off <<= 32; off |= offset_low; #endif - off = _sysio_lseek(fd, off, whence); + off = _sysio_lseek(fil, off, whence, _SEEK_MAX(fil)); if (off < 0) SYSIO_INTERFACE_RETURN((off_t )-1, (int )off); *result = off; |
From: Lee W. <lw...@us...> - 2005-08-02 20:25:34
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8877/src Modified Files: getdirentries.c Log Message: Simplified and, hopefully, a bug corrected. Both Jim Schutt, at Sandia, and Oleg Drokin, at CFS, reported that getdirentries fails with Lustre as the base pointer is being reset improperly. The base pointer is now advanced as the directory entries are processed by giving it the value from the d_off field prior to advancing. Index: getdirentries.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/getdirentries.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -w -b -B -p -r1.18 -r1.19 --- getdirentries.c 21 Sep 2004 16:18:30 -0000 1.18 +++ getdirentries.c 2 Aug 2005 20:25:25 -0000 1.19 @@ -85,30 +85,35 @@ #endif static ssize_t +filldirents(int fd, char *buf, size_t nbytes, _SYSIO_OFF_T * __restrict basep) +{ + struct file *fil; + + fil = _sysio_fd_find(fd); + if (!(fil && fil->f_ino)) + return -EBADF; + + if (!S_ISDIR(fil->f_ino->i_stbuf.st_mode)) + return -ENOTDIR; + + return (*fil->f_ino->i_ops.inop_getdirentries)(fil->f_ino, + buf, nbytes, + basep); +} + +static ssize_t PREPEND(_, SYSIO_INTERFACE_NAME(getdirentries64))(int fd, char *buf, size_t nbytes, _SYSIO_OFF_T * __restrict basep) { - struct file *fil; ssize_t cc; SYSIO_INTERFACE_DISPLAY_BLOCK; SYSIO_INTERFACE_ENTER; - fil = _sysio_fd_find(fd); - if (!(fil && fil->f_ino)) - SYSIO_INTERFACE_RETURN(-1, -EBADF); - - if (!S_ISDIR(fil->f_ino->i_stbuf.st_mode)) - SYSIO_INTERFACE_RETURN(-1, -ENOTDIR); - - cc = - (*fil->f_ino->i_ops.inop_getdirentries)(fil->f_ino, - buf, - nbytes, - basep); + cc = filldirents(fd, buf, nbytes, basep); SYSIO_INTERFACE_RETURN(cc < 0 ? -1 : cc, cc < 0 ? (int )cc : 0); } @@ -137,6 +142,17 @@ sysio_sym_strong_alias(PREPEND(_, SYSIO_ ((((n) + (boundary) - 1 ) / (boundary)) * (boundary)) #endif +#define _dbaselen ((size_t )&((struct dirent *)0)->d_name[0]) + +#ifdef __GLIBC__ +#define _dreclen(namlen) \ + ((_dbaselen + (namlen) + __alignof__ (struct dirent)) & \ + ~(__alignof__ (struct dirent) - 1)) +#else /* !defined(__GLIBC__) */ +#define _dreclen(namlen) \ + _rndup(_dbaselen + (namlen) + 1, sizeof(int)) +#endif + #ifndef BSD ssize_t SYSIO_INTERFACE_NAME(getdirentries)(int fd, @@ -151,144 +167,78 @@ SYSIO_INTERFACE_NAME(getdirentries)(int long * __restrict basep) #endif { - size_t inbytes; - void *ibuf; - _SYSIO_OFF_T ibase; - ssize_t cc; - struct dirent *dp, *nxtdp; -#if defined(BSD) - int off; -#endif - struct intnl_dirent *od64p, *d64p; - size_t n; - size_t reclen; + _SYSIO_OFF_T b; + ssize_t cc, count; + struct dirent64 *d64p, d64; + struct dirent *dp; + size_t n, reclen; + void *p; char *cp; SYSIO_INTERFACE_DISPLAY_BLOCK; -#define _dbaselen ((size_t )&((struct dirent *)0)->d_name[0]) - -#ifdef __GLIBC__ -#define _dreclen(namlen) \ - ((_dbaselen + (namlen) + __alignof__ (struct dirent)) & \ - ~(__alignof__ (struct dirent) - 1)) -#else /* !defined(__GLIBC__) */ -#define _dreclen(namlen) \ - _rndup(_dbaselen + (namlen) + 1, sizeof(int)) -#endif - -#if defined(__GLIBC__) -#define _fast_alloc(n) alloca(n) -#define _fast_free(p) -#else /* !defined(__GLIBC__) */ -#define _fast_alloc(n) malloc(n) -#define _fast_free(p) free(p) -#endif - SYSIO_INTERFACE_ENTER; -#if defined(BSD) - if (nbytes < 0) - SYSIO_INTERFACE_RETURN(-1, -EINVAL); -#endif - inbytes = nbytes; - if (inbytes > 8 * 1024) { + b = *basep; + count = cc = filldirents(fd, buf, nbytes, &b); + d64p = (void *)buf; + dp = (void *)buf; + reclen = 0; + while (cc > 0) { + n = _namlen(d64p); + reclen = _dreclen(n); + d64.d_ino = d64p->d_ino; + d64.d_off = d64p->d_off; + d64.d_type = d64p->d_type; + d64.d_reclen = d64p->d_reclen; /* - * Limit stack use. + * Copy name first. + */ + (void )memcpy(dp->d_name, d64p->d_name, n); + /* + * Then, the rest. + */ + dp->d_ino = d64.d_ino; + dp->d_off = d64.d_off; + if (dp->d_ino != d64.d_ino || + dp->d_off != d64.d_off) { + /* + * If conversion failure then we are done. + */ + if (cc == count) { + /* + * Couldn't process any entries. We return + * the error now. */ - inbytes = 8 * 1024; - } - ibuf = _fast_alloc(inbytes); - if (!ibuf) - SYSIO_INTERFACE_RETURN(-1, -ENOMEM); - - dp = (struct dirent *)buf; - - ibase = *basep; - cc = - PREPEND(_, SYSIO_INTERFACE_NAME(getdirentries64))(fd, - ibuf, - inbytes, - &ibase); - if (cc < 0) { - cc = -errno; - goto out; - } - *basep = (off_t )ibase; - if (sizeof(*basep) != sizeof(ibase) && *basep != ibase) { cc = -EOVERFLOW; - goto out; } - -#if defined(BSD) - off = *basep; -#endif - od64p = NULL; - d64p = ibuf; - for (;;) { - if (!cc) - break; -#ifdef HAVE_D_NAMLEN - n = d64p->d_namlen; -#else - n = strlen(d64p->d_name); -#endif - reclen = _dreclen(n); - if (reclen >= (unsigned )nbytes) - break; - dp->d_ino = (ino_t )d64p->d_ino; -#if !(defined(BSD)) - dp->d_off = (off_t )d64p->d_off; -#endif - if ((sizeof(dp->d_ino) != sizeof(d64p->d_ino) && - dp->d_ino != d64p->d_ino) - || -#if !(defined(BSD)) - (sizeof(dp->d_off) != sizeof(d64p->d_off) && - dp->d_off != d64p->d_off) -#else - (off + (int )reclen < off) -#endif - ) { - cc = -EOVERFLOW; break; } - dp->d_type = d64p->d_type; + *basep = dp->d_off; + dp->d_type = d64.d_type; dp->d_reclen = reclen; - nxtdp = (struct dirent *)((char *)dp + dp->d_reclen); - (void )memcpy(dp->d_name, d64p->d_name, n); - for (cp = dp->d_name + n; cp < (char *)nxtdp; *cp++ = '\0') - ; - cc -= d64p->d_reclen; - od64p = d64p; - d64p = (struct dirent64 *)((char *)d64p + d64p->d_reclen); - nbytes -= reclen; -#if defined(BSD) - off += reclen; + /* + * Fill the remainder with zeros. + */ + p = (char *)dp + dp->d_reclen; +#ifdef HAVE_D_NAMLEN + dp->d_namlen = n; #endif - dp = nxtdp; + cp = dp->d_name + n; + do { + *cp++ = 0; + } while (cp < (char *)p); + /* + * Advance. + */ + dp = p; + cc -= d64.d_reclen; + d64p = (struct dirent64 *)((char *)d64p + d64.d_reclen); } -out: - _fast_free(ibuf); - - if (dp == (struct dirent *)buf && cc < 0) - SYSIO_INTERFACE_RETURN(-1, (int )cc); + if (cc < 0) + SYSIO_INTERFACE_RETURN(-1, cc); cc = (char *)dp - buf; - if (cc) - *basep = -#if !(defined(BSD)) - od64p->d_off; -#else - off; -#endif SYSIO_INTERFACE_RETURN(cc, 0); - -#ifdef __GLIBC__ -#undef _fast_alloc -#undef _fast_free -#endif -#undef _dreclen -#undef _dbaselen } #else /* !defined(DIRENT64_IS_NATURAL) */ sysio_sym_strong_alias(PREPEND(_, SYSIO_INTERFACE_NAME(getdirentries64), |
From: Lee W. <lw...@us...> - 2005-06-16 21:22:11
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17018 Modified Files: ioctx.c Log Message: From Cray; the UPDACCT call was sending the ioctx ptr and not the number of bytes transferred, as it should. Fix from Cray applied. Index: ioctx.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctx.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -w -b -B -p -r1.23 -r1.24 --- ioctx.c 25 Feb 2005 00:01:06 -0000 1.23 +++ ioctx.c 16 Jun 2005 21:21:42 -0000 1.24 @@ -246,7 +246,7 @@ _sysio_ioctx_complete(struct ioctx *ioct /* update IO stats */ - _SYSIO_UPDACCT(ioctx->ioctx_write, ioctx); + _SYSIO_UPDACCT(ioctx->ioctx_write, ioctx->ioctx_cc); /* * Run the call-back queue. |
From: Lee W. <lw...@us...> - 2005-06-16 21:15:23
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13980/include Modified Files: file.h Log Message: Cease tracking the file opens by referencing the inode as well. F_INIT no longer takes the first reference. It must be done explicitly by the caller now. Index: file.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/file.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- file.h 27 Jul 2004 14:20:43 -0000 1.10 +++ file.h 16 Jun 2005 21:14:39 -0000 1.11 @@ -64,7 +64,6 @@ struct file { do { \ (fil)->f_ref++; \ assert((fil)->f_ref); \ - I_REF((fil)->f_ino); \ } while (0) /* @@ -79,7 +78,6 @@ struct file { ino = (fil)->f_ino; \ if (!(fil)->f_ref) \ _sysio_fgone(fil); \ - I_RELE(ino); \ } while (0) /* @@ -91,7 +89,7 @@ struct file { do { \ (fil)->f_ino = (ino); \ (fil)->f_pos = 0; \ - (fil)->f_ref = 1; \ + (fil)->f_ref = 0; \ (fil)->f_flags = (flags); \ } while (0) |
From: Lee W. <lw...@us...> - 2005-06-16 21:15:01
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13980/src Modified Files: file.c file_hack.c Log Message: Cease tracking the file opens by referencing the inode as well. F_INIT no longer takes the first reference. It must be done explicitly by the caller now. Index: file.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/file.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -w -b -B -p -r1.18 -r1.19 --- file.c 16 Jun 2005 21:01:14 -0000 1.18 +++ file.c 16 Jun 2005 21:14:40 -0000 1.19 @@ -75,7 +75,7 @@ _sysio_fnew(struct inode *ino, int flags return NULL; _SYSIO_FINIT(fil, ino, flags); - I_REF(ino); + F_REF(fil); return fil; } Index: file_hack.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/file_hack.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -w -b -B -p -r1.8 -r1.9 --- file_hack.c 16 Jun 2005 21:01:14 -0000 1.8 +++ file_hack.c 16 Jun 2005 21:14:52 -0000 1.9 @@ -106,7 +106,7 @@ _sysio_fnew(struct inode *ino, int flags return NULL; _SYSIO_FINIT(fil, ino, flags); - I_REF(ino); + F_REF(fil); return fil; } |
From: Lee W. <lw...@us...> - 2005-06-16 21:01:24
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5985 Modified Files: dup.c file.c file_hack.c Log Message: Some cases where oldfd < 0 were sneaking by. Catch it deep now to prevent that everywhere. Index: dup.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/dup.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -b -B -p -r1.11 -r1.12 --- dup.c 27 Jul 2004 15:00:43 -0000 1.11 +++ dup.c 16 Jun 2005 21:01:14 -0000 1.12 @@ -59,16 +59,6 @@ SYSIO_INTERFACE_NAME(dup2)(int oldfd, in SYSIO_INTERFACE_ENTER; if (newfd < 0) SYSIO_INTERFACE_RETURN(-1, -EBADF); - - if (oldfd == newfd) { - struct file *fil; - - fil = _sysio_fd_find(oldfd); - if (!(fil && fil->f_ino)) - SYSIO_INTERFACE_RETURN(-1, -EBADF); - SYSIO_INTERFACE_RETURN(newfd, 0); - } - fd = _sysio_fd_dup(oldfd, newfd, 1); SYSIO_INTERFACE_RETURN(fd < 0 ? -1 : fd, fd < 0 ? fd : 0); } Index: file.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/file.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -w -b -B -p -r1.17 -r1.18 --- file.c 21 Sep 2004 16:18:30 -0000 1.17 +++ file.c 16 Jun 2005 21:01:14 -0000 1.18 @@ -272,7 +272,7 @@ _sysio_fd_dup(int oldfd, int newfd, int struct file *fil; int fd; - if (oldfd == newfd) + if (oldfd == newfd && oldfd >= 0) return newfd; fil = _sysio_fd_find(oldfd); Index: file_hack.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/file_hack.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -b -B -p -r1.7 -r1.8 --- file_hack.c 16 Jun 2005 20:36:48 -0000 1.7 +++ file_hack.c 16 Jun 2005 21:01:14 -0000 1.8 @@ -361,7 +361,7 @@ _sysio_fd_dup(int oldfd, int newfd, int init_oftab(); - if (oldfd == newfd) + if (oldfd == newfd && oldfd >= 0) return newfd; fil = _sysio_fd_find(oldfd); |
From: Lee W. <lw...@us...> - 2005-06-16 20:37:01
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24966 Modified Files: file_hack.c Log Message: Must return the file descriptor, not simple 0, when new == old. Index: file_hack.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/file_hack.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -w -b -B -p -r1.6 -r1.7 --- file_hack.c 21 Sep 2004 16:18:30 -0000 1.6 +++ file_hack.c 16 Jun 2005 20:36:48 -0000 1.7 @@ -362,7 +362,7 @@ _sysio_fd_dup(int oldfd, int newfd, int init_oftab(); if (oldfd == newfd) - return 0; + return newfd; fil = _sysio_fd_find(oldfd); if (!fil) |
From: Lee W. <lw...@us...> - 2005-06-06 16:57:46
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18462 Modified Files: module.mk Log Message: From Oleg Drokin at CFS; We forgot to add sysio-cmn.h for the distribution. Fixed. Index: module.mk =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/module.mk,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -b -B -p -r1.5 -r1.6 --- module.mk 21 May 2005 03:37:10 -0000 1.5 +++ module.mk 6 Jun 2005 16:57:24 -0000 1.6 @@ -1,5 +1,5 @@ INCLUDE_EXTRA = include/dev.h include/file.h include/fs.h \ - include/inode.h include/mount.h include/sysio.h \ + include/inode.h include/mount.h include/sysio.h include/sysio-cmn.h \ include/sysio-cmn.h include/sysio-symbols.h include/cplant-yod.h \ include/module.mk include/xtio.h include/stddir.h \ include/native.h |
From: Lee W. <lw...@us...> - 2005-05-21 03:37:18
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32388 Modified Files: module.mk Log Message: Include sysio-cmn.h in distributions. Index: module.mk =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/module.mk,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -b -B -p -r1.4 -r1.5 --- module.mk 14 Oct 2004 15:51:57 -0000 1.4 +++ module.mk 21 May 2005 03:37:10 -0000 1.5 @@ -1,5 +1,5 @@ INCLUDE_EXTRA = include/dev.h include/file.h include/fs.h \ include/inode.h include/mount.h include/sysio.h \ - include/sysio-symbols.h include/cplant-yod.h \ + include/sysio-cmn.h include/sysio-symbols.h include/cplant-yod.h \ include/module.mk include/xtio.h include/stddir.h \ include/native.h |
From: Lee W. <lw...@us...> - 2005-05-21 03:24:36
|
Update of /cvsroot/libsysio/libsysio In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31148 Modified Files: configure.in Log Message: Change version to 1.0; We're ready. Index: configure.in =================================================================== RCS file: /cvsroot/libsysio/libsysio/configure.in,v retrieving revision 1.19 retrieving revision 1.20 diff -u -w -b -B -p -r1.19 -r1.20 --- configure.in 18 Nov 2004 13:00:44 -0000 1.19 +++ configure.in 21 May 2005 03:24:27 -0000 1.20 @@ -1,4 +1,4 @@ -AC_INIT(libsysio, 0.1) +AC_INIT(libsysio, 1.0) AC_CANONICAL_HOST |
From: Lee W. <lw...@us...> - 2005-05-12 20:17:59
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27251 Modified Files: mkdir.c mknod.c Log Message: The umask was not being applied before passing the mode argument to the underlying driver. Fixed. As well, mknod now knows how to create regular files. Report of the problem and patch supplied by Phil Schwan from Cluster File Systems Inc. Index: mkdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mkdir.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -w -b -B -p -r1.14 -r1.15 --- mkdir.c 21 Sep 2004 16:18:31 -0000 1.14 +++ mkdir.c 12 May 2005 20:17:48 -0000 1.15 @@ -76,6 +76,8 @@ SYSIO_INTERFACE_NAME(mkdir)(const char * err = -EROFS; goto error; } + mode |= S_IFDIR; + mode &= ~(_sysio_umask & 0777); /* apply umask */ err = (*pno->p_parent->p_base->pb_ino->i_ops.inop_mkdir)(pno, mode); error: P_RELE(pno); Index: mknod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mknod.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -w -b -B -p -r1.16 -r1.17 --- mknod.c 29 Sep 2004 15:30:20 -0000 1.16 +++ mknod.c 12 May 2005 20:17:50 -0000 1.17 @@ -80,13 +80,17 @@ PREPEND(__, SYSIO_INTERFACE_NAME(xmknod) } /* - * Support only character-special and fifos right now. + * Support only regular, character-special and fifos right now. + * (mode & S_IFMT) == 0 is the same as S_IFREG. */ - if (!(S_ISCHR(mode) || S_ISFIFO(mode))) { + if ((mode & S_IFMT) && + !(S_ISREG(mode) || S_ISCHR(mode) || S_ISFIFO(mode))) { err = -EINVAL; goto out; } + mode &= ~(_sysio_umask & 0777); /* apply umask */ + INTENT_INIT(&intent, INT_CREAT, &mode, NULL); err = _sysio_namei(_sysio_cwd, path, ND_NEGOK, &intent, &pno); if (err) |
From: Lee W. <lw...@us...> - 2005-02-25 00:01:31
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7456/include Modified Files: inode.h Log Message: Cleaned up some duplicated code in the iodone path. As well, there is no a global _sysio_iodone for use by all internal components. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.23 retrieving revision 1.24 diff -u -w -b -B -p -r1.23 -r1.24 --- inode.h 25 Oct 2004 14:29:16 -0000 1.23 +++ inode.h 25 Feb 2005 00:01:06 -0000 1.24 @@ -483,6 +483,7 @@ extern int _sysio_ioctx_cb(struct ioctx void *data); extern void _sysio_ioctx_cb_free(struct ioctx_callback *cb); extern struct ioctx *_sysio_ioctx_find(void *id); +extern int _sysio_ioctx_done(struct ioctx *ioctx); extern ssize_t _sysio_ioctx_wait(struct ioctx *ioctx); extern void _sysio_ioctx_complete(struct ioctx *ioctx); extern int _sysio_open(struct pnode *pno, int flags, mode_t mode); |
From: Lee W. <lw...@us...> - 2005-02-25 00:01:19
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7456/src Modified Files: ioctx.c iowait.c Log Message: Cleaned up some duplicated code in the iodone path. As well, there is no a global _sysio_iodone for use by all internal components. Index: ioctx.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctx.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -w -b -B -p -r1.22 -r1.23 --- ioctx.c 25 Jan 2005 00:37:14 -0000 1.22 +++ ioctx.c 25 Feb 2005 00:01:06 -0000 1.23 @@ -44,6 +44,7 @@ #include <stdlib.h> #include <string.h> #include <errno.h> +#include <sched.h> #include <assert.h> #include <sys/uio.h> #include <sys/types.h> @@ -175,6 +176,21 @@ _sysio_ioctx_find(void *id) } /* + * Check if asynchronous IO operation is complete. + */ +int +_sysio_ioctx_done(struct ioctx *ioctx) +{ + + if (ioctx->ioctx_done) + return 1; + if (!(*ioctx->ioctx_ino->i_ops.inop_iodone)(ioctx)) + return 0; + ioctx->ioctx_done = 1; + return 1; +} + +/* * Wait for asynchronous IO operation to complete, return status * and dispose of the context. * @@ -189,9 +205,11 @@ _sysio_ioctx_wait(struct ioctx *ioctx) /* * Wait for async operation to complete. */ - while (!(ioctx->ioctx_done || - (*ioctx->ioctx_ino->i_ops.inop_iodone)(ioctx))) - ; + while (!_sysio_ioctx_done(ioctx)) { +#ifdef POSIX_PRIORITY_SCHEDULING + (void )sched_yield(); +#endif + } /* * Get status. Index: iowait.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/iowait.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- iowait.c 21 Sep 2004 16:18:31 -0000 1.10 +++ iowait.c 25 Feb 2005 00:01:06 -0000 1.11 @@ -68,10 +68,7 @@ SYSIO_INTERFACE_NAME(iodone)(void *ioid) if (!ioctx) SYSIO_INTERFACE_RETURN(-1, -EINVAL); - rc = - (ioctx->ioctx_done || - (*ioctx->ioctx_ino->i_ops.inop_iodone)(ioctx)); - + rc = _sysio_ioctx_done(ioctx); SYSIO_INTERFACE_RETURN(rc < 0 ? -1 : rc, rc < 0 ? rc : 0); } |
From: jaschut <ja...@us...> - 2005-02-23 01:43:18
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32478 Modified Files: sysio.h Log Message: Add missing prototype for existing function. Index: sysio.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio.h,v retrieving revision 1.33 retrieving revision 1.34 diff -u -w -b -B -p -r1.33 -r1.34 --- sysio.h 4 Feb 2005 00:16:44 -0000 1.33 +++ sysio.h 23 Feb 2005 01:43:08 -0000 1.34 @@ -172,6 +172,9 @@ extern int SYSIO_INTERFACE_NAME(dup)(int extern int SYSIO_INTERFACE_NAME(dup2)(int oldfd, int newfd); extern int SYSIO_INTERFACE_NAME(fcntl)(int fd, int cmd, ...); extern int SYSIO_INTERFACE_NAME(fstat)(int fd, struct stat *buf); +#if _LARGEFILE64_SOURCE +extern int SYSIO_INTERFACE_NAME(fstat64)(int fd, struct stat64 *buf); +#endif extern int SYSIO_INTERFACE_NAME(fsync)(int fd); extern char *SYSIO_INTERFACE_NAME(getcwd)(char *buf, size_t size); extern off_t SYSIO_INTERFACE_NAME(lseek)(int fd, off_t offset, int whence); |
From: Lee W. <lw...@us...> - 2005-02-09 14:00:37
|
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23114 Modified Files: test_copy.c Log Message: Can't use stat when SYSIO_LABEL_NAMES is set to 1. Also, try to be more efficient by using a larger block size derived from the file stat information. Index: test_copy.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_copy.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -b -B -p -r1.11 -r1.12 --- test_copy.c 4 Feb 2005 00:29:26 -0000 1.11 +++ test_copy.c 9 Feb 2005 14:00:27 -0000 1.12 @@ -152,11 +152,14 @@ copy_file(const char *spath, const char int sfd, dfd; int flags; int rtn; - static char buf[1024]; + struct stat stat; + char *buf; + size_t bufsiz; ssize_t cc, wcc; sfd = dfd = -1; rtn = -1; + buf = NULL; sfd = open_file(spath, O_RDONLY, 0); if (sfd < 0) @@ -168,7 +171,22 @@ copy_file(const char *spath, const char if (dfd < 0) goto out; - while ((cc = SYSIO_INTERFACE_NAME(read)(sfd, buf, sizeof(buf))) > 0) + rtn = SYSIO_INTERFACE_NAME(fstat)(dfd, &stat); + if (rtn != 0) { + perror(dpath); + goto out; + } + bufsiz = stat.st_blksize; + if (bufsiz < (64 * 1024)) + bufsiz = + (((64 * 1024) / stat.st_blksize - 1) + 1) * (64 * 1024); + buf = malloc(bufsiz); + if (!buf) { + perror(dpath); + goto out; + } + + while ((cc = SYSIO_INTERFACE_NAME(read)(sfd, buf, bufsiz)) > 0) if ((wcc = SYSIO_INTERFACE_NAME(write)(dfd, buf, cc)) != cc) { if (wcc < 0) { perror(dpath); @@ -181,10 +199,14 @@ copy_file(const char *spath, const char (unsigned )cc); break; } - if (cc < 0) + if (cc < 0) { perror(spath); + rtn = -1; + } out: + if (buf) + free(buf); if (sfd >= 0 && SYSIO_INTERFACE_NAME(close)(sfd) != 0) perror(spath); if (dfd >= 0 && @@ -192,5 +214,5 @@ out: SYSIO_INTERFACE_NAME(close)(dfd) != 0)) perror(dpath); - return 0; + return rtn; } |
From: Lee W. <lw...@us...> - 2005-02-04 00:29:35
|
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11570 Modified Files: test_copy.c test_getcwd.c test_link.c test_list.c test_path.c test_regions.c test_rename.c test_stats.c test_stddir.c test_unlink.c Log Message: Modified to support tests of a build with SYSIO_LABEL_NAMES set so as to cause a unique. non-conflicting build of the POSIX functions. Index: test_copy.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_copy.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- test_copy.c 3 Jul 2004 05:47:13 -0000 1.10 +++ test_copy.c 4 Feb 2005 00:29:26 -0000 1.11 @@ -53,6 +53,9 @@ #include <sys/uio.h> #include <sys/queue.h> +#if defined(SYSIO_LABEL_NAMES) && SYSIO_LABEL_NAMES == 1 +#include "sysio.h" +#endif #include "xtio.h" #include "test.h" @@ -136,7 +139,7 @@ open_file(const char *path, int flags, m { int fd; - fd = open(path, flags, mode); + fd = SYSIO_INTERFACE_NAME(open)(path, flags, mode); if (fd < 0) perror(path); @@ -165,8 +168,8 @@ copy_file(const char *spath, const char if (dfd < 0) goto out; - while ((cc = read(sfd, buf, sizeof(buf))) > 0) - if ((wcc = write(dfd, buf, cc)) != cc) { + while ((cc = SYSIO_INTERFACE_NAME(read)(sfd, buf, sizeof(buf))) > 0) + if ((wcc = SYSIO_INTERFACE_NAME(write)(dfd, buf, cc)) != cc) { if (wcc < 0) { perror(dpath); break; @@ -182,9 +185,11 @@ copy_file(const char *spath, const char perror(spath); out: - if (sfd >= 0 && close(sfd) != 0) + if (sfd >= 0 && SYSIO_INTERFACE_NAME(close)(sfd) != 0) perror(spath); - if (dfd >= 0 && (fsync(dfd) != 0 || close(dfd) != 0)) + if (dfd >= 0 && + (SYSIO_INTERFACE_NAME(fsync)(dfd) != 0 || + SYSIO_INTERFACE_NAME(close)(dfd) != 0)) perror(dpath); return 0; Index: test_getcwd.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_getcwd.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -b -B -p -r1.5 -r1.6 --- test_getcwd.c 3 Jul 2004 05:47:13 -0000 1.5 +++ test_getcwd.c 4 Feb 2005 00:29:26 -0000 1.6 @@ -53,6 +53,9 @@ #include <sys/queue.h> #include <dirent.h> +#if defined(SYSIO_LABEL_NAMES) && SYSIO_LABEL_NAMES == 1 +#include "sysio.h" +#endif #include "xtio.h" #include "mount.h" @@ -144,11 +147,11 @@ doit(const char *path) { char *buf; - if (chdir(path) != 0) { + if (SYSIO_INTERFACE_NAME(chdir)(path) != 0) { perror(path); return -1; } - buf = getcwd(NULL, 0); + buf = SYSIO_INTERFACE_NAME(getcwd)(NULL, 0); if (!buf) { perror(path); return -1; Index: test_link.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_link.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -b -B -p -r1.3 -r1.4 --- test_link.c 3 Jul 2004 05:47:13 -0000 1.3 +++ test_link.c 4 Feb 2005 00:29:26 -0000 1.4 @@ -54,6 +54,9 @@ #include <sys/uio.h> #include <sys/queue.h> +#if defined(SYSIO_LABEL_NAMES) && SYSIO_LABEL_NAMES == 1 +#include "sysio.h" +#endif #include "xtio.h" #include "test.h" @@ -106,11 +109,11 @@ main(int argc, char *const argv[]) old = argv[optind++]; new = argv[optind++]; - if ((err = link(old, new)) != 0) { + if ((err = SYSIO_INTERFACE_NAME(link)(old, new)) != 0) { perror("link"); break; } - if ((err = lstat(new, &stbuf)) != 0) { + if ((err = SYSIO_INTERFACE_NAME(lstat)(new, &stbuf)) != 0) { perror(new); break; } Index: test_list.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_list.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -b -B -p -r1.9 -r1.10 --- test_list.c 3 Jul 2004 05:47:13 -0000 1.9 +++ test_list.c 4 Feb 2005 00:29:26 -0000 1.10 @@ -55,6 +55,9 @@ #include <sys/uio.h> #include <sys/queue.h> +#if defined(SYSIO_LABEL_NAMES) && SYSIO_LABEL_NAMES == 1 +#include "sysio.h" +#endif #include "xtio.h" #include "test.h" @@ -149,7 +152,7 @@ listit(const char *path) off_t base; ssize_t cc; - fd = open(path, O_RDONLY); + fd = SYSIO_INTERFACE_NAME(open)(path, O_RDONLY); if (fd < 0) { perror(path); return -1; @@ -164,7 +167,10 @@ listit(const char *path) } base = 0; - while ((cc = getdirentries(fd, (char *)buf, n, &base)) > 0) { + while ((cc = SYSIO_INTERFACE_NAME(getdirentries)(fd, + (char *)buf, + n, + &base)) > 0) { dp = buf; while (cc > 0) { (void )printf("\t%s: ino %llu type %u\n", Index: test_path.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_path.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- test_path.c 15 Jul 2004 20:17:38 -0000 1.10 +++ test_path.c 4 Feb 2005 00:29:26 -0000 1.11 @@ -52,6 +52,9 @@ #include <unistd.h> #include <sys/uio.h> +#if defined(SYSIO_LABEL_NAMES) && SYSIO_LABEL_NAMES == 1 +#include "sysio.h" +#endif #include "xtio.h" #include "test.h" @@ -149,7 +152,7 @@ statit(const char *path) /* * Get file attrs. */ - err = lstat(path, &stbuf); + err = SYSIO_INTERFACE_NAME(lstat)(path, &stbuf); if (err) { perror(path); return -1; @@ -197,7 +200,7 @@ statit(const char *path) * Print path and type. */ if (S_ISLNK(stbuf.st_mode)) { - cc = readlink(path, buf, sizeof(buf)); + cc = SYSIO_INTERFACE_NAME(readlink)(path, buf, sizeof(buf)); if (cc < 0) { perror(path); return -1; Index: test_regions.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_regions.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -b -B -p -r1.5 -r1.6 --- test_regions.c 3 Jul 2004 05:47:13 -0000 1.5 +++ test_regions.c 4 Feb 2005 00:29:26 -0000 1.6 @@ -65,6 +65,9 @@ #include <fcntl.h> #include <sys/uio.h> +#if defined(SYSIO_LABEL_NAMES) && SYSIO_LABEL_NAMES == 1 +#include "sysio.h" +#endif #include "xtio.h" #include "test.h" @@ -197,7 +200,7 @@ main(int argc, char * const argv[]) if (use64) flags |= O_LARGEFILE; #endif - fd = open(path, flags, 0666); + fd = SYSIO_INTERFACE_NAME(open)(path, flags, 0666); if (fd < 0) { perror(path); err = 1; @@ -205,11 +208,11 @@ main(int argc, char * const argv[]) } #ifdef GO64 if (use64) - off64 = lseek64(fd, off64, SEEK_SET); + off64 = SYSIO_INTERFACE_NAME(lseek64)(fd, off64, SEEK_SET); else off64 = #endif - off = lseek(fd, off, SEEK_SET); + off = SYSIO_INTERFACE_NAME(lseek)(fd, off, SEEK_SET); #ifdef GO64 if ((use64 && off64 < 0) || (!use64 && off < 0)) { perror(use64 ? "lseek64" : "lseek"); @@ -224,9 +227,9 @@ main(int argc, char * const argv[]) } #endif if (which == 'r') - cc = read(fd, buf, nbytes); + cc = SYSIO_INTERFACE_NAME(read)(fd, buf, nbytes); else - cc = write(fd, buf, nbytes); + cc = SYSIO_INTERFACE_NAME(write)(fd, buf, nbytes); if (cc < 0) { perror(path); err = 1; @@ -234,11 +237,11 @@ main(int argc, char * const argv[]) } #ifdef GO64 if (use64) { - off64 = lseek64(fd, 0, SEEK_CUR); + off64 = SYSIO_INTERFACE_NAME(lseek64)(fd, 0, SEEK_CUR); } else off64 = #endif - off = lseek(fd, 0, SEEK_CUR); + off = SYSIO_INTERFACE_NAME(lseek)(fd, 0, SEEK_CUR); (void )printf(("%s%s@" #ifdef GO64 "%lld" @@ -269,7 +272,7 @@ main(int argc, char * const argv[]) ); error: - if (fd > 0 && close(fd) != 0) + if (fd > 0 && SYSIO_INTERFACE_NAME(close)(fd) != 0) perror(path); free(buf); out: Index: test_rename.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_rename.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -b -B -p -r1.5 -r1.6 --- test_rename.c 3 Jul 2004 05:47:13 -0000 1.5 +++ test_rename.c 4 Feb 2005 00:29:26 -0000 1.6 @@ -52,6 +52,9 @@ #include <fcntl.h> #include <sys/uio.h> +#if defined(SYSIO_LABEL_NAMES) && SYSIO_LABEL_NAMES == 1 +#include "sysio.h" +#endif #include "xtio.h" #include "test.h" @@ -95,7 +98,7 @@ main(int argc, char * const argv[]) exit(1); } - (void )umask(022); + (void )SYSIO_INTERFACE_NAME(umask)(022); /* * Source @@ -110,7 +113,7 @@ main(int argc, char * const argv[]) if (argc - optind) usage(); - err = rename(spath, dpath); + err = SYSIO_INTERFACE_NAME(rename)(spath, dpath); if (err) perror("rename"); Index: test_stats.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_stats.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -b -B -p -r1.7 -r1.8 --- test_stats.c 3 Jul 2004 05:47:13 -0000 1.7 +++ test_stats.c 4 Feb 2005 00:29:26 -0000 1.8 @@ -55,6 +55,9 @@ #endif #include <sys/uio.h> +#if defined(SYSIO_LABEL_NAMES) && SYSIO_LABEL_NAMES == 1 +#include "sysio.h" +#endif #include "xtio.h" #include "test.h" @@ -91,7 +94,7 @@ main(int argc, char * const argv[]) exit(1); } - (void )umask(022); + (void )SYSIO_INTERFACE_NAME(umask)(022); while (optind < argc) do_stats(argv[optind++]); @@ -124,19 +127,19 @@ do_stats(const char *path) struct statvfs stvfsbuf1, stvfsbuf2; #endif - fd = open(path, O_RDONLY); + fd = SYSIO_INTERFACE_NAME(open)(path, O_RDONLY); if (fd < 0) { perror(path); return; } - err = fstat(fd, &stbuf1); + err = SYSIO_INTERFACE_NAME(fstat)(fd, &stbuf1); if (!err) - err = stat(path, &stbuf2); + err = SYSIO_INTERFACE_NAME(stat)(path, &stbuf2); #ifdef notdef if (!err) - err = fstatvfs(fd, &stvfsbuf1); + err = SYSIO_INTERFACE_NAME(fstatvfs)(fd, &stvfsbuf1); if (!err) - err = statvfs(path, &stvfsbuf1); + err = SYSIO_INTERFACE_NAME(statvfs)(path, &stvfsbuf1); #endif if (err) { perror(path); @@ -182,6 +185,6 @@ do_stats(const char *path) (unsigned long )stbuf1.st_mtime, (unsigned long )stbuf1.st_ctime); out: - if (close(fd) != 0) + if (SYSIO_INTERFACE_NAME(close)(fd) != 0) perror("closing file"); } Index: test_stddir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_stddir.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -b -B -p -r1.1 -r1.2 --- test_stddir.c 30 Aug 2004 15:58:01 -0000 1.1 +++ test_stddir.c 4 Feb 2005 00:29:26 -0000 1.2 @@ -49,6 +49,9 @@ #include <dirent.h> #include <sys/types.h> +#if defined(SYSIO_LABEL_NAMES) && SYSIO_LABEL_NAMES == 1 +#include "sysio.h" +#endif #include "xtio.h" #include "test.h" @@ -139,17 +142,17 @@ testit(const char *path) printf("testing directory functions on %s\n", path); - if ((d = opendir(path)) == NULL) { + if ((d = SYSIO_INTERFACE_NAME(opendir)(path)) == NULL) { perror(path); return errno; } - while ((de = readdir(d)) != NULL) + while ((de = SYSIO_INTERFACE_NAME(readdir)(d)) != NULL) printf("\t %s: ino %lu off %lu type %u\n", de->d_name, (unsigned long )de->d_ino, (unsigned long )de->d_off, (int )de->d_type); - if (closedir(d)) { + if (SYSIO_INTERFACE_NAME(closedir)(d)) { perror("closedir"); return errno; } Index: test_unlink.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_unlink.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -b -B -p -r1.4 -r1.5 --- test_unlink.c 3 Jul 2004 05:47:13 -0000 1.4 +++ test_unlink.c 4 Feb 2005 00:29:26 -0000 1.5 @@ -52,6 +52,9 @@ #endif #include <sys/uio.h> +#if defined(SYSIO_LABEL_NAMES) && SYSIO_LABEL_NAMES == 1 +#include "sysio.h" +#endif #include "xtio.h" #include "test.h" @@ -141,7 +144,7 @@ static int unlinkit(const char *path) { - if (unlink(path) != 0) { + if (SYSIO_INTERFACE_NAME(unlink)(path) != 0) { perror(path); return -1; } |
From: Lee W. <lw...@us...> - 2005-02-04 00:22:02
|
Update of /cvsroot/libsysio/libsysio/drivers/yod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9618/yod Modified Files: fs_yod.c Log Message: On a failed mount, an acquired FS was first released, then gone'd. The gone caused a double-free. Removed. Index: fs_yod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/yod/fs_yod.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -w -b -B -p -r1.20 -r1.21 --- fs_yod.c 27 Sep 2004 20:20:58 -0000 1.20 +++ fs_yod.c 4 Feb 2005 00:21:45 -0000 1.21 @@ -412,7 +412,6 @@ error: _sysio_pb_gone(rootpb); if (fs) { FS_RELE(fs); - _sysio_fs_gone(fs); } return err; |
From: Lee W. <lw...@us...> - 2005-02-04 00:22:02
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9618/native Modified Files: fs_native.c Log Message: On a failed mount, an acquired FS was first released, then gone'd. The gone caused a double-free. Removed. Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.54 retrieving revision 1.55 diff -u -w -b -B -p -r1.54 -r1.55 --- fs_native.c 25 Jan 2005 00:36:50 -0000 1.54 +++ fs_native.c 4 Feb 2005 00:21:45 -0000 1.55 @@ -494,7 +494,6 @@ error: _sysio_pb_gone(rootpb); if (fs) { FS_RELE(fs); - _sysio_fs_gone(fs); nfs = NULL; } if (nfs) |
From: Lee W. <lw...@us...> - 2005-02-04 00:19:03
|
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8923 Modified Files: Makefile.am module.mk Removed Files: cleanup.pl help.c helper.pm populator.pl setup.pl sysio_stubs.c sysio_tests.c test_all.pl test_copy.bash test_copy.pl test_driver.c test_driver.h test_getcwd.pl test_list.pl test_path.pl test_rw.pl test_stats.pl test_stdfd.pl test_strided.pl test_symlink.pl verifier.pl Log Message: Removed the perl/C tests. For the most part, they just replicated the C tests and were increasingly hard to port. Index: Makefile.am =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/Makefile.am,v retrieving revision 1.23 retrieving revision 1.24 diff -u -w -b -B -p -r1.23 -r1.24 --- Makefile.am 3 Feb 2005 20:37:05 -0000 1.23 +++ Makefile.am 4 Feb 2005 00:18:52 -0000 1.24 @@ -1,6 +1,6 @@ noinst_PROGRAMS = test_copy test_stats test_path test_list \ test_getcwd test_link test_unlink test_rename \ - test_regions test_driver test_stddir + test_regions test_stddir CLEANFILES=drv_data.c @@ -34,13 +34,6 @@ DRIVERS=$(NATIVE_DRIVER_NAME) $(INCORE_D CMNSRC=startup.c drv_init_all.c drv_data.c BUILT_SOURCES=drv_data.c -check_PROGRAMS=test_driver -if TEST_ALPHA_ARG -TESTS_ENVIRONMENT=IS_ALPHA=yes -else -TESTS_ENVIRONMENT=IS_ALPHA=no -endif -TESTS=test_all.pl CFL=$(AM_CFLAGS) $(AM_CPPFLAGS) \ $(NATIVE_DRIVER_CFLAGS) $(INCORE_DRIVER_CFLAGS) \ @@ -84,10 +77,6 @@ test_regions_SOURCES=test_regions.c $(CM test_regions_CFLAGS=$(CFL) test_regions_DEPENDENCIES=$(LIBS) -test_driver_SOURCES=test_driver.c sysio_tests.c sysio_stubs.c help.c $(CMNSRC) -test_driver_CFLAGS=$(CFL) -test_driver_DEPENDENCIES=$(LIBS) - test_stddir_SOURCES=test_stddir.c $(CMNSRC) test_stddir_CFLAGS=$(CFL) test_stddir_DEPENDENCIES=$(LIBS) Index: module.mk =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/module.mk,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -b -B -p -r1.1 -r1.2 --- module.mk 16 Dec 2003 15:43:15 -0000 1.1 +++ module.mk 4 Feb 2005 00:18:52 -0000 1.2 @@ -1,2 +1,2 @@ -TESTS_EXTRA = $(shell ls tests/*.[ch] tests/*.sh tests/*.p[lm]) \ +TESTS_EXTRA = $(shell ls tests/*.[ch]) \ tests/Makefile.am tests/Makefile.in tests/module.mk --- cleanup.pl DELETED --- --- help.c DELETED --- --- helper.pm DELETED --- --- populator.pl DELETED --- --- setup.pl DELETED --- --- sysio_stubs.c DELETED --- --- sysio_tests.c DELETED --- --- test_all.pl DELETED --- --- test_copy.bash DELETED --- --- test_copy.pl DELETED --- --- test_driver.c DELETED --- --- test_driver.h DELETED --- --- test_getcwd.pl DELETED --- --- test_list.pl DELETED --- --- test_path.pl DELETED --- --- test_rw.pl DELETED --- --- test_stats.pl DELETED --- --- test_stdfd.pl DELETED --- --- test_strided.pl DELETED --- --- test_symlink.pl DELETED --- --- verifier.pl DELETED --- |
From: Lee W. <lw...@us...> - 2005-02-04 00:17:00
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8354 Modified Files: sysio.h Log Message: The external declarations for the POSIX standard IO functions read, pread, readv, write, pwrite, and pwritev were lost when the IO path was rewritten. This change reintroduces them. Index: sysio.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio.h,v retrieving revision 1.32 retrieving revision 1.33 diff -u -w -b -B -p -r1.32 -r1.33 --- sysio.h 25 Jan 2005 00:37:09 -0000 1.32 +++ sysio.h 4 Feb 2005 00:16:44 -0000 1.33 @@ -206,6 +206,22 @@ extern int SYSIO_INTERFACE_NAME(stat)(co #if _LARGEFILE64_SOURCE extern int SYSIO_INTERFACE_NAME(stat64)(const char *path, struct stat64 *buf); #endif +extern ssize_t SYSIO_INTERFACE_NAME(read)(int fd, void *buf, size_t count); +extern ssize_t SYSIO_INTERFACE_NAME(pread)(int fd, void *buf, size_t count, + off_t offset); +extern ssize_t SYSIO_INTERFACE_NAME(readv)(int fd, + const struct iovec *iov, + int count); +extern ssize_t SYSIO_INTERFACE_NAME(write)(int fd, + const void *buf, + size_t count); +extern ssize_t SYSIO_INTERFACE_NAME(pwrite)(int fd, + const void *buf, + size_t count, + off_t offset); +extern ssize_t SYSIO_INTERFACE_NAME(writev)(int fd, + const struct iovec *iov, + int count); #ifdef _HAVE_STATVFS extern int SYSIO_INTERFACE_NAME(statvfs)(const char *path, struct statvfs *buf); #if _LARGEFILE64_SOURCE |
From: Lee W. <lw...@us...> - 2005-02-03 20:37:14
|
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23774 Modified Files: Makefile.am Log Message: All the per test LDADD directives caused the libraries to be specified twice during the build. This is not good if they contain CTOR directives as they go off twice, usually are initializers and, so, init twice. Index: Makefile.am =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/Makefile.am,v retrieving revision 1.22 retrieving revision 1.23 diff -u -w -b -B -p -r1.22 -r1.23 --- Makefile.am 24 Oct 2004 20:53:46 -0000 1.22 +++ Makefile.am 3 Feb 2005 20:37:05 -0000 1.23 @@ -50,57 +50,46 @@ LIBS=$(LIBBUILD_DIR)/libsysio.a test_copy_SOURCES=test_copy.c $(CMNSRC) test_copy_CFLAGS=$(CFL) -test_copy_LDADD=$(LIBS) test_copy_DEPENDENCIES=$(LIBS) test_stats_SOURCES=test_stats.c $(CMNSRC) test_stats_CFLAGS=$(CFL) -test_stats_LDADD=$(LIBS) test_stats_DEPENDENCIES=$(LIBS) test_path_SOURCES=test_path.c $(CMNSRC) test_path_CFLAGS=$(CFL) -test_path_LDADD=$(LIBS) test_path_DEPENDENCIES=$(LIBS) test_list_SOURCES=test_list.c $(CMNSRC) test_list_CFLAGS=$(CFL) -test_list_LDADD=$(LIBS) test_list_DEPENDENCIES=$(LIBS) test_getcwd_SOURCES=test_getcwd.c $(CMNSRC) test_getcwd_CFLAGS=$(CFL) -test_getcwd_LDADD=$(LIBS) test_getcwd_DEPENDENCIES=$(LIBS) test_link_SOURCES=test_link.c $(CMNSRC) test_link_CFLAGS=$(CFL) -test_link_LDADD=$(LIBS) test_link_DEPENDENCIES=$(LIBS) test_unlink_SOURCES=test_unlink.c $(CMNSRC) test_unlink_CFLAGS=$(CFL) -test_unlink_LDADD=$(LIBS) test_unlink_DEPENDENCIES=$(LIBS) test_rename_SOURCES=test_rename.c $(CMNSRC) test_rename_CFLAGS=$(CFL) -test_rename_LDADD=$(LIBS) test_rename_DEPENDENCIES=$(LIBS) test_regions_SOURCES=test_regions.c $(CMNSRC) test_regions_CFLAGS=$(CFL) -test_regions_LDADD=$(LIBS) test_regions_DEPENDENCIES=$(LIBS) test_driver_SOURCES=test_driver.c sysio_tests.c sysio_stubs.c help.c $(CMNSRC) test_driver_CFLAGS=$(CFL) -test_driver_LDADD=$(LIBS) test_driver_DEPENDENCIES=$(LIBS) test_stddir_SOURCES=test_stddir.c $(CMNSRC) test_stddir_CFLAGS=$(CFL) -test_stddir_LDADD=$(LIBS) test_stddir_DEPENDENCIES=$(LIBS) drv_data.c: $(CONFIG_DEPENDENCIES) $(top_srcdir)/tests/gendrvdata.sh |
From: Lee W. <lw...@us...> - 2005-02-03 20:05:27
|
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17047 Modified Files: startup.c Log Message: The default namespace initialization now enables automounts. Index: startup.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/startup.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- startup.c 25 Jan 2005 00:37:19 -0000 1.10 +++ startup.c 3 Feb 2005 20:05:13 -0000 1.11 @@ -44,9 +44,9 @@ _test_sysio_startup() arg = getenv("SYSIO_NAMESPACE"); if (!(arg || (arg = getenv("SYSIO_MANUAL")))) { /* - * Assume a native mount at root. + * Assume a native mount at root with automounts enabled. */ - arg = "{mnt,dev=\"native:/\",dir=/,fl=0}"; + arg = "{mnt,dev=\"native:/\",dir=/,fl=2}"; } err = _sysio_boot("namespace", arg); if (err) |
From: Lee W. <lw...@us...> - 2005-01-26 14:24:42
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14422 Removed Files: namespace.h Log Message: Deprecated. --- namespace.h DELETED --- |