libsysio-commit Mailing List for libsysio (Page 27)
Brought to you by:
lward
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
(25) |
May
(28) |
Jun
(25) |
Jul
(30) |
Aug
(60) |
Sep
(52) |
Oct
(100) |
Nov
(15) |
Dec
(34) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(89) |
Feb
(48) |
Mar
(22) |
Apr
(59) |
May
(16) |
Jun
(15) |
Jul
(50) |
Aug
(26) |
Sep
(40) |
Oct
(27) |
Nov
(12) |
Dec
|
2005 |
Jan
(24) |
Feb
(11) |
Mar
|
Apr
|
May
(3) |
Jun
(6) |
Jul
|
Aug
(14) |
Sep
(21) |
Oct
(10) |
Nov
|
Dec
|
2006 |
Jan
(8) |
Feb
(5) |
Mar
(2) |
Apr
(6) |
May
(11) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(3) |
2007 |
Jan
(3) |
Feb
(5) |
Mar
(20) |
Apr
(41) |
May
(21) |
Jun
(3) |
Jul
(5) |
Aug
(12) |
Sep
(21) |
Oct
(5) |
Nov
(16) |
Dec
|
2008 |
Jan
|
Feb
(2) |
Mar
(4) |
Apr
(23) |
May
|
Jun
(22) |
Jul
(13) |
Aug
|
Sep
|
Oct
(9) |
Nov
(3) |
Dec
(13) |
2009 |
Jan
(14) |
Feb
(10) |
Mar
(2) |
Apr
(11) |
May
(7) |
Jun
(1) |
Jul
(1) |
Aug
(36) |
Sep
(12) |
Oct
|
Nov
|
Dec
(10) |
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: Lee W. <lw...@us...> - 2004-05-25 17:53:52
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19311/drivers/native Modified Files: fs_native.c Log Message: +Changes for Red Storm from Kevin Pedretti +Fix in fs_native.c to conditionally compile DIR_STREAMED code properly. We were always including it -- Even when using getdirentries. Oops. Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.37 retrieving revision 1.38 diff -u -w -b -B -p -r1.37 -r1.38 --- fs_native.c 27 Apr 2004 06:33:22 -0000 1.37 +++ fs_native.c 25 May 2004 17:53:43 -0000 1.38 @@ -86,10 +86,10 @@ #define DIR_STREAMED 0 #define DIR_CVT_64 0 #elif defined(SYS_getdents64) -#define DIR_STREAMED 0 +#define DIR_STREAMED 1 #define DIR_CVT_64 0 #elif defined(SYS_getdents) -#define DIR_STREAMED 0 +#define DIR_STREAMED 1 #if defined(_LARGEFILE64_SOURCE) #define DIR_CVT_64 1 /* @@ -923,7 +921,7 @@ native_filldirentries(struct native_inod if (*basep < 0) return -EINVAL; -#if !DIR_STREAMED +#if DIR_STREAMED /* * Stream-oriented access requires that we reposition prior to the * fill call. @@ -939,8 +937,7 @@ native_filldirentries(struct native_inod nino->ni_fd, buf, nbytes, - basep, - &nino->ni_fpos); + basep); #elif defined(SYS_getdents64) syscall(SYS_getdents64, nino->ni_fd, buf, nbytes); #elif defined(SYS_getdents) @@ -949,7 +946,7 @@ native_filldirentries(struct native_inod if (cc < 0) return -errno; -#if !DIR_STREAMED +#if DIR_STREAMED /* * Stream-oriented access requires that we discover where we are * after the call. |
From: MeiJia <me...@us...> - 2004-05-25 05:57:18
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19427/src Modified Files: file_hack.c Log Message: hack code for lustre. Index: file_hack.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/file_hack.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -b -B -p -r1.1 -r1.2 --- file_hack.c 20 May 2004 19:31:48 -0000 1.1 +++ file_hack.c 25 May 2004 05:56:58 -0000 1.2 @@ -393,7 +393,10 @@ _sysio_fd_close_all() * Close all open descriptors. */ _sysio_oftable_close_all(&_sysio_oftab[OFTAB_VIRTUAL]); + /* XXX see liblustre/llite_lib.c for explaination */ +#if 0 _sysio_oftable_close_all(&_sysio_oftab[OFTAB_NATIVE]); +#endif /* * Release current working directory. |
From: <ben...@id...> - 2004-05-22 12:22:00
|
Dear Open Source developer I am doing a research project on "Fun and Software Development" in which I kindly invite you to participate. You will find the online survey under http://fasd.ethz.ch/qsf/. The questionnaire consists of 53 questions and you will need about 15 minutes to complete it. With the FASD project (Fun and Software Development) we want to define the motivational significance of fun when software developers decide to engage in Open Source projects. What is special about our research project is that a similar survey is planned with software developers in commercial firms. This procedure allows the immediate comparison between the involved individuals and the conditions of production of these two development models. Thus we hope to obtain substantial new insights to the phenomenon of Open Source Development. With many thanks for your participation, Benno Luthiger PS: The results of the survey will be published under http://www.isu.unizh.ch/fuehrung/blprojects/FASD/. We have set up the mailing list fa...@we... for this study. Please see http://fasd.ethz.ch/qsf/mailinglist_en.html for registration to this mailing list. _______________________________________________________________________ Benno Luthiger Swiss Federal Institute of Technology Zurich 8092 Zurich Mail: benno.luthiger(at)id.ethz.ch _______________________________________________________________________ |
From: Lee W. <lw...@us...> - 2004-05-20 19:31:58
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19480/src Modified Files: fcntl.c module.mk open.c Added Files: file_hack.c stdlib.c Log Message: Integrated CFS changes from Eric's patch dated 5-19-2004. --- 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 <stdlib.h> #include <assert.h> #include <errno.h> #include <sys/types.h> #include <sys/queue.h> #include "sysio.h" #include "file.h" #include "inode.h" #include "xtio.h" /* * Support for file IO. */ /* * The open files table */ typedef struct oftab { struct file **table; /* table array */ size_t size; /* current table size */ int offset; /* base fd number */ int max; /* max size */ } oftab_t; #define OFTAB_NATIVE (0) #define OFTAB_VIRTUAL (1) static oftab_t _sysio_oftab[2] = { {NULL, 0, 0, 0}, {NULL, 0, 0, 1024*1024}, }; static int native_max_fds = 0; static inline void init_oftab() { if (!native_max_fds) { native_max_fds = sysconf(_SC_OPEN_MAX); if (native_max_fds <= 0) abort(); _sysio_oftab[OFTAB_NATIVE].max = native_max_fds - 1; _sysio_oftab[OFTAB_VIRTUAL].offset = native_max_fds; } } static inline oftab_t *select_oftab(int fd) { return & _sysio_oftab[fd >= native_max_fds || fd < 0]; } /* * Create and initialize open file record. */ struct file * _sysio_fnew(struct inode *ino, int flags) { struct file *fil; fil = malloc(sizeof(struct file)); if (!fil) return NULL; _SYSIO_FINIT(fil, ino, flags); I_REF(ino); return fil; } /* * Destroy open file record. */ void _sysio_fgone(struct file *fil) { int err; assert(!fil->f_ref); assert(fil->f_ino); err = (*fil->f_ino->i_ops.inop_close)(fil->f_ino); assert(!err); free(fil); } /* * IO operation completion handler. */ void _sysio_fcompletio(struct ioctx *ioctx, struct file *fil) { _SYSIO_OFF_T off; if (ioctx->ioctx_cc <= 0) return; assert(ioctx->ioctx_ino == fil->f_ino); off = fil->f_pos + ioctx->ioctx_cc; if (fil->f_pos && off <= fil->f_pos) abort(); fil->f_pos = off; } /* * Grow (or truncate) the file descriptor table. */ static int fd_grow(oftab_t *oftab, size_t n) { int fd; size_t count; struct file **noftab, **filp; /* * Sanity check the new size. */ fd = (int )n; if ((size_t )fd != n) return -EMFILE; n++; /* index -> size */ assert(n > oftab->size); if (n > oftab->max) return -ERANGE; if (n < 8) n = 8; if (n - oftab->size < oftab->size) n = (n + 1) * 2; noftab = realloc(oftab->table, n * sizeof(struct file *)); if (!noftab) return -ENOMEM; oftab->table = noftab; count = oftab->size; oftab->size = n; if (n < count) return 0; filp = oftab->table + count; n -= count; while (n--) *filp++ = NULL; return 0; } #if ZERO_SUM_MEMORY static void free_oftab(oftab_t *ot) { if (ot->table) { free(ot->table); ot->size = 0; } } void _sysio_fd_shutdown() { free_oftab(&_sysio_oftab[OFTAB_NATIVE]); free_oftab(&_sysio_oftab[OFTAB_VIRTUAL]); } #endif /* * Find a free slot in the open files table. * target < 0: any free slot * target >= 0: get slot [target] */ static int find_free_fildes(oftab_t *oftab, int target) { int n; int err; struct file **filp; if (target < 0) { for (n = 0, filp = oftab->table; n < oftab->size && *filp; n++, filp++) ; } else n = target - oftab->offset; if (n >= oftab->size) { err = fd_grow(oftab, n); if (err) return err; filp = &oftab->table[n]; assert(!*filp); } #ifdef HAVE_LUSTRE_HACK /* FIXME sometimes we could intercept open/socket to create * a fd, but missing close()? currently we have this problem * with resolv lib. as a workaround simply destroy the file * struct here. */ if (oftab->table[n]) { free(oftab->table[n]); oftab->table[n] = NULL; } #endif return oftab->offset + n; } /* * Find open file record from file descriptor. * clear this entry if 'clear' is non-zero */ static struct file * __sysio_fd_get(int fd, int clear) { oftab_t *oftab; struct file *file; init_oftab(); if (fd < 0) return NULL; oftab = select_oftab(fd); if (!oftab->table || fd >= oftab->offset + oftab->size) return NULL; file = oftab->table[fd - oftab->offset]; if (clear) oftab->table[fd - oftab->offset] = NULL; return file; } /* * Find open file record from file descriptor. */ struct file * _sysio_fd_find(int fd) { return __sysio_fd_get(fd, 0); } /* * Close an open descriptor. */ int _sysio_fd_close(int fd) { struct file *fil; fil = fil = __sysio_fd_get(fd, 1); if (!fil) return -EBADF; F_RELE(fil); return 0; } /* * Associate open file record with given file descriptor or any available * file descriptor if less than zero. */ int _sysio_fd_set(struct file *fil, int fd) { int err; struct file *ofil; oftab_t *oftab; init_oftab(); oftab = select_oftab(fd); /* * New fd < 0 => any available descriptor. */ fd = find_free_fildes(oftab, fd); if (fd < 0) return fd; assert(fd < oftab->offset + oftab->size); /* * Remember old. */ ofil = __sysio_fd_get(fd, 1); if (ofil) F_RELE(ofil); oftab->table[fd - oftab->offset] = fil; return fd; } /* * Duplicate old file descriptor. * * If the new file descriptor is less than zero, the new file descriptor * is chosen freely. */ int _sysio_fd_dup2(int oldfd, int newfd) { struct file *fil; int fd; init_oftab(); if (oldfd == newfd) return 0; fil = _sysio_fd_find(oldfd); if (!fil) return -EBADF; /* old & new must belong to the same oftab */ if (select_oftab(oldfd) != select_oftab(newfd)) return -EINVAL; fd = _sysio_fd_set(fil, newfd); if (fd >= 0) F_REF(fil); return fd; } void _sysio_oftable_close_all(oftab_t *oftab) { struct file **filp; int fd; for (fd = 0, filp = oftab->table; (size_t )fd < oftab->size; fd++, filp++) { if (!*filp) continue; F_RELE(*filp); *filp = NULL; } } int _sysio_fd_close_all() { int fd; struct file **filp; oftab_t *oftab; int i; /* * Close all open descriptors. */ _sysio_oftable_close_all(&_sysio_oftab[OFTAB_VIRTUAL]); _sysio_oftable_close_all(&_sysio_oftab[OFTAB_NATIVE]); /* * Release current working directory. */ if (_sysio_cwd) { P_RELE(_sysio_cwd); _sysio_cwd = NULL; } return 0; } Index: fcntl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fcntl.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -b -B -p -r1.11 -r1.12 --- fcntl.c 30 Apr 2004 19:24:46 -0000 1.11 +++ fcntl.c 20 May 2004 19:31:48 -0000 1.12 @@ -53,6 +53,36 @@ #include "sysio-symbols.h" +#ifdef HAVE_LUSTRE_HACK +#include <syscall.h> + +static int +_sysio_fcntl(int fd, int cmd, va_list ap) +{ + int err; + long arg; + + switch (cmd) { + case F_GETFD: + case F_GETFL: + case F_GETOWN: + return syscall(SYS_fcntl, fd, cmd); + case F_DUPFD: + case F_SETFD: + case F_SETFL: + case F_GETLK: + case F_SETLK: + case F_SETLKW: + case F_SETOWN: + arg = va_arg(ap, long); + return syscall(SYS_fcntl, fd, cmd, arg); + } + + errno = ENOSYS; + return -1; +} +#endif + int SYSIO_INTERFACE_NAME(fcntl)(int fd, int cmd, ...) { @@ -65,8 +95,17 @@ SYSIO_INTERFACE_NAME(fcntl)(int fd, int err = 0; fil = _sysio_fd_find(fd); if (!fil) { +#ifdef HAVE_LUSTRE_HACK + va_start(ap, cmd); + err = _sysio_fcntl(fd, cmd, ap); + va_end(ap); + if (err == -1) + err = -errno; + goto out; +#else err = -EBADF; goto out; +#endif } switch (cmd) { Index: module.mk =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/module.mk,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -b -B -p -r1.3 -r1.4 --- module.mk 24 Feb 2004 14:58:26 -0000 1.3 +++ module.mk 20 May 2004 19:31:48 -0000 1.4 @@ -4,7 +4,7 @@ # SRCDIR_SRCS = src/access.c src/chdir.c src/chmod.c \ src/chown.c src/dev.c src/dup.c src/fcntl.c \ - src/file.c src/fs.c src/fsync.c \ + src/fs.c src/fsync.c \ 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 \ @@ -13,4 +13,10 @@ SRCDIR_SRCS = src/access.c src/chdir.c s src/rmdir.c src/stat64.c src/stat.c \ src/symlink.c \ src/truncate.c src/unlink.c src/utime.c +if WITH_LUSTRE_HACK +SRCDIR_SRCS += src/file_hack.c src/stdlib.c +else +SRCDIR_SRCS += src/file.c +endif + SRCDIR_EXTRA = src/module.mk Index: open.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/open.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -w -b -B -p -r1.19 -r1.20 --- open.c 28 Apr 2004 11:21:46 -0000 1.19 +++ open.c 20 May 2004 19:31:48 -0000 1.20 @@ -267,7 +267,12 @@ SYSIO_INTERFACE_NAME(creat)(const char * #undef __creat sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(creat), __creat) #undef creat64 +#ifndef HAVE_LUSTRE_HACK sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(creat), SYSIO_INTERFACE_NAME(creat64)) +#else +/* XXX workaround SuSE SLES 8, glibc-2.2.5 */ +sysio_sym_strong_alias(SYSIO_INTERFACE_NAME(creat), SYSIO_INTERFACE_NAME(creat64)) +#endif #undef __creat64 sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(creat), __creat64) #endif |
From: Lee W. <lw...@us...> - 2004-05-20 19:31:58
|
Update of /cvsroot/libsysio/libsysio In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19480 Modified Files: Makefile.am configure.in Log Message: Integrated CFS changes from Eric's patch dated 5-19-2004. Index: Makefile.am =================================================================== RCS file: /cvsroot/libsysio/libsysio/Makefile.am,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -b -B -p -r1.11 -r1.12 --- Makefile.am 14 Feb 2004 19:42:57 -0000 1.11 +++ Makefile.am 20 May 2004 19:31:48 -0000 1.12 @@ -55,13 +55,10 @@ __LIBBUILD_DIR__libsysio_a_SOURCES = \ $(OPTIONAL_NATIVE_SRCS) \ $(OPTIONAL_YOD_SRCS) -# -# Cygwin related? Configure seems to do this for us when appropriate. Why -# was this here? -# -# Commented out by Lee; Wed Jan 21 08:21:33 EST 2004 -# -#__LIBBUILD_DIR__libsysio_a_CFLAGS = -fPIC +if WITH_LUSTRE_HACK +# it would be better that let configure script check this +__LIBBUILD_DIR__libsysio_a_CFLAGS = -fPIC +endif include $(top_srcdir)/Rules.make Index: configure.in =================================================================== RCS file: /cvsroot/libsysio/libsysio/configure.in,v retrieving revision 1.16 retrieving revision 1.17 diff -u -w -b -B -p -r1.16 -r1.17 --- configure.in 6 Feb 2004 20:07:28 -0000 1.16 +++ configure.in 20 May 2004 19:31:48 -0000 1.17 @@ -144,6 +144,20 @@ AC_ARG_WITH(sockets, [with_sockets=no]) AM_CONDITIONAL(WITH_SOCKETS_DRIVER, test x$with_sockets = xyes) +AC_ARG_WITH(lustre-hack, + AC_HELP_STRING([--with-lustre-hack], + [have hacking code which needed to support liblustre driver (EXPERIMENTAL)]), + [ case "${withval}" in + yes) ;; + no) ;; + *) AC_MSG_ERROR(bad value ${withval} for --with-lustre-hack) ;; + esac], + [with_lustre_hack=no]) +AM_CONDITIONAL(WITH_LUSTRE_HACK, test x$with_lustre_hack = xyes) +if test x$with_lustre_hack = xyes; then + AC_DEFINE(HAVE_LUSTRE_HACK) +fi + # We keep the original values in `$config_*' and never modify them, so we # can write them unchanged into config.make. Everything else uses # $machine, $vendor, and $os, and changes them whenever convenient. |
From: Lee W. <lw...@us...> - 2004-05-20 19:31:57
|
Update of /cvsroot/libsysio/libsysio/drivers/sockets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19480/drivers/sockets Modified Files: sockets.c Log Message: Integrated CFS changes from Eric's patch dated 5-19-2004. Index: sockets.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/sockets/sockets.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -b -B -p -r1.2 -r1.3 --- sockets.c 21 Jan 2004 14:44:53 -0000 1.2 +++ sockets.c 20 May 2004 19:31:48 -0000 1.3 @@ -89,10 +89,12 @@ struct socket_info { }; static int sockets_inop_close(struct inode *ino); -static int sockets_inop_ipreadv(struct inode *ino, +static int sockets_inop_read(struct inode *ino, struct ioctx *ioctx); -static int sockets_inop_ipwritev(struct inode *ino, +static int sockets_inop_write(struct inode *ino, struct ioctx *ioctxp); +static _SYSIO_OFF_T sockets_inop_pos(struct inode *ino, + _SYSIO_OFF_T off); static int sockets_inop_iodone(struct ioctx *ioctx); static int sockets_inop_sync(struct inode *ino); static int sockets_inop_datasync(struct inode *ino); @@ -125,8 +127,9 @@ _sysio_sockets_init() sockets_i_ops = _sysio_nodev_ops; sockets_i_ops.inop_close = sockets_inop_close; - sockets_i_ops.inop_ipreadv = sockets_inop_ipreadv; - sockets_i_ops.inop_ipwritev = sockets_inop_ipwritev; + sockets_i_ops.inop_read = sockets_inop_read; + sockets_i_ops.inop_write = sockets_inop_write; + sockets_i_ops.inop_pos = sockets_inop_pos; sockets_i_ops.inop_iodone = sockets_inop_iodone; sockets_i_ops.inop_fcntl = sockets_inop_fcntl; sockets_i_ops.inop_sync = sockets_inop_sync; @@ -172,6 +175,12 @@ doio(ssize_t (*f)(int, const struct iove assert(ski->ski_fd >= 0); + /* XXX there's no way to check the position + * here we only could ingore the extends + */ + if (ioctx->ioctx_xtvlen != 1) + return -EINVAL; + if (ioctx->ioctx_iovlen && (int) ioctx->ioctx_iovlen < 0) return -EINVAL; @@ -180,7 +189,7 @@ doio(ssize_t (*f)(int, const struct iove * transfer the data now. */ ioctx->ioctx_cc = - (*f)(ski->ski_fd, ioctx->ioctx_iovec, ioctx->ioctx_iovlen); + (*f)(ski->ski_fd, ioctx->ioctx_iov, ioctx->ioctx_iovlen); if (ioctx->ioctx_cc < 0) ioctx->ioctx_errno = errno; @@ -199,7 +208,7 @@ _readv(int fd, const struct iovec *vecto } static int -sockets_inop_ipreadv(struct inode *ino, +sockets_inop_read(struct inode *ino, struct ioctx *ioctx) { @@ -217,13 +226,19 @@ _writev(int fd, const struct iovec *vect } static int -sockets_inop_ipwritev(struct inode *ino, +sockets_inop_write(struct inode *ino, struct ioctx *ioctx) { return doio(_writev, ino, ioctx); } +static _SYSIO_OFF_T +sockets_inop_pos(struct inode *ino, _SYSIO_OFF_T off) +{ + return -EINVAL; +} + static int sockets_inop_iodone(struct ioctx *ioctxp __IS_UNUSED) { @@ -454,8 +469,6 @@ error: return -1; } -#if 0 - int bind(int sockfd, const struct sockaddr *my_addr, socklen_t addrlen) { @@ -471,12 +484,12 @@ bind(int sockfd, const struct sockaddr * goto out; } - avec[0] = I2SKI(fil->f_ino)->ski_fd; - avec[1] = (unsigned long )my_addr; - avec[2] = addrlen; #ifndef SYS_socketcall if (syscall(SYS_bind, I2SKI(fil->f_ino)->ski_fd, my_addr, addrlen)) { #else + avec[0] = I2SKI(fil->f_ino)->ski_fd; + avec[1] = (unsigned long )my_addr; + avec[2] = addrlen; if (syscall(SYS_socketcall, SYS_BIND, avec) != 0) { #endif err = -errno; @@ -504,11 +517,11 @@ listen(int s, int backlog) goto out; } - avec[0] = I2SKI(fil->f_ino)->ski_fd; - avec[1] = backlog; #ifndef SYS_socketcall if (syscall(SYS_listen, I2SKI(fil->f_ino)->ski_fd, backlog) != 0) { #else + avec[0] = I2SKI(fil->f_ino)->ski_fd; + avec[1] = backlog; if (syscall(SYS_socketcall, SYS_LISTEN, avec) != 0) { #endif err = -errno; @@ -536,12 +549,13 @@ connect(int sockfd, const struct sockadd goto out; } +#ifndef SYS_socketcall + if (syscall(SYS_connect, I2SKI(fil->f_ino)->ski_fd, + serv_addr, addrlen) != 0) { +#else avec[0] = I2SKI(fil->f_ino)->ski_fd; avec[1] = (unsigned long )serv_addr; avec[2] = addrlen; -#ifndef SYS_socketcall - if (syscall(SYS_connect, I2SKI(fil->f_ino)->ski_fd, serv_addr, addrlen) != 0) { -#else if (syscall(SYS_socketcall, SYS_CONNECT, avec) != 0) { #endif err = -errno; @@ -553,4 +567,3 @@ out: errno = -err; return -1; } -#endif |
From: Sonja T. <so...@us...> - 2004-05-17 14:03:46
|
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31721/tests Modified Files: test_regions.c Log Message: Fixing compiler warning. Index: test_regions.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_regions.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -b -B -p -r1.3 -r1.4 --- test_regions.c 14 Feb 2004 19:43:00 -0000 1.3 +++ test_regions.c 17 May 2004 14:03:37 -0000 1.4 @@ -267,7 +267,7 @@ main(int argc, char * const argv[]) #endif (long )cc, #ifdef GO64 - off64 + (long long int)off64 #else off #endif |
From: Sonja T. <so...@us...> - 2004-05-05 19:05:47
|
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24293/tests Modified Files: test_all.pl test_copy.pl Log Message: More test fixes: -- Don't remove the tmp directory if a test failed, to allow for someone to investigate the failure. Perhaps this should be a switch??? -- In test_copy.pl, check the output status of comparison to distinguish between the case where the two files differ and the case where the comparison command returned some failure Index: test_all.pl =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_all.pl,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -b -B -p -r1.11 -r1.12 --- test_all.pl 3 May 2004 21:07:13 -0000 1.11 +++ test_all.pl 5 May 2004 19:05:36 -0000 1.12 @@ -204,7 +204,8 @@ if ($res ne "strided IO test successful" print "$failures tests failed and $success tests succeeded\n"; -# cleanup +# cleanup -- only if no failures +if ($failures == 0) { if ($use_system == 1) { system(`rm -rf $cwd/tmp_dir`); } else { @@ -215,4 +216,5 @@ if ($use_system == 1) { exit 1; } } +} exit $failures; Index: test_copy.pl =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_copy.pl,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -b -B -p -r1.7 -r1.8 --- test_copy.pl 3 May 2004 21:07:13 -0000 1.7 +++ test_copy.pl 5 May 2004 19:05:37 -0000 1.8 @@ -172,9 +172,16 @@ sub process_cmd helper::send_cmd($cmdfh, $outfh, "close", $cmdstr); } if ($src ne "/dev/stdin") { - my $cmpres = system("cmp -s $src $dest"); - if ($cmpres != 0) { + my $cmd = "cmp $src $dest " . '2>&1'; + my $cmpstr = qx($cmd); + my $exitval = $? >> 8; + if ($exitval != 0) { + if ($exitval == 1) { print STDOUT "ERROR! File $src differs from $dest\n"; + print STDOUT "Comparison returned $cmpstr"; + } else { + print STDOUT "ERROR! File comparison failed with msg $cmpstr"; + } exit 1; } } |
From: Sonja T. <so...@us...> - 2004-05-03 21:07:36
|
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv459/tests Modified Files: test_all.pl test_copy.pl Log Message: Minor changes to help in diagnosing testing problems Index: test_all.pl =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_all.pl,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- test_all.pl 11 Mar 2004 14:40:53 -0000 1.10 +++ test_all.pl 3 May 2004 21:07:13 -0000 1.11 @@ -148,7 +148,7 @@ if ($res ne "copy test successful") { } # Test stats -$res = `perl $testdir/test_stats.pl $alpha_arg $use_system $cwd/tmp_dir/helper.pm`; +$res = `perl $testdir/test_stats.pl $alpha_arg $use_system $cwd/tmp_dir/test1/helper.pm`; chop($res); if ($res ne "stat test successful") { print "stat test failed with message: $res\n"; @@ -170,7 +170,7 @@ if ($res ne "copy test successful") { } # Test symlink -$res = `perl $testdir/test_symlink.pl $alpha_arg $cwd/tmp_dir/helper.pm $cwd/tmp_dir/helper.foo`; +$res = `perl $testdir/test_symlink.pl $alpha_arg $cwd/tmp_dir/test1/helper.pm $cwd/tmp_dir/helper.foo`; chop($res); if ($res ne "Symlink test successful") { print "symlink test failed with message: $res\n"; Index: test_copy.pl =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_copy.pl,v retrieving revision 1.6 retrieving revision 1.7 diff -u -w -b -B -p -r1.6 -r1.7 --- test_copy.pl 12 Apr 2004 19:31:36 -0000 1.6 +++ test_copy.pl 3 May 2004 21:07:13 -0000 1.7 @@ -81,7 +81,7 @@ sub process_cmd if ($overwrite == 0) { $flags .= "|O_EXCL"; } - $cmdstr = '$dest = CALL open '."$dest $flags 0666\n"; + $cmdstr = '$dest = CALL open '."$dest $flags 0777\n"; helper::send_cmd($cmdfh, $outfh, "open", $cmdstr); my $destfile = helper::verify_cmd($cmdfh, $outfh, "open $dest"); } |
From: Ruth K. <rk...@us...> - 2004-04-30 19:25:06
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19095 Modified Files: sysio.h Log Message: addition of some missing name label macro calls; some style fixes Index: sysio.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio.h,v retrieving revision 1.21 retrieving revision 1.22 diff -u -w -b -B -p -r1.21 -r1.22 |
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19042 Modified Files: access.c chdir.c chmod.c chown.c dup.c fcntl.c ioctl.c link.c lseek.c mkdir.c mknod.c rmdir.c rw.c stat.c stat64.c statvfs.c statvfs64.c symlink.c truncate.c unlink.c Log Message: addition of some missing name label macro calls; some style fixes Index: access.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/access.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -b -B -p -r1.5 -r1.6 --- access.c 28 Apr 2004 11:21:30 -0000 1.5 +++ access.c 30 Apr 2004 19:24:46 -0000 1.6 @@ -76,7 +76,7 @@ SYSIO_INTERFACE_NAME(access)(const char if (err != (int ) n) goto out; - err = stat(path, &stbuf); + err = SYSIO_INTERFACE_NAME(stat)(path, &stbuf); if (err) { err = -errno; goto out; @@ -118,5 +118,6 @@ out: #ifdef REDSTORM #undef __access -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(access), __access) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(access), + PREPEND(__, SYSIO_INTERFACE_NAME(access))) #endif Index: chdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chdir.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -w -b -B -p -r1.16 -r1.17 --- chdir.c 28 Apr 2004 11:21:30 -0000 1.16 +++ chdir.c 30 Apr 2004 19:24:46 -0000 1.17 @@ -133,7 +133,8 @@ SYSIO_INTERFACE_NAME(chdir)(const char * #ifdef REDSTORM #undef __chdir -sysio_sym_weak_alias(chdir, __chdir) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(chdir), + PREPEND(__, SYSIO_INTERFACE_NAME(chdir))) #endif /* @@ -235,7 +236,9 @@ SYSIO_INTERFACE_NAME(getcwd)(char *buf, } #ifdef __GLIBC__ -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(getcwd), __getcwd) +#undef __getcwd +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(getcwd), + PREPEND(__, SYSIO_INTERFACE_NAME(getcwd))) #endif #if defined(PATH_MAX) && !(defined(REDSTORM)) @@ -248,6 +251,6 @@ SYSIO_INTERFACE_NAME(getwd)(char *buf) return NULL; } - return getcwd(buf, PATH_MAX); + return SYSIO_INTERFACE_NAME(getcwd)(buf, PATH_MAX); } #endif Index: chmod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chmod.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -b -B -p -r1.11 -r1.12 --- chmod.c 28 Apr 2004 21:46:45 -0000 1.11 +++ chmod.c 30 Apr 2004 19:24:46 -0000 1.12 @@ -87,7 +87,8 @@ out: #ifdef REDSTORM #undef __chmod -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(chmod), __chmod) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(chmod), + PREPEND(__, SYSIO_INTERFACE_NAME(chmod))) #endif int @@ -112,5 +113,6 @@ out: #ifdef REDSTORM #undef __fchmod -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(fchmod), __fchmod) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(fchmod), + PREPEND(__, SYSIO_INTERFACE_NAME(fchmod))) #endif Index: chown.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chown.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- chown.c 28 Apr 2004 21:15:56 -0000 1.10 +++ chown.c 30 Apr 2004 19:24:46 -0000 1.11 @@ -95,7 +95,8 @@ out: #ifdef REDSTORM #undef __chown -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(chown), __chown) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(chown), + PREPEND(__, SYSIO_INTERFACE_NAME(chown))) #endif int @@ -120,6 +121,7 @@ out: #ifdef REDSTORM #undef __fchown -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(fchown), __fchown) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(fchown), + PREPEND(__, SYSIO_INTERFACE_NAME(fchown))) #endif Index: dup.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/dup.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -b -B -p -r1.7 -r1.8 --- dup.c 28 Apr 2004 11:21:30 -0000 1.7 +++ dup.c 30 Apr 2004 19:24:46 -0000 1.8 @@ -75,7 +75,8 @@ SYSIO_INTERFACE_NAME(dup2)(int oldfd, in #ifdef REDSTORM #undef __dup2 -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(dup2), __dup2) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(dup2), + PREPEND(__, SYSIO_INTERFACE_NAME(dup2))) #endif int @@ -91,5 +92,6 @@ SYSIO_INTERFACE_NAME(dup)(int oldfd) #ifdef __GLIBC__ #undef __dup -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(dup), __dup) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(dup), + PREPEND(__, SYSIO_INTERFACE_NAME(dup))) #endif Index: fcntl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fcntl.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- fcntl.c 28 Apr 2004 11:21:30 -0000 1.10 +++ fcntl.c 30 Apr 2004 19:24:46 -0000 1.11 @@ -98,10 +98,12 @@ out: #ifdef __GLIBC__ #undef __fcntl -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(fcntl), __fcntl) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(fcntl), + PREPEND(__, SYSIO_INTERFACE_NAME(fcntl))) #endif #ifdef BSD #undef _fcntl -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(fcntl), _fcntl) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(fcntl), + PREPEND(_, SYSIO_INTERFACE_NAME(fcntl))) #endif Index: ioctl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctl.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -w -b -B -p -r1.8 -r1.9 --- ioctl.c 28 Apr 2004 11:21:30 -0000 1.8 +++ ioctl.c 30 Apr 2004 19:24:46 -0000 1.9 @@ -79,10 +79,12 @@ out: #ifdef __GLIBC__ #undef __ioctl -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(ioctl), __ioctl) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(ioctl), + PREPEND(__, SYSIO_INTERFACE_NAME(ioctl))) #endif #ifdef BSD #undef _ioctl -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(ioctl), _ioctl) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(ioctl), + PREPEND(_, SYSIO_INTERFACE_NAME(ioctl))) #endif Index: link.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/link.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -b -B -p -r1.7 -r1.8 --- link.c 28 Apr 2004 11:21:30 -0000 1.7 +++ link.c 30 Apr 2004 19:24:46 -0000 1.8 @@ -104,5 +104,6 @@ out: #ifdef REDSTORM #undef __link -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(link), __link) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(link), + PREPEND(__, SYSIO_INTERFACE_NAME(link))) #endif Index: lseek.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/lseek.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -w -b -B -p -r1.18 -r1.19 --- lseek.c 28 Apr 2004 11:21:30 -0000 1.18 +++ lseek.c 30 Apr 2004 19:24:46 -0000 1.19 @@ -116,11 +116,12 @@ _sysio_lseek(int fd, _SYSIO_OFF_T offset sysio_sym_weak_alias(_sysio_lseek, SYSIO_INTERFACE_NAME(lseek64)) #ifdef __GLIBC__ #undef __lseek64 -sysio_sym_weak_alias(_sysio_lseek, __lseek64) +sysio_sym_weak_alias(_sysio_lseek, PREPEND(__, SYSIO_INTERFACE_NAME(lseek64))) #endif #ifdef REDSTORM #undef __libc_lseek64 -sysio_sym_weak_alias(_sysio_lseek, __libc_lseek64) +sysio_sym_weak_alias(_sysio_lseek, + PREPEND(__, SYSIO_INTERFACE_NAME(libc_lseek64))) #endif #endif @@ -144,7 +145,8 @@ SYSIO_INTERFACE_NAME(lseek)(int fd, off_ #ifdef __GLIBC__ #undef __lseek -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(lseek), __lseek) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(lseek), + PREPEND(__, SYSIO_INTERFACE_NAME(lseek))) #endif #if 0 @@ -167,6 +169,7 @@ SYSIO_INTERFACE_NAME(llseek)(unsigned in } #undef __llseek -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(llseek), __llseek) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(llseek), + PREPEND(__, SYSIO_INTERFACE_NAME(llseek))) #endif #endif Index: mkdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mkdir.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- mkdir.c 28 Apr 2004 21:15:58 -0000 1.10 +++ mkdir.c 30 Apr 2004 19:24:46 -0000 1.11 @@ -84,5 +84,6 @@ out: #ifdef REDSTORM #undef __mkdir -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(mkdir), __mkdir) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(mkdir), + PREPEND(__, SYSIO_INTERFACE_NAME(mkdir))) #endif Index: mknod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mknod.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -w -b -B -p -r1.12 -r1.13 --- mknod.c 28 Apr 2004 11:21:30 -0000 1.12 +++ mknod.c 30 Apr 2004 19:24:46 -0000 1.13 @@ -114,7 +114,8 @@ out: #ifdef REDSTORM #undef _xmknod -sysio_sym_weak_alias(PREPEND(__,SYSIO_INTERFACE_NAME(xmknod)), _xmknod) +sysio_sym_weak_alias(PREPEND(__, SYSIO_INTERFACE_NAME(xmknod)), + PREPEND(_, SYSIO_INTERFACE_NAME(xmknod))) #endif static int @@ -129,5 +130,5 @@ PREPEND(__,SYSIO_INTERFACE_NAME(mknod))( &dev); } -sysio_sym_weak_alias(PREPEND(__,SYSIO_INTERFACE_NAME(mknod)), \ +sysio_sym_weak_alias(PREPEND(__, SYSIO_INTERFACE_NAME(mknod)), SYSIO_INTERFACE_NAME(mknod)) Index: rmdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rmdir.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -w -b -B -p -r1.12 -r1.13 --- rmdir.c 28 Apr 2004 21:15:58 -0000 1.12 +++ rmdir.c 30 Apr 2004 19:24:46 -0000 1.13 @@ -54,7 +54,7 @@ #include "sysio-symbols.h" int -rmdir(const char *path) +SYSIO_INTERFACE_NAME(rmdir)(const char *path) { struct intent intent; int err; @@ -92,5 +92,6 @@ out: #ifdef REDSTORM #undef __rmdir -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(rmdir), __rmdir) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(rmdir), + PREPEND(__, SYSIO_INTERFACE_NAME(rmdir))) #endif Index: rw.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rw.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -b -B -p -r1.7 -r1.8 --- rw.c 28 Apr 2004 11:21:46 -0000 1.7 +++ rw.c 30 Apr 2004 19:24:46 -0000 1.8 @@ -300,9 +300,11 @@ SYSIO_INTERFACE_NAME(readv)(int fd, cons #if defined(__GLIBC__) #undef __readv -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(readv), __readv) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(readv), + PREPEND(__, SYSIO_INTERFACE_NAME(readv))) #undef __libc_readv -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(readv), __libc_readv) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(readv), + PREPEND(__, SYSIO_INTERFACE_NAME(libc_readv))) #endif static void @@ -384,9 +386,11 @@ SYSIO_INTERFACE_NAME(read)(int fd, void #ifdef __GLIBC__ #undef __read -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(read), __read) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(read), + PREPEND(__, SYSIO_INTERFACE_NAME(read))) #undef __libc_read -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(read), __libc_read) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(read), + PREPEND(__, SYSIO_INTERFACE_NAME(libc_read))) #endif /* @@ -464,7 +468,7 @@ PREPEND(_,SYSIO_INTERFACE_NAME(ipreadv)) #if _LARGEFILE64_SOURCE #undef ipread64v -sysio_sym_weak_alias(PREPEND(_,SYSIO_INTERFACE_NAME(ipreadv)), \ +sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(ipreadv)), SYSIO_INTERFACE_NAME(ipread64v)) #endif @@ -578,7 +582,7 @@ error: #if _LARGEFILE64_SOURCE #undef ipread64 -sysio_sym_weak_alias(PREPEND(_,SYSIO_INTERFACE_NAME(ipread)), \ +sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(ipread)), SYSIO_INTERFACE_NAME(ipread64)) #endif @@ -632,13 +636,15 @@ PREPEND(_,SYSIO_INTERFACE_NAME(pread))(i #if _LARGEFILE64_SOURCE #undef pread64 -sysio_sym_weak_alias(PREPEND(_,SYSIO_INTERFACE_NAME(pread)), \ +sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(pread)), SYSIO_INTERFACE_NAME(pread64)) #if __GLIBC__ #undef __pread64 -sysio_sym_weak_alias(PREPEND(_,SYSIO_INTERFACE_NAME(pread)), __pread64) +sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(pread)), + PREPEND(__, SYSIO_INTERFACE_NAME(pread64))) #undef __libc_pread64 -sysio_sym_weak_alias(PREPEND(_,SYSIO_INTERFACE_NAME(pread)), __libc_pread64) +sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(pread)), + PREPEND(__, SYSIO_INTERFACE_NAME(libc_pread64))) #endif #endif @@ -654,15 +660,19 @@ SYSIO_INTERFACE_NAME(pread)(int fd, void #if __GLIBC__ #undef __pread -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(pread), __pread) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(pread), + PREPEND(__, SYSIO_INTERFACE_NAME(pread))) #undef __libc_pread -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(pread), __libc_pread) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(pread), + PREPEND(__, SYSIO_INTERFACE_NAME(libc_pread))) #endif static ioid_t PREPEND(_,SYSIO_INTERFACE_NAME(ireadx))(int fd, - const struct iovec *iov, size_t iov_count, - const struct intnl_xtvec *xtv, size_t xtv_count) + const struct iovec *iov, + size_t iov_count, + const struct intnl_xtvec *xtv, + size_t xtv_count) { struct file *fil; int err; @@ -687,7 +697,7 @@ PREPEND(_,SYSIO_INTERFACE_NAME(ireadx))( #if _LARGEFILE64_SOURCE #undef iread64x -sysio_sym_weak_alias(PREPEND(_,SYSIO_INTERFACE_NAME(ireadx)), \ +sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(ireadx)), SYSIO_INTERFACE_NAME(iread64x)) #endif @@ -736,7 +746,7 @@ SYSIO_INTERFACE_NAME(ireadx)(int fd, } #else #undef ireadx -sysio_sym_weak_alias(PREPEND(_,SYSIO_INTERFACE_NAME(ireadx)), \ +sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(ireadx)), SYSIO_INTERFACE_NAME(ireadx)) #endif @@ -785,8 +795,10 @@ read_list(int fd, int64_t file_offsets[], int32_t file_lengths[]) { - errno = ENOSYS; - return -1; + SYSIO_INTERFACE_DISPLAY_BLOCK; + + SYSIO_INTERFACE_ENTER; + SYSIO_INTERFACE_RETURN(-1, -ENOSYS); } #endif @@ -852,9 +864,11 @@ SYSIO_INTERFACE_NAME(writev)(int fd, con #ifdef __GLIBC__ #undef __writev -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(writev), __writev) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(writev), + PREPEND(__, SYSIO_INTERFACE_NAME(writev))) #undef __libc_writev -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(writev), __libc_writev) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(writev), + PREPEND(__, SYSIO_INTERFACE_NAME(libc_writev))) #endif ioid_t @@ -929,9 +943,11 @@ SYSIO_INTERFACE_NAME(write)(int fd, cons #ifdef __GLIBC__ #undef __write -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(write), __write) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(write), + PREPEND(__, SYSIO_INTERFACE_NAME(write))) #undef __libc_write -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(write), __libc_write) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(write), + PREPEND(__, SYSIO_INTERFACE_NAME(libc_write))) #endif static ioid_t @@ -971,7 +987,7 @@ PREPEND(_,SYSIO_INTERFACE_NAME(ipwritev) #if _LARGEFILE64_SOURCE #undef ipwrite64v -sysio_sym_weak_alias(PREPEND(_,SYSIO_INTERFACE_NAME(ipwritev)), \ +sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(ipwritev)), SYSIO_INTERFACE_NAME(ipwrite64v)) #endif @@ -1085,7 +1101,7 @@ error: #if _LARGEFILE64_SOURCE #undef ipwrite64 -sysio_sym_weak_alias(PREPEND(_,SYSIO_INTERFACE_NAME(ipwrite)), \ +sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(ipwrite)), SYSIO_INTERFACE_NAME(ipwrite64)) #endif @@ -1139,13 +1155,15 @@ PREPEND(_,SYSIO_INTERFACE_NAME(pwrite))( #if _LARGEFILE64_SOURCE #undef pwrite64 -sysio_sym_weak_alias(PREPEND(_,SYSIO_INTERFACE_NAME(pwrite)), \ +sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(pwrite)), SYSIO_INTERFACE_NAME(pwrite64)) #ifdef __GLIBC #undef __pwrite64 -sysio_sym_weak_alias(PREPEND(_,SYSIO_INTERFACE_NAME(pwrite)), __pwrite64) +sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(pwrite)), + PREPEND(__, SYSIO_INTERFACE_NAME(pwrite64))) #undef __libc_pwrite64 -sysio_sym_weak_alias(PREPEND(_,SYSIO_INTERFACE_NAME(pwrite)), __libc_pwrite64) +sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(pwrite)), + PREPEND(__, SYSIO_INTERFACE_NAME(libc_pwrite64))) #endif #endif @@ -1165,12 +1183,15 @@ SYSIO_INTERFACE_NAME(pwrite)(int fd, #ifdef __GLIBC #undef __libc_pwrite sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(pwrite), __libc_pwrite) + PREPEND(__, SYSIO_INTERFACE_NAME(libc_pwrite))) #endif static ioid_t PREPEND(_,SYSIO_INTERFACE_NAME(iwritex))(int fd, - const struct iovec *iov, size_t iov_count, - const struct intnl_xtvec *xtv, size_t xtv_count) + const struct iovec *iov, + size_t iov_count, + const struct intnl_xtvec *xtv, + size_t xtv_count) { struct file *fil; int err; @@ -1195,7 +1216,7 @@ PREPEND(_,SYSIO_INTERFACE_NAME(iwritex)) #if _LARGEFILE64_SOURCE #undef iwrite64x -sysio_sym_weak_alias(PREPEND(_,SYSIO_INTERFACE_NAME(iwritex)), \ +sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(iwritex)), SYSIO_INTERFACE_NAME(iwrite64x)) #endif @@ -1244,7 +1265,7 @@ SYSIO_INTERFACE_NAME(iwritex)(int fd, } #else #undef iwritex -sysio_sym_weak_alias(PREPEND(_,SYSIO_INTERFACE_NAME(iwritex)), \ +sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(iwritex)), SYSIO_INTERFACE_NAME(iwritex)) #endif @@ -1295,7 +1316,9 @@ write_list(int fd, int64_t file_offsets[], int32_t file_lengths[]) { - errno = ENOSYS; - return -1; + SYSIO_INTERFACE_DISPLAY_BLOCK; + + SYSIO_INTERFACE_ENTER; + SYSIO_INTERFACE_RETURN(-1, -ENOSYS); } #endif Index: stat.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/stat.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -w -b -B -p -r1.13 -r1.14 --- stat.c 28 Apr 2004 11:21:46 -0000 1.13 +++ stat.c 30 Apr 2004 19:24:46 -0000 1.14 @@ -131,7 +131,8 @@ out: #ifdef REDSTORM #undef _fxstat -sysio_sym_weak_alias(PREPEND(__,SYSIO_INTERFACE_NAME(fxstat)), _fxstat) +sysio_sym_weak_alias(PREPEND(__, SYSIO_INTERFACE_NAME(fxstat)), + PREPEND(_, SYSIO_INTERFACE_NAME(fxstat))) #endif #ifndef REDSTORM @@ -149,7 +150,8 @@ sysio_sym_weak_alias(PREPEND(__, SYSIO_I #ifdef BSD #undef _fstat -sysio_sym_weak_alias(PREPEND(__,SYSIO_INTERFACE_NAME(fstat)), _fstat) +sysio_sym_weak_alias(PREPEND(__, SYSIO_INTERFACE_NAME(fstat)), + PREPEND(_, SYSIO_INTERFACE_NAME(fstat))) #endif #endif @@ -200,7 +202,8 @@ out: #ifdef REDSTORM #undef _xstat -sysio_sym_weak_alias(PREPEND(__,SYSIO_INTERFACE_NAME(xstat)), _xstat) +sysio_sym_weak_alias(PREPEND(__, SYSIO_INTERFACE_NAME(xstat)), + PREPEND(_, SYSIO_INTERFACE_NAME(xstat))) #endif #ifndef REDSTORM @@ -219,7 +222,8 @@ sysio_sym_weak_alias(PREPEND(__,SYSIO_IN #ifdef BSD #undef _stat -sysio_sym_weak_alias(PREPEND(__,SYSIO_INTERFACE_NAME(stat)), _stat) +sysio_sym_weak_alias(PREPEND(__, SYSIO_INTERFACE_NAME(stat)), + PREPEND(_, SYSIO_INTERFACE_NAME(stat))) #endif #endif @@ -270,7 +274,8 @@ out: #ifdef REDSTORM #undef _lxstat -sysio_sym_weak_alias(PREPEND(__,SYSIO_INTERFACE_NAME(lxstat)), _lxstat) +sysio_sym_weak_alias(PREPEND(__, SYSIO_INTERFACE_NAME(lxstat)), + PREPEND(_, SYSIO_INTERFACE_NAME(lxstat))) #endif #ifndef REDSTORM @@ -287,6 +292,7 @@ sysio_sym_weak_alias(PREPEND(__,SYSIO_IN #ifdef BSD #undef _lstat -sysio_sym_weak_alias(PREPEND(__,SYSIO_INTERFACE_NAME(lstat)), _lstat) +sysio_sym_weak_alias(PREPEND(__, SYSIO_INTERFACE_NAME(lstat)), + PREPEND(_, SYSIO_INTERFACE_NAME(lstat))) #endif #endif Index: stat64.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/stat64.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -b -B -p -r1.9 -r1.10 Index: statvfs.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/statvfs.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -b -B -p -r1.9 -r1.10 --- statvfs.c 28 Apr 2004 11:21:46 -0000 1.9 +++ statvfs.c 30 Apr 2004 19:24:46 -0000 1.10 @@ -109,7 +109,8 @@ out: #ifdef REDSTORM #undef __statvfs -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(statvfs), __statvfs) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(statvfs), + PREPEND(__, SYSIO_INTERFACE_NAME(statvfs))) #endif int @@ -147,7 +148,8 @@ out: #ifdef REDSTORM #undef __fstatvfs -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(fstatvfs), __fstatvfs) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(fstatvfs), + PREPEND(__, SYSIO_INTERFACE_NAME(fstatvfs))) #endif #endif /* ifndef BSD */ Index: statvfs64.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/statvfs64.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -b -B -p -r1.11 -r1.12 --- statvfs64.c 28 Apr 2004 11:21:46 -0000 1.11 +++ statvfs64.c 30 Apr 2004 19:24:46 -0000 1.12 @@ -74,7 +74,8 @@ out: #ifdef REDSTORM #undef __statvfs64 -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(statvfs64), __statvfs64) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(statvfs64), + PREPEND(__, SYSIO_INTERFACE_NAME(statvfs64))) #endif int @@ -99,7 +100,8 @@ out: #ifdef REDSTORM #undef __fstatvfs64 -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(fstatvfs64), __fstatvfs64) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(fstatvfs64), + PREPEND(__, SYSIO_INTERFACE_NAME(fstatvfs64))) #endif #endif /* ifndef BSD */ Index: symlink.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/symlink.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -w -b -B -p -r1.8 -r1.9 --- symlink.c 28 Apr 2004 11:21:46 -0000 1.8 +++ symlink.c 30 Apr 2004 19:24:46 -0000 1.9 @@ -85,5 +85,6 @@ out: #ifdef REDSTORM #undef __symlink -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(symlink), __symlink) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(symlink), + PREPEND(__, SYSIO_INTERFACE_NAME(symlink))) #endif Index: truncate.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/truncate.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -b -B -p -r1.9 -r1.10 --- truncate.c 28 Apr 2004 11:21:46 -0000 1.9 +++ truncate.c 30 Apr 2004 19:24:46 -0000 1.10 @@ -103,7 +103,7 @@ out: #if _LARGEFILE64_SOURCE #undef truncate64 -sysio_sym_weak_alias(PREPEND(_,SYSIO_INTERFACE_NAME(truncate)), \ +sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(truncate)), SYSIO_INTERFACE_NAME(truncate64)) #undef truncate @@ -115,7 +115,7 @@ SYSIO_INTERFACE_NAME(truncate)(const cha } #else #undef truncate -sysio_sym_weak_alias(PREPEND(_,SYSIO_INTERFACE_NAME(truncate)), \ +sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(truncate)), SYSIO_INTERFACE_NAME(truncate)) #endif @@ -140,7 +140,8 @@ out: #if _LARGEFILE64_SOURCE #undef ftruncate64 -sysio_sym_weak_alias(PREPEND(_,SYSIO_INTERFACE_NAME(ftruncate)), SYSIO_INTERFACE_NAME(ftruncate64)) +sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(ftruncate)), + SYSIO_INTERFACE_NAME(ftruncate64)) #undef ftruncate int @@ -151,5 +152,6 @@ SYSIO_INTERFACE_NAME(ftruncate)(int fd, } #else #undef ftruncate -sysio_sym_weak_alias(PREPEND(_,SYSIO_INTERFACE_NAME(ftruncate)), SYSIO_INTERFACE_NAME(ftruncate)) +sysio_sym_weak_alias(PREPEND(_, SYSIO_INTERFACE_NAME(ftruncate)), + SYSIO_INTERFACE_NAME(ftruncate)) #endif Index: unlink.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/unlink.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -b -B -p -r1.11 -r1.12 --- unlink.c 28 Apr 2004 11:21:46 -0000 1.11 +++ unlink.c 30 Apr 2004 19:24:46 -0000 1.12 @@ -98,5 +98,6 @@ out: #ifdef REDSTORM #undef __unlink -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(unlink), __unlink) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(unlink), + PREPEND(__, SYSIO_INTERFACE_NAME(unlink))) #endif |
From: Ruth K. <rk...@us...> - 2004-04-28 21:46:54
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24864 Modified Files: chmod.c Log Message: fix typos - from Kevin Pedretti Index: chmod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chmod.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- chmod.c 28 Apr 2004 20:42:32 -0000 1.10 +++ chmod.c 28 Apr 2004 21:46:45 -0000 1.11 @@ -87,7 +87,7 @@ out: #ifdef REDSTORM #undef __chmod -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(chmod)), __chmod) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(chmod), __chmod) #endif int @@ -112,5 +112,5 @@ out: #ifdef REDSTORM #undef __fchmod -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(fchmod)), __fchmod) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(fchmod), __fchmod) #endif |
From: Ruth K. <rk...@us...> - 2004-04-28 21:16:15
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16810 Modified Files: chown.c getdirentries.c mkdir.c rmdir.c Log Message: fix typos - from Kevin Pedretti Index: chown.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chown.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -b -B -p -r1.9 -r1.10 --- chown.c 28 Apr 2004 11:21:30 -0000 1.9 +++ chown.c 28 Apr 2004 21:15:56 -0000 1.10 @@ -95,7 +95,7 @@ out: #ifdef REDSTORM #undef __chown -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(chown)), __chown) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(chown), __chown) #endif int @@ -120,6 +120,6 @@ out: #ifdef REDSTORM #undef __fchown -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(fchown)), __fchown) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(fchown), __fchown) #endif Index: getdirentries.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/getdirentries.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -w -b -B -p -r1.13 -r1.14 --- getdirentries.c 28 Apr 2004 11:21:30 -0000 1.13 +++ getdirentries.c 28 Apr 2004 21:15:58 -0000 1.14 @@ -297,11 +297,11 @@ sysio_sym_strong_alias(PREPEND(_, SYSIO_ #ifdef REDSTORM #undef __getdirentries -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(getdirentries)), +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(getdirentries), PREPEND(__, SYSIO_INTERFACE_NAME(getdirentries))) #endif #if defined(BSD) || defined(REDSTORM) #undef _getdirentries -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(getdirentries)), +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(getdirentries), PREPEND(_, SYSIO_INTERFACE_NAME(getdirentries))) #endif Index: mkdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mkdir.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -b -B -p -r1.9 -r1.10 --- mkdir.c 28 Apr 2004 20:39:19 -0000 1.9 +++ mkdir.c 28 Apr 2004 21:15:58 -0000 1.10 @@ -84,5 +84,5 @@ out: #ifdef REDSTORM #undef __mkdir -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(mkdir)), __mkdir) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(mkdir), __mkdir) #endif Index: rmdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rmdir.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -b -B -p -r1.11 -r1.12 --- rmdir.c 28 Apr 2004 11:21:46 -0000 1.11 +++ rmdir.c 28 Apr 2004 21:15:58 -0000 1.12 @@ -92,5 +92,5 @@ out: #ifdef REDSTORM #undef __rmdir -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(rmdir)), __rmdir) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(rmdir), __rmdir) #endif |
From: Ruth K. <rk...@us...> - 2004-04-28 20:42:54
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8364 Modified Files: chmod.c Log Message: fix incorrect alias - from Kevin Pedretti Index: chmod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chmod.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -b -B -p -r1.9 -r1.10 --- chmod.c 28 Apr 2004 11:21:30 -0000 1.9 +++ chmod.c 28 Apr 2004 20:42:32 -0000 1.10 @@ -112,5 +112,5 @@ out: #ifdef REDSTORM #undef __fchmod -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(fchmod)), __chmod) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(fchmod)), __fchmod) #endif |
From: Ruth K. <rk...@us...> - 2004-04-28 20:39:28
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7580 Modified Files: mkdir.c Log Message: remove redundant alias - from Kevin Pedretti Index: mkdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mkdir.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -w -b -B -p -r1.8 -r1.9 --- mkdir.c 28 Apr 2004 11:21:30 -0000 1.8 +++ mkdir.c 28 Apr 2004 20:39:19 -0000 1.9 @@ -84,6 +84,5 @@ out: #ifdef REDSTORM #undef __mkdir -sysio_sym_weak_alias(mkdir, __mkdir) sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(mkdir)), __mkdir) #endif |
From: Lee W. <lw...@us...> - 2004-04-28 12:23:27
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31477/include Modified Files: file.h inode.h Log Message: From Sue Kelly; Mike says it shows an unlink, followed by 2 closes, all on the same fd.The second close is getting the assert failure, I guess. We weren't tracking the number of soft references on the inode with file open/close. Hence, it was always 1. When unlink was called, it tries to whack the inode. We've implemented zombie inode code but since there was only one reference, the inode would immediately die. Then, the file close code would try to close it again. However, the inode had already been free'd. Some paranoia in the lower code cleared fields before releasing the memory to protect against just such an event. Voila, instant assertion. Good for us. The fix, of course, is to address the root cause. Inode open/close pairs are now tracked in the file code by referencing and dereferencing the affected inode. Unlink is unchanged. However, now the zombie handling code gets a chance to do it's thing correctly. Index: file.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/file.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -w -b -B -p -r1.8 -r1.9 --- file.h 6 Feb 2004 20:07:29 -0000 1.8 +++ file.h 28 Apr 2004 12:23:19 -0000 1.9 @@ -64,6 +64,7 @@ struct file { do { \ (fil)->f_ref++; \ assert((fil)->f_ref); \ + I_REF((fil)->f_ino); \ } while (0) /* @@ -71,14 +72,20 @@ struct file { */ #define F_RELE(fil) \ do { \ + struct inode *ino; \ + \ assert((fil)->f_ref); \ (fil)->f_ref--; \ + ino = (fil)->f_ino; \ if (!(fil)->f_ref) \ _sysio_fgone(fil); \ + I_RELE(ino); \ } while (0) /* * Init file record. + * + * NB: Don't forget to take a reference to the inode too! */ #define _SYSIO_FINIT(fil, ino, flags) \ do { \ Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -w -b -B -p -r1.16 -r1.17 --- inode.h 16 Apr 2004 20:38:34 -0000 1.16 +++ inode.h 28 Apr 2004 12:23:19 -0000 1.17 @@ -177,7 +177,8 @@ struct inode { #define I_RELE(ino) \ do { \ assert((ino)->i_ref); \ - --(ino)->i_ref; \ + if (!--(ino)->i_ref && (ino)->i_zombie) \ + _sysio_i_gone(ino); \ } while (0) /* @@ -187,8 +188,6 @@ struct inode { do { \ _sysio_i_undead(ino); \ I_RELE(ino); \ - if (!(ino)->i_ref) \ - _sysio_i_gone(ino); \ } while (0) /* |
From: Lee W. <lw...@us...> - 2004-04-28 12:23:27
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31477/src Modified Files: file.c Log Message: From Sue Kelly; Mike says it shows an unlink, followed by 2 closes, all on the same fd.The second close is getting the assert failure, I guess. We weren't tracking the number of soft references on the inode with file open/close. Hence, it was always 1. When unlink was called, it tries to whack the inode. We've implemented zombie inode code but since there was only one reference, the inode would immediately die. Then, the file close code would try to close it again. However, the inode had already been free'd. Some paranoia in the lower code cleared fields before releasing the memory to protect against just such an event. Voila, instant assertion. Good for us. The fix, of course, is to address the root cause. Inode open/close pairs are now tracked in the file code by referencing and dereferencing the affected inode. Unlink is unchanged. However, now the zombie handling code gets a chance to do it's thing correctly. Index: file.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/file.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- file.c 28 Feb 2004 14:10:58 -0000 1.10 +++ file.c 28 Apr 2004 12:23:19 -0000 1.11 @@ -75,6 +75,7 @@ _sysio_fnew(struct inode *ino, int flags return NULL; _SYSIO_FINIT(fil, ino, flags); + I_REF(ino); return fil; } |
From: Lee W. <lw...@us...> - 2004-04-28 11:22:01
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22174/src Modified Files: access.c chdir.c chmod.c chown.c dup.c fcntl.c fs.c fsync.c getdirentries.c ioctl.c iowait.c link.c lseek.c mkdir.c mknod.c mount.c open.c rename.c rmdir.c rw.c stat.c stat64.c statvfs.c statvfs64.c symlink.c truncate.c unlink.c utime.c Log Message: + Leverage changes to SYSIO_INTERFACE_RETURN. It can set the errno as well as restore it now. + Some more error return cleanups and a very few fixes. A few missed SYSIO_INTERFACE_RETURNS. + Some missed SYSIO_INTERFACE_NAME changes. I'm sure this still isn't all the way right. Index: access.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/access.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -b -B -p -r1.4 -r1.5 --- access.c 27 Apr 2004 22:10:54 -0000 1.4 +++ access.c 28 Apr 2004 11:21:30 -0000 1.5 @@ -68,7 +68,7 @@ SYSIO_INTERFACE_NAME(access)(const char if (n) { list = malloc(n * sizeof(gid_t)); if (!list) { - err = -1; + err = -ENOMEM; goto out; } } @@ -77,8 +77,10 @@ SYSIO_INTERFACE_NAME(access)(const char goto out; err = stat(path, &stbuf); - if (err) + if (err) { + err = -errno; goto out; + } mask = 0; if (amode & R_OK) @@ -105,13 +107,13 @@ SYSIO_INTERFACE_NAME(access)(const char if ((mode & mask) == mask) goto out; - err = -1; + err = -EACCES; out: if (list) free(list); - SYSIO_INTERFACE_RETURN(err, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } #ifdef REDSTORM Index: chdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chdir.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -w -b -B -p -r1.15 -r1.16 --- chdir.c 27 Apr 2004 22:10:55 -0000 1.15 +++ chdir.c 28 Apr 2004 11:21:30 -0000 1.16 @@ -122,18 +122,13 @@ SYSIO_INTERFACE_NAME(chdir)(const char * SYSIO_INTERFACE_ENTER; err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); - if (err) { - errno = -err; + if (err) SYSIO_INTERFACE_RETURN(-1, err); - } err = _sysio_p_chdir(pno); - if (err) { + if (err) P_RELE(pno); - errno = -err; - err = -1; - } - SYSIO_INTERFACE_RETURN(err, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } #ifdef REDSTORM @@ -236,11 +231,7 @@ SYSIO_INTERFACE_NAME(getcwd)(char *buf, SYSIO_INTERFACE_ENTER; err = _sysio_p_path(_sysio_cwd, &buf, buf ? size : 0); - if (err) { - errno = -err; - SYSIO_INTERFACE_RETURN(NULL, err); - } - SYSIO_INTERFACE_RETURN(buf, err); + SYSIO_INTERFACE_RETURN(err ? NULL : buf, err); } #ifdef __GLIBC__ Index: chmod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chmod.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -w -b -B -p -r1.8 -r1.9 --- chmod.c 27 Apr 2004 22:10:55 -0000 1.8 +++ chmod.c 28 Apr 2004 11:21:30 -0000 1.9 @@ -82,11 +82,7 @@ SYSIO_INTERFACE_NAME(chmod)(const char * err = do_chmod(pno, pno->p_base->pb_ino, mode); P_RELE(pno); out: - if (err) { - errno = -err; - err = -1; - } - SYSIO_INTERFACE_RETURN(err, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } #ifdef REDSTORM @@ -111,11 +107,7 @@ SYSIO_INTERFACE_NAME(fchmod)(int fd, mod err = do_chmod(NULL, fil->f_ino, mode); out: - if (err) { - errno = -err; - err = -1; - } - SYSIO_INTERFACE_RETURN(err, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } #ifdef REDSTORM Index: chown.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chown.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -w -b -B -p -r1.8 -r1.9 --- chown.c 27 Apr 2004 22:10:55 -0000 1.8 +++ chown.c 28 Apr 2004 11:21:30 -0000 1.9 @@ -90,12 +90,7 @@ SYSIO_INTERFACE_NAME(chown)(const char * err = _do_chown(pno, pno->p_base->pb_ino, owner, group); P_RELE(pno); out: - if (err) { - errno = -err; - err = -1; - } - - SYSIO_INTERFACE_RETURN(err, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } #ifdef REDSTORM @@ -120,12 +115,7 @@ SYSIO_INTERFACE_NAME(fchown)(int fd, uid err = _do_chown(NULL, fil->f_ino, owner, group); out: - if (err) { - errno = -err; - err = -1; - } - - SYSIO_INTERFACE_RETURN(err, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } #ifdef REDSTORM Index: dup.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/dup.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -w -b -B -p -r1.6 -r1.7 --- dup.c 27 Apr 2004 22:10:55 -0000 1.6 +++ dup.c 28 Apr 2004 11:21:30 -0000 1.7 @@ -53,26 +53,24 @@ int SYSIO_INTERFACE_NAME(dup2)(int oldfd, int newfd) { - int rc; - int err; + int fd; SYSIO_INTERFACE_DISPLAY_BLOCK; SYSIO_INTERFACE_ENTER; - err = 0; - if (newfd < 0) { - errno = EBADF; + if (newfd < 0) SYSIO_INTERFACE_RETURN(-1, -EBADF); - } - if (oldfd == newfd) - SYSIO_INTERFACE_RETURN(newfd, 0); + if (oldfd == newfd) { + struct file *fil; - rc = _sysio_fd_dup2(oldfd, newfd); - if (rc < 0) { - errno = err = -rc; - rc = -1; + fil = _sysio_fd_find(oldfd); + if (!(fil && fil->f_ino)) + SYSIO_INTERFACE_RETURN(-1, -EBADF); + SYSIO_INTERFACE_RETURN(newfd, 0); } - SYSIO_INTERFACE_RETURN(rc, err); + + fd = _sysio_fd_dup2(oldfd, newfd); + SYSIO_INTERFACE_RETURN(fd < 0 ? -1 : fd, fd < 0 ? fd : 0); } #ifdef REDSTORM @@ -83,18 +81,12 @@ sysio_sym_weak_alias(SYSIO_INTERFACE_NAM int SYSIO_INTERFACE_NAME(dup)(int oldfd) { - int rc; - int err; + int fd; SYSIO_INTERFACE_DISPLAY_BLOCK; SYSIO_INTERFACE_ENTER; - err = 0; - rc = _sysio_fd_dup2(oldfd, -1); - if (rc < 0) { - errno = err = -rc; - rc = -1; - } - SYSIO_INTERFACE_RETURN(rc, err); + fd = _sysio_fd_dup2(oldfd, -1); + SYSIO_INTERFACE_RETURN(fd < 0 ? -1 : fd, fd < 0 ? fd : 0); } #ifdef __GLIBC__ Index: fcntl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fcntl.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -b -B -p -r1.9 -r1.10 --- fcntl.c 27 Apr 2004 22:10:55 -0000 1.9 +++ fcntl.c 28 Apr 2004 11:21:30 -0000 1.10 @@ -74,7 +74,6 @@ SYSIO_INTERFACE_NAME(fcntl)(int fd, int case F_DUPFD: { long newfd; - int rc; va_start(ap, cmd); newfd = va_arg(ap, long); @@ -83,9 +82,7 @@ SYSIO_INTERFACE_NAME(fcntl)(int fd, int err = -EBADF; goto out; } - rc = _sysio_fd_dup2(fd, (int )newfd); - - SYSIO_INTERFACE_RETURN(rc, err); + err = _sysio_fd_dup2(fd, (int )newfd); } break; default: @@ -96,11 +93,7 @@ SYSIO_INTERFACE_NAME(fcntl)(int fd, int } out: - if (err) { - errno = -err; - err = -1; - } - SYSIO_INTERFACE_RETURN(err, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } #ifdef __GLIBC__ Index: fs.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fs.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- fs.c 24 Feb 2004 14:58:26 -0000 1.10 +++ fs.c 28 Apr 2004 11:21:30 -0000 1.11 @@ -95,7 +95,7 @@ _sysio_fssw_register(const char *name, s fssw = malloc(sizeof(struct fsswent) + strlen(name) + 1); if (!fssw) - return -errno; + return -ENOMEM; fssw->fssw_name = (char *)fssw + sizeof(struct fsswent); (void )strcpy((char *)fssw->fssw_name, name); fssw->fssw_ops = *ops; Index: fsync.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fsync.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -b -B -p -r1.4 -r1.5 --- fsync.c 27 Apr 2004 22:10:55 -0000 1.4 +++ fsync.c 28 Apr 2004 11:21:30 -0000 1.5 @@ -59,16 +59,10 @@ SYSIO_INTERFACE_NAME(fsync)(int fd) SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find(fd); - if (!(fil && fil->f_ino)) { - errno = -EBADF; + if (!(fil && fil->f_ino)) SYSIO_INTERFACE_RETURN(-1, -EBADF); - } err = (*fil->f_ino->i_ops.inop_sync)(fil->f_ino); - if (err) { - errno = -err; - SYSIO_INTERFACE_RETURN(-1, err); - } - SYSIO_INTERFACE_RETURN(err, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } int @@ -80,14 +74,8 @@ SYSIO_INTERFACE_NAME(fdatasync)(int fd) SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find(fd); - if (!(fil && fil->f_ino)) { - errno = -EBADF; + if (!(fil && fil->f_ino)) SYSIO_INTERFACE_RETURN(-1, -EBADF); - } err = (*fil->f_ino->i_ops.inop_datasync)(fil->f_ino); - if (err) { - errno = -err; - SYSIO_INTERFACE_RETURN(-1, err); - } - SYSIO_INTERFACE_RETURN(err, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } Index: getdirentries.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/getdirentries.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -w -b -B -p -r1.12 -r1.13 --- getdirentries.c 27 Apr 2004 22:10:55 -0000 1.12 +++ getdirentries.c 28 Apr 2004 11:21:30 -0000 1.13 @@ -85,41 +85,37 @@ #endif static ssize_t -_getdirentries64(int fd, +PREPEND(_, SYSIO_INTERFACE_NAME(getdirentries64))(int fd, char *buf, size_t nbytes, - _SYSIO_OFF_T * __restrict basep) + _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)) { - errno = EBADF; - return -1; - } + if (!(fil && fil->f_ino)) + SYSIO_INTERFACE_RETURN(-1, -EBADF); - if (!S_ISDIR(fil->f_ino->i_mode)) { - errno = ENOTDIR; - return -1; - } + if (!S_ISDIR(fil->f_ino->i_mode)) + SYSIO_INTERFACE_RETURN(-1, -ENOTDIR); cc = (*fil->f_ino->i_ops.inop_getdirentries)(fil->f_ino, buf, nbytes, basep); - if (cc < 0) { - errno = -cc; - return -1; - } - - return cc; + SYSIO_INTERFACE_RETURN(cc < 0 ? -1 : cc, (int )cc); } #if _LARGEFILE64_SOURCE #undef getdirentries64 -sysio_sym_strong_alias(_getdirentries64, SYSIO_INTERFACE_NAME(getdirentries64)) +sysio_sym_strong_alias(PREPEND(_, SYSIO_INTERFACE_NAME(getdirentries64)), + SYSIO_INTERFACE_NAME(getdirentries64)) #endif #undef getdirentries @@ -190,10 +186,8 @@ SYSIO_INTERFACE_NAME(getdirentries)(int SYSIO_INTERFACE_ENTER; #if defined(BSD) || defined(REDSTORM) - if (nbytes < 0) { - errno = -EINVAL; - return -1; - } + if (nbytes < 0) + SYSIO_INTERFACE_RETURN(-1, -EINVAL); #endif inbytes = nbytes; @@ -204,16 +198,17 @@ SYSIO_INTERFACE_NAME(getdirentries)(int inbytes = 8 * 1024; } ibuf = _fast_alloc(inbytes); - if (!ibuf) { - errno = ENOMEM; - SYSIO_LEAVE; - return -1; - } + if (!ibuf) + SYSIO_INTERFACE_RETURN(-1, -ENOMEM); dp = (struct dirent *)buf; ibase = *basep; - cc = _getdirentries64(fd, ibuf, inbytes, &ibase); + cc = + PREPEND(_, SYSIO_INTERFACE_NAME(getdirentries64))(fd, + ibuf, + inbytes, + &ibase); if (cc < 0) { cc = -errno; goto out; @@ -276,10 +271,8 @@ SYSIO_INTERFACE_NAME(getdirentries)(int out: _fast_free(ibuf); - if (dp == (struct dirent *)buf && cc < 0) { - errno = (int )-cc; - SYSIO_INTERFACE_RETURN(-1, cc); - } + if (dp == (struct dirent *)buf && cc < 0) + SYSIO_INTERFACE_RETURN(-1, (int )cc); cc = (char *)dp - buf; if (cc) *basep = @@ -288,7 +281,7 @@ out: #else off; #endif - SYSIO_INTERFACE_RETURN(cc, cc >= 0 ? 0 : -1); + SYSIO_INTERFACE_RETURN(cc, 0); #ifdef __GLIBC__ #undef _fast_alloc @@ -298,14 +291,17 @@ out: #undef _dbaselen } #else /* !defined(DIRENT64_IS_NATURAL) */ -sysio_sym_strong_alias(_getdirentries64, getdirentries) +sysio_sym_strong_alias(PREPEND(_, SYSIO_INTERFACE_NAME(getdirentries64), + SYSIO_INTERFACE_NAME(getdirentries))) #endif #ifdef REDSTORM #undef __getdirentries -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(getdirentries)), __getdirentries) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(getdirentries)), + PREPEND(__, SYSIO_INTERFACE_NAME(getdirentries))) #endif #if defined(BSD) || defined(REDSTORM) #undef _getdirentries -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(getdirentries)), _getdirentries) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(getdirentries)), + PREPEND(_, SYSIO_INTERFACE_NAME(getdirentries))) #endif Index: ioctl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctl.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -b -B -p -r1.7 -r1.8 --- ioctl.c 27 Apr 2004 22:10:55 -0000 1.7 +++ ioctl.c 28 Apr 2004 11:21:30 -0000 1.8 @@ -73,11 +73,7 @@ SYSIO_INTERFACE_NAME(ioctl)(int fd, unsi va_end(ap); out: - if (err < 0) { - errno = -err; - err = -1; - } - SYSIO_INTERFACE_RETURN(err, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } Index: iowait.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/iowait.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -w -b -B -p -r1.6 -r1.7 --- iowait.c 27 Apr 2004 22:10:55 -0000 1.6 +++ iowait.c 28 Apr 2004 11:21:30 -0000 1.7 @@ -52,17 +52,6 @@ * Asynch IO support for the API. */ -static struct ioctx * -lookup_ioid(ioid_t ioid) -{ - struct ioctx *ioctx; - - ioctx = _sysio_ioctx_find(ioid); - if (!ioctx) - errno = EINVAL; - return ioctx; -} - /* * Poll status of asynch IO request. */ @@ -74,14 +63,15 @@ SYSIO_INTERFACE_NAME(iodone)(ioid_t ioid SYSIO_INTERFACE_DISPLAY_BLOCK; SYSIO_INTERFACE_ENTER; - ioctx = lookup_ioid(ioid); + ioctx = _sysio_ioctx_find(ioid); if (!ioctx) - SYSIO_INTERFACE_RETURN(-1, -1); + SYSIO_INTERFACE_RETURN(-1, -EINVAL); - rc = (ioctx->ioctx_done || + rc = + (ioctx->ioctx_done || (*ioctx->ioctx_ino->i_ops.inop_iodone)(ioctx)); - SYSIO_INTERFACE_RETURN(rc, rc >= 0 ? 0 : -1); + SYSIO_INTERFACE_RETURN(rc < 0 ? -1 : rc, rc < 0 ? rc : 0); } /* @@ -98,14 +88,10 @@ SYSIO_INTERFACE_NAME(iowait)(ioid_t ioid SYSIO_INTERFACE_DISPLAY_BLOCK; SYSIO_INTERFACE_ENTER; - ioctx = lookup_ioid(ioid); + ioctx = _sysio_ioctx_find(ioid); if (!ioctx) - SYSIO_INTERFACE_RETURN(-1, -1); + SYSIO_INTERFACE_RETURN(-1, -EINVAL); cc = _sysio_ioctx_wait(ioctx); - if (cc < 0) { - errno = -(int )cc; - cc = -1; - } - SYSIO_INTERFACE_RETURN(cc, cc >= 0 ? 0 : -1); + SYSIO_INTERFACE_RETURN(cc < 0 ? -1 : cc, cc < 0 ? (int )cc : 0); } Index: link.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/link.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -w -b -B -p -r1.6 -r1.7 --- link.c 27 Apr 2004 22:10:55 -0000 1.6 +++ link.c 28 Apr 2004 11:21:30 -0000 1.7 @@ -99,11 +99,7 @@ error2: error1: P_RELE(old); out: - if (err) { - errno = -err; - err = -1; - } - SYSIO_INTERFACE_RETURN(err, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } #ifdef REDSTORM Index: lseek.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/lseek.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -w -b -B -p -r1.17 -r1.18 --- lseek.c 27 Apr 2004 22:40:20 -0000 1.17 +++ lseek.c 28 Apr 2004 11:21:30 -0000 1.18 @@ -85,7 +85,7 @@ _sysio_lseek(int fd, _SYSIO_OFF_T offset fil->f_ino, &stbuf); if (err) - SYSIO_INTERFACE_RETURN(err, err); + SYSIO_INTERFACE_RETURN((off_t )-1, (int )err); } off = stbuf.st_size; @@ -94,22 +94,21 @@ _sysio_lseek(int fd, _SYSIO_OFF_T offset return -EINVAL; } pos = off + offset; - if ((offset < 0 && -offset >= off) || - (offset > 0 && pos <= off)) - SYSIO_INTERFACE_RETURN(-EINVAL, -EINVAL); + if ((offset < 0 && -offset >= off) || (offset > 0 && pos <= off)) + SYSIO_INTERFACE_RETURN((off_t )-1, -EINVAL); #ifdef O_LARGEFILE if (pos >= ((fil->f_flags & O_LARGEFILE) ? _SYSIO_OFF_T_MAX : LONG_MAX)) - SYSIO_INTERFACE_RETURN(-EOVERFLOW, -EOVERFLOW); + SYSIO_INTERFACE_RETURN((off_t )-1, -EOVERFLOW); #else if (pos >= _SYSIO_OFF_T_MAX) - SYSIO_INTERFACE_RETURN(-EOVERFLOW, -EOVERFLOW); + SYSIO_INTERFACE_RETURN((off_t )-1, -EOVERFLOW); #endif pos = (fil->f_ino->i_ops.inop_pos)(fil->f_ino, pos); if (pos < 0) - SYSIO_INTERFACE_RETURN(pos, pos); + SYSIO_INTERFACE_RETURN((off_t )-1, (int )pos); fil->f_pos = pos; - SYSIO_INTERFACE_RETURN(pos, 0); + SYSIO_INTERFACE_RETURN((off_t )pos, 0); } #if _LARGEFILE64_SOURCE @@ -136,10 +135,8 @@ SYSIO_INTERFACE_NAME(lseek)(int fd, off_ SYSIO_INTERFACE_ENTER; off = _sysio_lseek(fd, offset, whence); - if (off < 0) { - errno = -off; - SYSIO_INTERFACE_RETURN((off_t )-1, off); - } + if (off < 0) + SYSIO_INTERFACE_RETURN((off_t )-1, (int )off); rtn = (off_t )off; assert(rtn == off); SYSIO_INTERFACE_RETURN(rtn, 0); @@ -160,12 +157,13 @@ SYSIO_INTERFACE_NAME(llseek)(unsigned in loff_t *result __IS_UNUSED, unsigned int whence __IS_UNUSED) { + SYSIO_INTERFACE_DISPLAY_BLOCK; /* * Something is very wrong if this was called. */ - errno = ENOTSUP; - return -1; + SYSIO_INTERFACE_ENTER; + SYSIO_INTERFACE_RETURN(-1, -ENOTSUP); } #undef __llseek Index: mkdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mkdir.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -b -B -p -r1.7 -r1.8 --- mkdir.c 27 Apr 2004 22:10:55 -0000 1.7 +++ mkdir.c 28 Apr 2004 11:21:30 -0000 1.8 @@ -79,11 +79,7 @@ SYSIO_INTERFACE_NAME(mkdir)(const char * error: P_RELE(pno); out: - if (err) { - errno = -err; - err = -1; - } - SYSIO_INTERFACE_RETURN(err, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } #ifdef REDSTORM Index: mknod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mknod.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -b -B -p -r1.11 -r1.12 --- mknod.c 27 Apr 2004 22:10:55 -0000 1.11 +++ mknod.c 28 Apr 2004 11:21:30 -0000 1.12 @@ -109,11 +109,7 @@ PREPEND(__,SYSIO_INTERFACE_NAME(xmknod)) error: P_RELE(pno); out: - if (err) { - errno = -err; - err = -1; - } - SYSIO_INTERFACE_RETURN(err, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } #ifdef REDSTORM @@ -126,14 +122,11 @@ PREPEND(__,SYSIO_INTERFACE_NAME(mknod))( mode_t mode, dev_t dev) { - int rc; - rc = PREPEND(__,SYSIO_INTERFACE_NAME(xmknod))(_MKNOD_VER, + return PREPEND(__,SYSIO_INTERFACE_NAME(xmknod))(_MKNOD_VER, path, mode, &dev); - - return rc; } sysio_sym_weak_alias(PREPEND(__,SYSIO_INTERFACE_NAME(mknod)), \ Index: mount.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mount.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -w -b -B -p -r1.12 -r1.13 --- mount.c 27 Apr 2004 22:10:55 -0000 1.12 +++ mount.c 28 Apr 2004 11:21:30 -0000 1.13 @@ -340,11 +340,7 @@ SYSIO_INTERFACE_NAME(mount)(const char * filesystemtype, mountflags, data); - if (err) { - errno = -err; - err = -1; - } - SYSIO_INTERFACE_RETURN(err, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } int @@ -376,11 +372,7 @@ SYSIO_INTERFACE_NAME(umount)(const char err = _sysio_do_unmount(pno->p_mount); out: - if (err) { - errno = -err; - err = -1; - } - SYSIO_INTERFACE_RETURN(err, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } /* Index: open.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/open.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -w -b -B -p -r1.18 -r1.19 --- open.c 27 Apr 2004 22:31:31 -0000 1.18 +++ open.c 28 Apr 2004 11:21:46 -0000 1.19 @@ -132,7 +132,7 @@ SYSIO_INTERFACE_NAME(open)(const char *p mode_t mode; unsigned ndflags; struct intent intent; - int err; + int rtn; struct pnode *pno; struct file *fil; SYSIO_INTERFACE_DISPLAY_BLOCK; @@ -183,40 +183,37 @@ SYSIO_INTERFACE_NAME(open)(const char *p fil = NULL; INTENT_INIT(&intent, intent.int_opmask, &mode, &flags); pno = NULL; - err = _sysio_namei(_sysio_cwd, path, ndflags, &intent, &pno); - if (err) { - errno = -err; + rtn = _sysio_namei(_sysio_cwd, path, ndflags, &intent, &pno); + if (rtn) goto error; - } /* * Ask for the open/creat. */ - err = _sysio_open(pno, flags, mode); - if (err) + rtn = _sysio_open(pno, flags, mode); + if (rtn) goto error; /* * Get a file descriptor. */ fil = _sysio_fnew(pno->p_base->pb_ino, flags); if (!fil) { - err = -ENOMEM; + rtn = -ENOMEM; goto error; } - err = _sysio_fd_set(fil, -1); - if (err < 0) + rtn = _sysio_fd_set(fil, -1); + if (rtn < 0) goto error; P_RELE(pno); - SYSIO_INTERFACE_RETURN(err, 0); + SYSIO_INTERFACE_RETURN(rtn, 0); error: if (fil) F_RELE(fil); if (pno) P_RELE(pno); - errno = -err; - SYSIO_INTERFACE_RETURN(-1, err); + SYSIO_INTERFACE_RETURN(-1, rtn); } #ifdef __GLIBC__ @@ -246,8 +243,6 @@ SYSIO_INTERFACE_NAME(close)(int fd) SYSIO_INTERFACE_ENTER; err = _sysio_fd_close(fd); - if (err) - errno = -err; SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } Index: rename.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rename.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -b -B -p -r1.4 -r1.5 --- rename.c 27 Apr 2004 22:10:55 -0000 1.4 +++ rename.c 28 Apr 2004 11:21:46 -0000 1.5 @@ -173,12 +173,9 @@ error1: error2: P_RELE(old); error3: - if (err) { - errno = -err; - err = -1; + if (err) goto out; - } _sysio_p_gone(old); /* kill it! */ out: - SYSIO_INTERFACE_RETURN(err, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } Index: rmdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rmdir.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- rmdir.c 27 Apr 2004 22:10:55 -0000 1.10 +++ rmdir.c 28 Apr 2004 11:21:46 -0000 1.11 @@ -87,11 +87,7 @@ rmdir(const char *path) error: P_RELE(pno); out: - if (err) { - errno = -err; - err = -1; - } - SYSIO_INTERFACE_RETURN(err, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } #ifdef REDSTORM Index: rw.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rw.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -w -b -B -p -r1.6 -r1.7 --- rw.c 27 Apr 2004 22:10:55 -0000 1.6 +++ rw.c 28 Apr 2004 11:21:46 -0000 1.7 @@ -117,10 +117,8 @@ _sysio_iiox(int (*f)(struct inode *, str if (cc < 0) return cc; ioctx = _sysio_ioctx_new(ino, iov, iov_count, xtv, xtv_count); - if (!ioctx) { - errno = ENOMEM; - return -1; - } + if (!ioctx) + return -ENOMEM; if ((iov_free && (err = _sysio_ioctx_cb(ioctx, (void (*)(struct ioctx *, @@ -253,10 +251,8 @@ SYSIO_INTERFACE_NAME(ireadv)(int fd, con SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find_capable(fd, O_WRONLY); - if (!fil) { - errno = EBADF; + if (!fil) SYSIO_INTERFACE_RETURN(IOID_FAIL, -EBADF); - } xtv = malloc(sizeof(struct intnl_xtvec)); if (!xtv) @@ -270,10 +266,9 @@ SYSIO_INTERFACE_NAME(ireadv)(int fd, con &ioctx); if (err) { free(xtv); - errno = -err; SYSIO_INTERFACE_RETURN(IOID_FAIL, err); } - SYSIO_INTERFACE_RETURN(ioctx->ioctx_id, err); + SYSIO_INTERFACE_RETURN(ioctx->ioctx_id, 0); } ssize_t @@ -288,10 +283,8 @@ SYSIO_INTERFACE_NAME(readv)(int fd, cons SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find_capable(fd, O_WRONLY); - if (!fil) { - errno = EBADF; + if (!fil) SYSIO_INTERFACE_RETURN(-1, -EBADF); - } err = _sysio_iiov(fil->f_ino->i_ops.inop_read, @@ -302,11 +295,7 @@ SYSIO_INTERFACE_NAME(readv)(int fd, cons if (!err && (cc = _sysio_ioctx_wait(ioctx)) < 0) err = (int )cc; - if (err) { - errno = -err; - cc = -1; - } - SYSIO_INTERFACE_RETURN(cc, err); + SYSIO_INTERFACE_RETURN(err ? -1 : cc, err); } #if defined(__GLIBC__) @@ -336,10 +325,8 @@ SYSIO_INTERFACE_NAME(iread)(int fd, void SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find_capable(fd, O_WRONLY); - if (!fil) { - errno = EBADF; + if (!fil) SYSIO_INTERFACE_RETURN(IOID_FAIL, -EBADF); - } iov = malloc(sizeof(struct iovec)); if (!iov) @@ -349,11 +336,7 @@ SYSIO_INTERFACE_NAME(iread)(int fd, void iov->iov_len = count; xtv = malloc(sizeof(struct intnl_xtvec)); if (!xtv) { - int oerrno; - - oerrno = errno; free(iov); - errno = oerrno; SYSIO_INTERFACE_RETURN(IOID_FAIL, -ENOMEM); } err = @@ -365,10 +348,9 @@ SYSIO_INTERFACE_NAME(iread)(int fd, void if (err) { free(xtv); free(iov); - errno = -err; SYSIO_INTERFACE_RETURN(IOID_FAIL, err); } - SYSIO_INTERFACE_RETURN(ioctx->ioctx_id, err); + SYSIO_INTERFACE_RETURN(ioctx->ioctx_id, 0); } ssize_t @@ -384,10 +366,8 @@ SYSIO_INTERFACE_NAME(read)(int fd, void SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find_capable(fd, O_WRONLY); - if (!fil) { - errno = EBADF; + if (!fil) SYSIO_INTERFACE_RETURN(-1, -EBADF); - } iovector.iov_base = buf; iovector.iov_len = count; @@ -399,12 +379,7 @@ SYSIO_INTERFACE_NAME(read)(int fd, void &ioctx); if (!err && (cc = _sysio_ioctx_wait(ioctx)) < 0) err = (int )cc; - - if (err) { - errno = -err; - cc = -1; - } - SYSIO_INTERFACE_RETURN(cc, err); + SYSIO_INTERFACE_RETURN(err ? -1 : cc, err); } #ifdef __GLIBC__ @@ -466,10 +441,8 @@ PREPEND(_,SYSIO_INTERFACE_NAME(ipreadv)) SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find_capable(fd, O_WRONLY); - if (!fil) { - errno = EBADF; + if (!fil) SYSIO_INTERFACE_RETURN(IOID_FAIL, -EBADF); - } xtv = malloc(sizeof(struct intnl_xtvec)); if (!xtv) @@ -484,10 +457,9 @@ PREPEND(_,SYSIO_INTERFACE_NAME(ipreadv)) &ioctx); if (err) { free(xtv); - errno = -err; SYSIO_INTERFACE_RETURN(IOID_FAIL, err); } - SYSIO_INTERFACE_RETURN(ioctx->ioctx_id, err); + SYSIO_INTERFACE_RETURN(ioctx->ioctx_id, 0); } #if _LARGEFILE64_SOURCE @@ -524,10 +496,8 @@ PREPEND(_,SYSIO_INTERFACE_NAME(preadv))( SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find_capable(fd, O_WRONLY); - if (!fil) { - errno = EBADF; + if (!fil) SYSIO_INTERFACE_RETURN(-1, -EBADF); - } err = _sysio_ipiov(fil->f_ino->i_ops.inop_read, @@ -539,11 +509,7 @@ PREPEND(_,SYSIO_INTERFACE_NAME(preadv))( if (!err && (cc = _sysio_ioctx_wait(ioctx)) < 0) err = (int )cc; - if (err) { - errno = -err; - cc = -1; - } - SYSIO_INTERFACE_RETURN(cc, err); + SYSIO_INTERFACE_RETURN(err ? -1 : cc, err); } #if _LARGEFILE64_SOURCE @@ -580,15 +546,13 @@ PREPEND(_,SYSIO_INTERFACE_NAME(ipread))( SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find_capable(fd, O_WRONLY); - if (!fil) { - errno = EBADF; + if (!fil) SYSIO_INTERFACE_RETURN(IOID_FAIL, -EBADF); - } xtv = malloc(sizeof(struct intnl_xtvec)); iov = malloc(sizeof(struct iovec)); if (!(xtv && iov)) { - err = -errno; + err = -ENOMEM; goto error; } xtv->xtv_off = offset; @@ -607,10 +571,9 @@ error: free(iov); if (xtv) free(xtv); - errno = -err; SYSIO_INTERFACE_RETURN(IOID_FAIL, err); } - SYSIO_INTERFACE_RETURN(ioctx->ioctx_id, err); + SYSIO_INTERFACE_RETURN(ioctx->ioctx_id, 0); } #if _LARGEFILE64_SOURCE @@ -648,10 +611,8 @@ PREPEND(_,SYSIO_INTERFACE_NAME(pread))(i SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find_capable(fd, O_WRONLY); - if (!fil) { - errno = EBADF; + if (!fil) SYSIO_INTERFACE_RETURN(IOID_FAIL, -EBADF); - } xtvec.xtv_off = offset; iovec.iov_base = buf; @@ -666,11 +627,7 @@ PREPEND(_,SYSIO_INTERFACE_NAME(pread))(i if (!err && (cc = _sysio_ioctx_wait(ioctx)) < 0) err = (int )cc; - if (err) { - errno = -err; - cc = -1; - } - SYSIO_INTERFACE_RETURN(cc, err); + SYSIO_INTERFACE_RETURN(err ? -1 : cc, err); } #if _LARGEFILE64_SOURCE @@ -714,10 +671,8 @@ PREPEND(_,SYSIO_INTERFACE_NAME(ireadx))( SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find_capable(fd, O_WRONLY); - if (!(fil && xtv_count)) { - errno = EBADF; + if (!(fil && xtv_count)) SYSIO_INTERFACE_RETURN(IOID_FAIL, -EBADF); - } err = _sysio_iiox(fil->f_ino->i_ops.inop_read, @@ -726,11 +681,8 @@ PREPEND(_,SYSIO_INTERFACE_NAME(ireadx))( xtv, xtv_count, NULL, NULL, &ioctx); - if (err) { - errno = -err; - SYSIO_INTERFACE_RETURN(IOID_FAIL, err); - } - SYSIO_INTERFACE_RETURN(ioctx->ioctx_id, err); + + SYSIO_INTERFACE_RETURN(err ? IOID_FAIL : ioctx->ioctx_id, err); } #if _LARGEFILE64_SOURCE @@ -754,10 +706,8 @@ SYSIO_INTERFACE_NAME(ireadx)(int fd, SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find_capable(fd, O_WRONLY); - if (!(fil && xtv_count)) { - errno = EBADF; + if (!(fil && xtv_count)) SYSIO_INTERFACE_RETURN(IOID_FAIL, -EBADF); - } ixtv = ixtvent = malloc(xtv_count * sizeof(struct intnl_xtvec)); if (!ixtv) @@ -780,10 +730,9 @@ SYSIO_INTERFACE_NAME(ireadx)(int fd, &ioctx); if (err) { free(ixtv); - errno = -err; SYSIO_INTERFACE_RETURN(IOID_FAIL, err); } - SYSIO_INTERFACE_RETURN(ioctx->ioctx_id, err); + SYSIO_INTERFACE_RETURN(ioctx->ioctx_id, 0); } #else #undef ireadx @@ -854,10 +803,8 @@ SYSIO_INTERFACE_NAME(iwritev)(int fd, SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find_capable(fd, O_RDONLY); - if (!fil) { - errno = EBADF; + if (!fil) SYSIO_INTERFACE_RETURN(IOID_FAIL, -EBADF); - } xtv = malloc(sizeof(struct intnl_xtvec)); if (!xtv) @@ -871,10 +818,9 @@ SYSIO_INTERFACE_NAME(iwritev)(int fd, &ioctx); if (err) { free(xtv); - errno = -err; SYSIO_INTERFACE_RETURN(IOID_FAIL, err); } - SYSIO_INTERFACE_RETURN(ioctx->ioctx_id, err); + SYSIO_INTERFACE_RETURN(ioctx->ioctx_id, 0); } ssize_t @@ -889,10 +835,8 @@ SYSIO_INTERFACE_NAME(writev)(int fd, con SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find_capable(fd, O_RDONLY); - if (!fil) { - errno = EBADF; - SYSIO_INTERFACE_RETURN((ssize_t )-1, -EBADF); - } + if (!fil) + SYSIO_INTERFACE_RETURN(-1, -EBADF); err = _sysio_iiov(fil->f_ino->i_ops.inop_write, @@ -903,11 +847,7 @@ SYSIO_INTERFACE_NAME(writev)(int fd, con if (!err && (cc = _sysio_ioctx_wait(ioctx)) < 0) err = (int )cc; - if (err) { - errno = -err; - cc = -1; - } - SYSIO_INTERFACE_RETURN(cc, err); + SYSIO_INTERFACE_RETURN(err < 0 ? -1 : cc, err); } #ifdef __GLIBC__ @@ -929,10 +869,8 @@ SYSIO_INTERFACE_NAME(iwrite)(int fd, con SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find_capable(fd, O_RDONLY); - if (!fil) { - errno = EBADF; + if (!fil) SYSIO_INTERFACE_RETURN(IOID_FAIL, -EBADF); - } iov = malloc(sizeof(struct iovec)); if (!iov) @@ -942,11 +880,7 @@ SYSIO_INTERFACE_NAME(iwrite)(int fd, con iov->iov_len = count; xtv = malloc(sizeof(struct intnl_xtvec)); if (!xtv) { - int oerrno; - - oerrno = errno; free(iov); - errno = oerrno; SYSIO_INTERFACE_RETURN(IOID_FAIL, -ENOMEM); } err = @@ -958,10 +892,9 @@ SYSIO_INTERFACE_NAME(iwrite)(int fd, con if (err) { free(xtv); free(iov); - errno = -err; SYSIO_INTERFACE_RETURN(IOID_FAIL, err); } - SYSIO_INTERFACE_RETURN(ioctx->ioctx_id, err); + SYSIO_INTERFACE_RETURN(ioctx->ioctx_id, 0); } ssize_t @@ -977,10 +910,8 @@ SYSIO_INTERFACE_NAME(write)(int fd, cons SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find_capable(fd, O_RDONLY); - if (!fil) { - errno = EBADF; - SYSIO_INTERFACE_RETURN((ssize_t )-1, -EBADF); - } + if (!fil) + SYSIO_INTERFACE_RETURN(-1, -EBADF); iovector.iov_base = (void *)buf; iovector.iov_len = count; @@ -993,11 +924,7 @@ SYSIO_INTERFACE_NAME(write)(int fd, cons if (!err && (cc = _sysio_ioctx_wait(ioctx)) < 0) err = (int )cc; - if (err) { - errno = -err; - cc = -1; - } - SYSIO_INTERFACE_RETURN(cc, err); + SYSIO_INTERFACE_RETURN(err < 0 ? -1 : cc, err); } #ifdef __GLIBC__ @@ -1021,10 +948,8 @@ PREPEND(_,SYSIO_INTERFACE_NAME(ipwritev) SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find_capable(fd, O_RDONLY); - if (!fil) { - errno = EBADF; + if (!fil) SYSIO_INTERFACE_RETURN(IOID_FAIL, -EBADF); - } xtv = malloc(sizeof(struct intnl_xtvec)); if (!xtv) @@ -1039,10 +964,9 @@ PREPEND(_,SYSIO_INTERFACE_NAME(ipwritev) &ioctx); if (err) { free(xtv); - errno = -err; SYSIO_INTERFACE_RETURN(IOID_FAIL, err); } - SYSIO_INTERFACE_RETURN(ioctx->ioctx_id, err); + SYSIO_INTERFACE_RETURN(ioctx->ioctx_id, 0); } #if _LARGEFILE64_SOURCE @@ -1079,10 +1003,8 @@ PREPEND(_,SYSIO_INTERFACE_NAME(pwritev)) SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find_capable(fd, O_RDONLY); - if (!fil) { - errno = EBADF; + if (!fil) SYSIO_INTERFACE_RETURN(-1, -EBADF); - } err = _sysio_ipiov(fil->f_ino->i_ops.inop_write, @@ -1094,11 +1016,7 @@ PREPEND(_,SYSIO_INTERFACE_NAME(pwritev)) if (!err && (cc = _sysio_ioctx_wait(ioctx)) < 0) err = (int )cc; - if (err) { - errno = -err; - cc = -1; - } - SYSIO_INTERFACE_RETURN(cc, err); + SYSIO_INTERFACE_RETURN(err ? -1 : cc, err); } #if _LARGEFILE64_SOURCE @@ -1135,10 +1053,8 @@ PREPEND(_,SYSIO_INTERFACE_NAME(ipwrite)) SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find_capable(fd, O_RDONLY); - if (!fil) { - errno = EBADF; + if (!fil) SYSIO_INTERFACE_RETURN(IOID_FAIL, -EBADF); - } xtv = malloc(sizeof(struct intnl_xtvec)); iov = malloc(sizeof(struct iovec)); @@ -1162,10 +1078,9 @@ error: free(iov); if (xtv) free(xtv); - errno = -err; SYSIO_INTERFACE_RETURN(IOID_FAIL, err); } - SYSIO_INTERFACE_RETURN(ioctx->ioctx_id, err); + SYSIO_INTERFACE_RETURN(ioctx->ioctx_id, 0); } #if _LARGEFILE64_SOURCE @@ -1203,10 +1118,8 @@ PREPEND(_,SYSIO_INTERFACE_NAME(pwrite))( SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find_capable(fd, O_RDONLY); - if (!fil) { - errno = EBADF; + if (!fil) SYSIO_INTERFACE_RETURN(-1, -EBADF); - } xtvec.xtv_off = offset; iovec.iov_base = (void *)buf; @@ -1221,11 +1134,7 @@ PREPEND(_,SYSIO_INTERFACE_NAME(pwrite))( if (!err && (cc = _sysio_ioctx_wait(ioctx)) < 0) err = (int )cc; - if (err) { - errno = -err; - cc = -1; - } - SYSIO_INTERFACE_RETURN(cc, err); + SYSIO_INTERFACE_RETURN(err ? -1 : cc, err); } #if _LARGEFILE64_SOURCE @@ -1270,10 +1179,8 @@ PREPEND(_,SYSIO_INTERFACE_NAME(iwritex)) SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find_capable(fd, O_RDONLY); - if (!(fil && xtv_count)) { - errno = EBADF; + if (!(fil && xtv_count)) SYSIO_INTERFACE_RETURN(IOID_FAIL, -EBADF); - } err = _sysio_iiox(fil->f_ino->i_ops.inop_write, @@ -1282,11 +1189,8 @@ PREPEND(_,SYSIO_INTERFACE_NAME(iwritex)) xtv, xtv_count, NULL, NULL, &ioctx); - if (err) { - errno = -err; - SYSIO_INTERFACE_RETURN(IOID_FAIL, err); - } - SYSIO_INTERFACE_RETURN(ioctx->ioctx_id, err); + + SYSIO_INTERFACE_RETURN(err ? IOID_FAIL : ioctx->ioctx_id, err); } #if _LARGEFILE64_SOURCE @@ -1310,10 +1214,8 @@ SYSIO_INTERFACE_NAME(iwritex)(int fd, SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find_capable(fd, O_RDONLY); - if (!(fil && xtv_count)) { - errno = EBADF; + if (!(fil && xtv_count)) SYSIO_INTERFACE_RETURN(IOID_FAIL, -EBADF); - } ixtv = ixtvent = malloc(xtv_count * sizeof(struct intnl_xtvec)); if (!ixtv) @@ -1336,10 +1238,9 @@ SYSIO_INTERFACE_NAME(iwritex)(int fd, &ioctx); if (err) { free(ixtv); - errno = -err; SYSIO_INTERFACE_RETURN(IOID_FAIL, err); } - SYSIO_INTERFACE_RETURN(ioctx->ioctx_id, err); + SYSIO_INTERFACE_RETURN(ioctx->ioctx_id, 0); } #else #undef iwritex Index: stat.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/stat.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -w -b -B -p -r1.12 -r1.13 --- stat.c 27 Apr 2004 22:10:57 -0000 1.12 +++ stat.c 28 Apr 2004 11:21:46 -0000 1.13 @@ -121,15 +121,12 @@ PREPEND(__,SYSIO_INTERFACE_NAME(fxstat)) #endif err = fil->f_ino->i_ops.inop_getattr(NULL, fil->f_ino, buf); -out: - if (err) { - errno = -err; - err = -1; - } #if _LARGEFILE64_SOURCE + if (!err) convstat(buf, __stat_buf); #endif - SYSIO_INTERFACE_RETURN(err, err); +out: + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } #ifdef REDSTORM @@ -141,15 +138,10 @@ sysio_sym_weak_alias(PREPEND(__,SYSIO_IN static int PREPEND(__,SYSIO_INTERFACE_NAME(fstat))(int fd, struct stat *buf) { - int rc; - SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER; - rc = PREPEND(__,SYSIO_INTERFACE_NAME(fxstat))(_STAT_VER, + return PREPEND(__,SYSIO_INTERFACE_NAME(fxstat))(_STAT_VER, fd, buf); - - SYSIO_INTERFACE_RETURN(rc, rc); } sysio_sym_weak_alias(PREPEND(__, SYSIO_INTERFACE_NAME(fstat)), @@ -199,14 +191,11 @@ PREPEND(__,SYSIO_INTERFACE_NAME(xstat))( P_RELE(pno); #if _LARGEFILE64_SOURCE + if (!err) convstat(buf, __stat_buf); #endif out: - if (err) { - errno = -err; - err = -1; - } - SYSIO_INTERFACE_RETURN(err, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } #ifdef REDSTORM @@ -219,15 +208,10 @@ static int PREPEND(__,SYSIO_INTERFACE_NAME(stat))(const char *filename, struct stat *buf) { - int rc; - SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER; - rc = PREPEND(__,SYSIO_INTERFACE_NAME(xstat))(_STAT_VER, + return PREPEND(__,SYSIO_INTERFACE_NAME(xstat))(_STAT_VER, filename, buf); - - SYSIO_INTERFACE_RETURN(rc, rc); } sysio_sym_weak_alias(PREPEND(__,SYSIO_INTERFACE_NAME(stat)), @@ -277,14 +261,11 @@ PREPEND(__,SYSIO_INTERFACE_NAME(lxstat)) P_RELE(pno); #if _LARGEFILE64_SOURCE + if (!err) convstat(buf, __stat_buf); #endif out: - if (err) { - errno = -err; - err = -1; - } - SYSIO_INTERFACE_RETURN(err, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } #ifdef REDSTORM @@ -296,14 +277,9 @@ sysio_sym_weak_alias(PREPEND(__,SYSIO_IN static int PREPEND(__,SYSIO_INTERFACE_NAME(lstat))(const char *filename, struct stat *buf) { - int rc; - SYSIO_INTERFACE_DISPLAY_BLOCK; - - SYSIO_INTERFACE_ENTER; - rc = PREPEND(__,SYSIO_INTERFACE_NAME(lxstat))(_STAT_VER, + return PREPEND(__,SYSIO_INTERFACE_NAME(lxstat))(_STAT_VER, filename, buf); - SYSIO_INTERFACE_RETURN(rc, rc); } sysio_sym_weak_alias(PREPEND(__,SYSIO_INTERFACE_NAME(lstat)), Index: stat64.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/stat64.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -w -b -B -p -r1.8 -r1.9 --- stat64.c 27 Apr 2004 22:10:57 -0000 1.8 +++ stat64.c 28 Apr 2004 11:21:46 -0000 1.9 @@ -65,11 +65,15 @@ #undef __lxstat64 int -__fxstat64(int __ver, int __fildes, struct stat64 *__stat_buf) +PREPEND(__,SYSIO_INTERFACE_NAME(fxstat64))(int __ver, + int __fildes, + struct stat64 *__stat_buf) { struct file *fil; int err; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; if (__ver != _STAT_VER) { err = -ENOSYS; goto out; @@ -83,34 +87,29 @@ __fxstat64(int __ver, int __fildes, stru } err = fil->f_ino->i_ops.inop_getattr(NULL, fil->f_ino, __stat_buf); out: - if (err) { - errno = -err; - err = -1; - } - return err; + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } #ifndef REDSTORM int SYSIO_INTERFACE_NAME(fstat64)(int fd, struct stat64 *buf) { - int rc; - SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER; - rc = __fxstat64(_STAT_VER, fd, buf); - - SYSIO_INTERFACE_RETURN(rc, rc); + return PREPEND(__,SYSIO_INTERFACE_NAME(fxstat64))(_STAT_VER, fd, buf); } #endif int -__xstat64(int __ver, const char *__filename, struct stat64 *__stat_buf) +PREPEND(__,SYSIO_INTERFACE_NAME(xstat64))(int __ver, + const char *__filename, + struct stat64 *__stat_buf) { struct intent intent; int err; struct pnode *pno; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; if (__ver != _STAT_VER) { err = -ENOSYS; goto out; @@ -126,34 +125,31 @@ __xstat64(int __ver, const char *__filen __stat_buf); P_RELE(pno); out: - if (err) { - errno = -err; - err = -1; - } - return err; + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } #ifndef REDSTORM int SYSIO_INTERFACE_NAME(stat64)(const char *filename, struct stat64 *buf) { - int rc; - SYSIO_INTERFACE_DISPLAY_BLOCK; - - SYSIO_INTERFACE_ENTER; - rc = __xstat64(_STAT_VER, filename, buf); - SYSIO_INTERFACE_RETURN(rc, rc); + return PREPEND(__,SYSIO_INTERFACE_NAME(xstat64))(_STAT_VER, + filename, + buf); } #endif int -__lxstat64(int __ver, const char *__filename, struct stat64 *__stat_buf) +PREPEND(__,SYSIO_INTERFACE_NAME(lxstat64))(int __ver, + const char *__filename, + struct stat64 *__stat_buf) { struct intent intent; int err; struct pnode *pno; + SYSIO_INTERFACE_DISPLAY_BLOCK; + SYSIO_INTERFACE_ENTER; if (__ver != _STAT_VER) { err = -ENOSYS; goto out; @@ -169,24 +165,17 @@ __lxstat64(int __ver, const char *__file __stat_buf); P_RELE(pno); out: - if (err) { - errno = -err; - err = -1; - } - return err; + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } #ifndef REDSTORM int SYSIO_INTERFACE_NAME(lstat64)(const char *filename, struct stat64 *buf) { - int rc; - SYSIO_INTERFACE_DISPLAY_BLOCK; - - SYSIO_INTERFACE_ENTER; - rc = __lxstat64(_STAT_VER, filename, buf); - SYSIO_INTERFACE_RETURN(rc, rc); + return PREPEND(__,SYSIO_INTERFACE_NAME(lxstat64))(_STAT_VER, + filename, + buf); } #endif #endif /* !_LARGEFILE64_SOURCE */ Index: statvfs.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/statvfs.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -w -b -B -p -r1.8 -r1.9 --- statvfs.c 27 Apr 2004 22:10:57 -0000 1.8 +++ statvfs.c 28 Apr 2004 11:21:46 -0000 1.9 @@ -103,10 +103,8 @@ SYSIO_INTERFACE_NAME(statvfs)(const char #endif goto out; err: - errno = -err; - err = -1; out: - SYSIO_INTERFACE_RETURN(err, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } #ifdef REDSTORM @@ -143,10 +141,8 @@ SYSIO_INTERFACE_NAME(fstatvfs)(int fd, s #endif goto out; err: - errno = -err; - err = -1; out: - SYSIO_INTERFACE_RETURN(err, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } #ifdef REDSTORM Index: statvfs64.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/statvfs64.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- statvfs64.c 27 Apr 2004 22:10:57 -0000 1.10 +++ statvfs64.c 28 Apr 2004 11:21:46 -0000 1.11 @@ -69,11 +69,7 @@ SYSIO_INTERFACE_NAME(statvfs64)(const ch err = pno->p_base->pb_ino->i_ops.inop_statvfs(pno, NULL, buf); P_RELE(pno); out: - if (err) { - errno = -err; - err = -1; - } - SYSIO_INTERFACE_RETURN(err, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } #ifdef REDSTORM @@ -98,11 +94,7 @@ SYSIO_INTERFACE_NAME(fstatvfs64)(int fd, err = filp->f_ino->i_ops.inop_statvfs(NULL, filp->f_ino, buf); out: - if (err) { - errno = -err; - err = -1; - } - SYSIO_INTERFACE_RETURN(err, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } #ifdef REDSTORM Index: symlink.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/symlink.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -b -B -p -r1.7 -r1.8 --- symlink.c 27 Apr 2004 22:10:57 -0000 1.7 +++ symlink.c 28 Apr 2004 11:21:46 -0000 1.8 @@ -80,11 +80,7 @@ SYSIO_INTERFACE_NAME(symlink)(const char error: P_RELE(pno); out: - if (err) { - errno = -err; - err = -1; - } - SYSIO_INTERFACE_RETURN(err, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } #ifdef REDSTORM Index: truncate.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/truncate.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -w -b -B -p -r1.8 -r1.9 --- truncate.c 27 Apr 2004 22:10:57 -0000 1.8 +++ truncate.c 28 Apr 2004 11:21:46 -0000 1.9 @@ -98,11 +98,7 @@ PREPEND(_,SYSIO_INTERFACE_NAME(truncate) P_RELE(pno); out: - if (err) { - errno = -err; - err = -1; - } - SYSIO_INTERFACE_RETURN(err, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } #if _LARGEFILE64_SOURCE @@ -139,11 +135,7 @@ PREPEND(_,SYSIO_INTERFACE_NAME(ftruncate } err = do_truncate(NULL, fil->f_ino, length); out: - if (err) { - errno = -err; - err = -1; - } - SYSIO_INTERFACE_RETURN(err, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } #if _LARGEFILE64_SOURCE Index: unlink.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/unlink.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- unlink.c 27 Apr 2004 22:10:57 -0000 1.10 +++ unlink.c 28 Apr 2004 11:21:46 -0000 1.11 @@ -93,11 +93,7 @@ SYSIO_INTERFACE_NAME(unlink)(const char error: P_RELE(pno); out: - if (err) { - errno = -err; - err = -1; - } - SYSIO_INTERFACE_RETURN(err, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } #ifdef REDSTORM Index: utime.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/utime.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -b -B -p -r1.3 -r1.4 --- utime.c 27 Apr 2004 22:10:57 -0000 1.3 +++ utime.c 28 Apr 2004 11:21:46 -0000 1.4 @@ -82,9 +82,5 @@ SYSIO_INTERFACE_NAME(utime)(const char * &stbuf); P_RELE(pno); out: - if (err) { - errno = -err; - err = -1; - } - SYSIO_INTERFACE_RETURN(err, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } |
From: Lee W. <lw...@us...> - 2004-04-28 10:53:13
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17693 Modified Files: sysio.h Log Message: Work on SYSIO_INTERFACE_{DISPLAY_BLOCK,ENTER,RETURN}: + Cleaned up to parse correctly when expressions are used as args + Formatted to match *most* of the current style + RETURN now *sets* errno on error instead of simply restoring on no error. Index: sysio.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -w -b -B -p -r1.20 -r1.21 --- sysio.h 27 Apr 2004 22:13:01 -0000 1.20 +++ sysio.h 28 Apr 2004 10:53:01 -0000 1.21 @@ -352,6 +352,15 @@ extern int SYSIO_INTERFACE_NAME(umount)( /* * SYSIO interface frame macros + * + * + DISPLAY_BLOCK; Allocates storage on the stack for use by the set of + * macros. + * + ENTER; Performs entry point work + * + RETURN; Returns a value and performs exit point work + * + * NB: For RETURN, the arguments are the return value and value for errno. + * If the value for errno is non-zero then that value, *negated*, is set + * into errno. */ #define SYSIO_INTERFACE_DISPLAY_BLOCK \ int _saved_errno; @@ -363,7 +372,7 @@ extern int SYSIO_INTERFACE_NAME(umount)( #define SYSIO_INTERFACE_RETURN(rtn, err) \ do { \ SYSIO_LEAVE; \ - if (err == 0) errno = _saved_errno; \ + errno = (err) ? -(err) : _saved_errno; \ return (rtn); \ } while(0) |
From: Ruth K. <rk...@us...> - 2004-04-27 23:01:21
|
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31094 Modified Files: Tag: gmdev helper.pm sysio_stubs.c sysio_tests.c test_all.pl test_copy.pl test_driver.c test_getcwd.pl test_path.pl test_stats.pl Added Files: Tag: gmdev test_strided.pl Log Message: merge head changes into gmdev branch --- NEW FILE --- #!/usr/bin/perl -w # # strided IO test: Perform a series of different reads/writes # using readx and writex with different buffer # configurations # use IPC::Open2; use strict; use FindBin; use lib "$FindBin::Bin"; use helper; sub usage { print "Usage: ./test_rw.pl [-alpha] <file>: Write to/read from file\n"; exit(-1); } sub verify_result { my ($cmdfh, $outfh, $cmdstr, $exp_val, $eq_op) = @_; my $print_err = 0; my $res = helper::verify_cmd($cmdfh, $outfh, $cmdstr); $res = oct($res); if ($eq_op eq "!=") { if ($res != $exp_val) { print STDOUT "Error! $cmdstr returned $res insted of $exp_val\n"; system("killall test_driver"); exit(1); } } else { if ($eq_op eq ">") { if ($res > $exp_val) { $print_err = 1; } } elsif ($eq_op eq "<") { if ($res < $exp_val) { $print_err = 1; } } elsif ($eq_op eq "==") { if ($res == $exp_val) { $print_err = 1; } } if ($print_err == 1) { print STDOUT "Error! $cmdstr returned $res\n"; } } } # Initilize the iovec number $vecnum # in the iovec buffer $vecname with buffer # pos $buf and using len $veclen sub set_iovec { my ($cmdfh, $outfh, $vecname, $vecnum, $buf, $veclen) = @_; my $cmdstr = 'CALL init_iovec $'.$buf." 0 $veclen "; $cmdstr .= "$vecnum ".'$'."$vecname\n"; helper::send_cmd($cmdfh, $outfh, "init_iovec", $cmdstr); helper::verify_cmd($cmdfh, $outfh, "init_iovec"); } sub setup_xtvecs { my ($cmdfh, $outfh) = @_; # Get size of iovecs my $cmdstr = '$xtvsize = CALL sizeof xtvec'."\n"; helper::send_cmd($cmdfh, $outfh, "sizeof", $cmdstr); my $size = helper::verify_cmd($cmdfh, $outfh, "sizeof xtvec"); $size = oct($size); $size = $size * 2; # Allocate iovec buffer $cmdstr = '$xtvbuf'." = ALLOC $size\n"; helper::send_cmd($cmdfh, $outfh, "alloc", $cmdstr); # Now initilize xtvbuf $cmdstr = "CALL init_xtvec 0 100 0 ". '$xtvbuf'."\n"; helper::send_cmd($cmdfh, $outfh, "init_xtvec", $cmdstr); helper::verify_cmd($cmdfh, $outfh, "init_xtvec"); $cmdstr = "CALL init_xtvec 1000 100 1 ". '$xtvbuf'."\n"; helper::send_cmd($cmdfh, $outfh, "init_xtvec", $cmdstr); helper::verify_cmd($cmdfh, $outfh, "init_xtvec"); } sub check_buf { my ($cmdfh, $outfh, $bufsize, $bufname, $readcmd, $digit, $offset) = @_; my $cmdstr = 'CALL checkbuf $'. "$bufname $bufsize $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 "$readcmd did not return all $digit 's\n"; } } # Fill given buffer with $digit up to $size # starting at $offset sub fill_buf { my ($cmdfh, $outfh, $buf, $digit, $size, $off) = @_; my $cmdstr = "CALL setbuf $digit $size ".'$'."$buf $off\n"; helper::send_cmd($cmdfh, $outfh, "setbuf", $cmdstr); } sub alloc_iovbuf { my ($cmdfh, $outfh, $numbufs, $num) = @_; # Get size of iovecs my $cmdstr = '$iovsize = CALL sizeof iovec'."\n"; helper::send_cmd($cmdfh, $outfh, "sizeof", $cmdstr); my $size = helper::verify_cmd($cmdfh, $outfh, "sizeof iovec"); $size = oct($size); $size = $size * $numbufs; # Allocate iovec buffer $cmdstr = '$iovbuf'."$num = ALLOC $size\n"; helper::send_cmd($cmdfh, $outfh, "alloc", $cmdstr); my $retstr = "iovbuf".$num; return $retstr; } sub do_rwcalls { my ($cmdfh, $outfh, $fh) = @_; # Allocate and initilize xtvecs setup_xtvecs($cmdfh, $outfh); # Allocate 2 different iovecs, one for cases # (a) and (d) and one for cases (b) and (c) my $iovbuf1 = alloc_iovbuf($cmdfh, $outfh, 3, 0); my $iovbuf2 = alloc_iovbuf($cmdfh, $outfh, 1, 1); # Allocate four buffers, each 200 bytes long my $cmdstr = '$buf1 '. "= ALLOC 200\n"; helper::send_cmd($cmdfh, $outfh, "alloc", $cmdstr); $cmdstr = '$buf2 '. "= ALLOC 200\n"; helper::send_cmd($cmdfh, $outfh, "alloc", $cmdstr); $cmdstr = '$buf3 '. "= ALLOC 200\n"; helper::send_cmd($cmdfh, $outfh, "alloc", $cmdstr); $cmdstr = '$buf4 '. "= ALLOC 200\n"; helper::send_cmd($cmdfh, $outfh, "alloc", $cmdstr); # Case (a): # xtvec[] = { { 0, 100 }, {1000, 100} } # iovec[] = { { buf1, 50}, {buf2, 50}, {buf3, 100} # Fill each of the 3 buffers of. They will be filled # as follows: # buf1 --> 0- 49: 1 # --> 49-200: 2 # buf2 --> 0- 49: 3 # --> 49-200: 4 # buf3 --> 0-100: 5 # --> 100-200: 6 fill_buf($cmdfh, $outfh, "buf1", 1, 50, 0); fill_buf($cmdfh, $outfh, "buf1", 2, 150, 50); fill_buf($cmdfh, $outfh, "buf2", 3, 50, 0); fill_buf($cmdfh, $outfh, "buf2", 4, 150, 50); fill_buf($cmdfh, $outfh, "buf3", 5, 100, 0); fill_buf($cmdfh, $outfh, "buf3", 6, 100, 100); # Initiize iovecs set_iovec($cmdfh, $outfh, $iovbuf1, 0, "buf1", 50); set_iovec($cmdfh, $outfh, $iovbuf1, 1, "buf2", 50); set_iovec($cmdfh, $outfh, $iovbuf1, 2, "buf3", 100); # Write out to $fh $cmdstr = 'CALL writex $'."$fh $iovbuf1 3 ".'$xtvbuf '."2\n"; helper::send_cmd($cmdfh, $outfh, "writex", $cmdstr); verify_result($cmdfh, $outfh, "writex (case a)", 200, "!="); # Clear out the buffers fill_buf($cmdfh, $outfh, "buf1", 0, 200, 0); fill_buf($cmdfh, $outfh, "buf2", 0, 200, 0); fill_buf($cmdfh, $outfh, "buf3", 0, 200, 0); # Read it back $cmdstr = 'CALL readx $'."$fh $iovbuf1 3 ".'$xtvbuf '."2\n"; helper::send_cmd($cmdfh, $outfh, "readx", $cmdstr); verify_result($cmdfh, $outfh, "readx (case a)", 200, "!="); # Make sure we got what we expected... check_buf($cmdfh, $outfh, 50, "buf1", "readx (case a)", 1, 0); check_buf($cmdfh, $outfh, 50, "buf2", "readx (case a)", 3, 0); check_buf($cmdfh, $outfh, 100, "buf3", "readx (case a)", 5, 0); # Case (b): # xtvec[] = { { 0, 100 }, {1000, 100} } # iovec[] = { { buf4, 200} } # Fill buf4 with 7's... fill_buf($cmdfh, $outfh, "buf4", 7, 200, 0); # Initiize iovecs set_iovec($cmdfh, $outfh, $iovbuf2, 0, "buf4", 200); # Write out to $fh $cmdstr = 'CALL writex $'."$fh ".'$'."$iovbuf2 1 ".'$xtvbuf '."2\n"; helper::send_cmd($cmdfh, $outfh, "writex", $cmdstr); verify_result($cmdfh, $outfh, "writex (case b)", 200, "!="); # Clear out the buffer fill_buf($cmdfh, $outfh, "buf4", 0, 200, 0); # Read it back $cmdstr = 'CALL readx $'."$fh $iovbuf2 1 ".'$xtvbuf '."2\n"; helper::send_cmd($cmdfh, $outfh, "readx", $cmdstr); verify_result($cmdfh, $outfh, "readx (case b)", 200, "!="); # Make sure we got what we expected... check_buf($cmdfh, $outfh, 200, "buf4", "readx (case b)", 7, 0); # Case (c): # xtvec[] = { { 0, 100 }, {1000, 100} } # iovec[] = { { buf4, 40} } # Fill buf4 with 8's... fill_buf($cmdfh, $outfh, "buf4", 8, 200, 0); # Initiize iovecs set_iovec($cmdfh, $outfh, $iovbuf2, 0, "buf4", 40); # Write out to $fh $cmdstr = 'CALL writex $'."$fh $iovbuf2 1 ".'$xtvbuf '."2\n"; helper::send_cmd($cmdfh, $outfh, "writex", $cmdstr); verify_result($cmdfh, $outfh, "writex (case c)", 40, "!="); # Clear out the buffer fill_buf($cmdfh, $outfh, "buf4", 0, 200, 0); # Read it back $cmdstr = 'CALL readx $'."$fh $iovbuf2 1 ".'$xtvbuf '."2\n"; helper::send_cmd($cmdfh, $outfh, "readx", $cmdstr); verify_result($cmdfh, $outfh, "readx (case c)", 40, "!="); # Make sure we got what we expected... check_buf($cmdfh, $outfh, 40, "buf4", "readx (case c)", 8, 0); # Case (d): # xtvec[] = { { 0, 100 }, {1000, 100} } # iovec[] = { { buf1, 40}, {buf2, 150}, {buf3, 200} } # Fill each of the 3 buffers of. They will be filled # as follows: # buf1 --> 0- 39: 1 # --> 39-200: 2 # buf2 --> 0-150: 3 # --> 150-200: 4 # buf3 --> 0- 9: 5 # --> 10-200: 6 fill_buf($cmdfh, $outfh, "buf1", 1, 40, 0); fill_buf($cmdfh, $outfh, "buf1", 2, 160, 40); fill_buf($cmdfh, $outfh, "buf2", 3, 150, 0); fill_buf($cmdfh, $outfh, "buf2", 4, 50, 150); fill_buf($cmdfh, $outfh, "buf3", 5, 10, 0); fill_buf($cmdfh, $outfh, "buf3", 6, 190, 10); # Initiize iovecs set_iovec($cmdfh, $outfh, $iovbuf1, 0, "buf1", 40); set_iovec($cmdfh, $outfh, $iovbuf1, 1, "buf2", 150); set_iovec($cmdfh, $outfh, $iovbuf1, 2, "buf3", 200); # Write out to $fh $cmdstr = 'CALL writex $'."$fh $iovbuf1 3 ".'$xtvbuf '."2\n"; helper::send_cmd($cmdfh, $outfh, "writex", $cmdstr); verify_result($cmdfh, $outfh, "writex (case d)", 200, "!="); # Clear out the buffers fill_buf($cmdfh, $outfh, "buf1", 0, 200, 0); fill_buf($cmdfh, $outfh, "buf2", 0, 200, 0); fill_buf($cmdfh, $outfh, "buf3", 0, 200, 0); # Read it back $cmdstr = 'CALL readx $'."$fh $iovbuf1 3 ".'$xtvbuf '."2\n"; helper::send_cmd($cmdfh, $outfh, "readx", $cmdstr); verify_result($cmdfh, $outfh, "readx (case d)", 200, "!="); # Make sure we got what we expected... check_buf($cmdfh, $outfh, 40, "buf1", "readx (case d)", 1, 0); check_buf($cmdfh, $outfh, 150, "buf2", "readx (case d)", 3, 0); check_buf($cmdfh, $outfh, 10, "buf3", "readx (case d)", 5, 0); # Case (e): # xtvec[] = { { 0, 100 }, {1000, 100} } # iovec[] = { { buf1, 30}, {buf2, 30}, {buf3, 30} } # Fill each of the 3 buffers as follows: # buf1 --> 0- 30: 1 # --> 30-200: 2 # buf2 --> 0- 30: 3 # --> 30-200: 4 # buf3 --> 0- 30: 5 # --> 30-200: 6 fill_buf($cmdfh, $outfh, "buf1", 1, 30, 0); fill_buf($cmdfh, $outfh, "buf1", 2, 170, 30); fill_buf($cmdfh, $outfh, "buf2", 3, 30, 0); fill_buf($cmdfh, $outfh, "buf2", 4, 170, 30); fill_buf($cmdfh, $outfh, "buf3", 5, 30, 0); fill_buf($cmdfh, $outfh, "buf3", 6, 170, 30); # Initiize iovecs set_iovec($cmdfh, $outfh, $iovbuf1, 0, "buf1", 30); set_iovec($cmdfh, $outfh, $iovbuf1, 1, "buf2", 30); set_iovec($cmdfh, $outfh, $iovbuf1, 2, "buf3", 30); # Write out to $fh $cmdstr = 'CALL writex $'."$fh $iovbuf1 3 ".'$xtvbuf '."2\n"; helper::send_cmd($cmdfh, $outfh, "writex", $cmdstr); verify_result($cmdfh, $outfh, "writex (case e)", 90, "!="); # Clear out the buffers fill_buf($cmdfh, $outfh, "buf1", 0, 200, 0); fill_buf($cmdfh, $outfh, "buf2", 0, 200, 0); fill_buf($cmdfh, $outfh, "buf3", 0, 200, 0); # Read it back $cmdstr = 'CALL readx $'."$fh $iovbuf1 3 ".'$xtvbuf '."2\n"; helper::send_cmd($cmdfh, $outfh, "readx", $cmdstr); verify_result($cmdfh, $outfh, "readx (case e)", 90, "!="); # Make sure we got what we expected... check_buf($cmdfh, $outfh, 30, "buf1", "readx (case e)", 1, 0); check_buf($cmdfh, $outfh, 30, "buf2", "readx (case e)", 3, 0); check_buf($cmdfh, $outfh, 30, "buf3", "readx (case e)", 5, 0); # Case (f): # xtvec[] = { { 0, 100 }, {1000, 100} } # iovec[] = { { buf1, 30}, {buf2, 90}, {buf3, 200} } # Fill each of the 3 buffers as follows: # buf1 --> 0- 30: 1 # --> 30-200: 2 # buf2 --> 0- 70: 3 # --> 70- 90: 4 # --> 90-200: 5 # buf3 --> 0-200: 6 fill_buf($cmdfh, $outfh, "buf1", 1, 30, 0); fill_buf($cmdfh, $outfh, "buf1", 2, 170, 30); fill_buf($cmdfh, $outfh, "buf2", 3, 70, 0); fill_buf($cmdfh, $outfh, "buf2", 4, 90, 70); fill_buf($cmdfh, $outfh, "buf2", 5, 110, 90); fill_buf($cmdfh, $outfh, "buf3", 6, 200, 0); # Initiize iovecs set_iovec($cmdfh, $outfh, $iovbuf1, 0, "buf1", 30); set_iovec($cmdfh, $outfh, $iovbuf1, 1, "buf2", 90); set_iovec($cmdfh, $outfh, $iovbuf1, 2, "buf3", 200); # Write out to $fh $cmdstr = 'CALL writex $'."$fh $iovbuf1 3 ".'$xtvbuf '."2\n"; helper::send_cmd($cmdfh, $outfh, "writex", $cmdstr); verify_result($cmdfh, $outfh, "writex (case f)", 200, "!="); # Clear out the buffers fill_buf($cmdfh, $outfh, "buf1", 0, 200, 0); fill_buf($cmdfh, $outfh, "buf2", 0, 200, 0); fill_buf($cmdfh, $outfh, "buf3", 0, 200, 0); # Read it back $cmdstr = 'CALL readx $'."$fh $iovbuf1 3 ".'$xtvbuf '."2\n"; helper::send_cmd($cmdfh, $outfh, "readx", $cmdstr); verify_result($cmdfh, $outfh, "readx (case f)", 200, "!="); # Make sure we got what we expected... check_buf($cmdfh, $outfh, 30, "buf1", "readx (case f)", 1, 0); check_buf($cmdfh, $outfh, 70, "buf2", "readx (case f)", 3, 0); check_buf($cmdfh, $outfh, 20, "buf2", "readx (case f)", 4, 70); check_buf($cmdfh, $outfh, 70, "buf3", "readx (case f)", 6, 0); } sub process_cmd { my ($file, $is_alpha) = @_; # Get tests directory my $testdir = $FindBin::Bin; eval { if ($is_alpha == 0) { open2(\*OUTFILE, \*CMDFILE, "$testdir/test_driver --np"); } else { open2(\*OUTFILE, \*CMDFILE, "yod -quiet -sz 1 $testdir/test_driver --np"); } }; if ($@) { if ($@ =~ /^open2/) { warn "open2 failed: $!\n$@\n"; return; } die; } my $outfh = \*OUTFILE; my $cmdfh = \*CMDFILE; if ($is_alpha == 0) { helper::send_cmd($cmdfh, $outfh, "init", "CALL init\n"); } # Open file my $cmdstr = '$fd = CALL open '."$file O_RDWR|O_CREAT|O_TRUNC S_IRWXU\n"; helper::send_cmd($cmdfh, $outfh, "open", $cmdstr); helper::verify_cmd($cmdfh, $outfh, $cmdstr); do_rwcalls($cmdfh, $outfh, "fd"); # Clean up $cmdstr = 'CALL close $fd'."\n"; helper::send_cmd($cmdfh, $outfh, "close", $cmdstr); # system("rm -f $file"); helper::print_and_exit($cmdfh, $outfh, 0, "strided IO test successful\n"); } my $currarg = 0; my $is_alpha = 0; if (@ARGV < 1) { usage; } elsif (@ARGV > 1 ) { if ($ARGV[$currarg++] eq "-alpha") { $is_alpha = 1; } } my $file = $ARGV[$currarg]; process_cmd($file, $is_alpha); exit 0; Index: helper.pm =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/helper.pm,v retrieving revision 1.3 retrieving revision 1.3.8.1 diff -u -w -b -B -p -r1.3 -r1.3.8.1 --- helper.pm 10 Oct 2003 18:50:31 -0000 1.3 +++ helper.pm 27 Apr 2004 23:00:52 -0000 1.3.8.1 @@ -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: sysio_stubs.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/sysio_stubs.c,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -u -w -b -B -p -r1.11 -r1.11.2.1 --- sysio_stubs.c 1 Mar 2004 22:46:39 -0000 1.11 +++ sysio_stubs.c 27 Apr 2004 23:00:53 -0000 1.11.2.1 @@ -144,14 +144,14 @@ int test_do_fillbuff(int argc, char **ar size, buf, (char *)valptr)); memcpy(buf, valptr, size); } else if (!strcmp(typestr, "PTR")) { - unsigned int val; + unsigned long val; int index = get_obj(argv[0]); if (index < 0) { DBG(2, fprintf(outfp, "Unable to find buffer at %s\n", argv[0])); return INVALID_VAR; } - val = (unsigned int)buflist[index]->buf; + val = (unsigned long)buflist[index]->buf; valptr = &val; DBG(4, fprintf(outfp, "Copying %d bytes from %p. Val is %p\n", size, buf, valptr)); @@ -220,7 +220,7 @@ int test_do_printbuf(int argc, char **ar if (argv[0][0] == '$') { if (argv[0][1] == '$') { - sprintf(output, "\n%#010x", last_ret_val); + sprintf(output, "\n%#010x", (unsigned int)last_ret_val); return SUCCESS; } else if (!strcmp("errno", &argv[0][1])) { sprintf(output, "\n%#010x", my_errno); @@ -847,7 +847,7 @@ int test_do_fcntl(int argc, char **argv) last_ret_val = sysio_fcntl(fd, cmd, argv[2]); else last_ret_val = sysio_fcntl(fd, cmd, NULL); - DBG(4, fprintf(outfp, "Got return value of %d\n", last_ret_val)); + DBG(4, fprintf(outfp, "Got return value of %d\n", (int)last_ret_val)); my_errno = errno; last_type = SINT; @@ -1019,7 +1019,9 @@ int test_do_getcwd(int argc, char **argv DBG(4, fprintf(outfp, "Getting cwd with buffer size of %d\n", size)); - if (!(last_ret_val = (int)getcwd(buf, size))) { + last_ret_val = 0; + if (!getcwd(buf, size)) { + last_ret_val = -1; if (errno == ERANGE) { DBG(2, fprintf(outfp, "Need a bigger buffer!\n")); } @@ -1027,6 +1029,7 @@ int test_do_getcwd(int argc, char **argv my_errno = errno; + DBG(3, fprintf(outfp, "cwd: %s\n", buf)); last_type = SINT; @@ -1400,7 +1403,7 @@ int test_do_umask(int argc, char **argv) int test_do_iowait(int argc, char **argv) { - int err; + long err; ioid_t ioid; if (argc != 1) { @@ -1428,7 +1431,7 @@ int test_do_iowait(int argc, char **argv int test_do_iodone(int argc, char **argv) { - int err; + long err; ioid_t ioid; if (argc != 1) { @@ -1490,7 +1493,7 @@ int test_do_ipread(int argc, char **argv return INVALID_ARGS; } - last_ret_val = (int) ipread(fd, buf, count, offset); + last_ret_val = (long)ipread(fd, buf, count, offset); if (last_ret_val < 0) { my_perror("ipread"); } @@ -1530,7 +1533,7 @@ int test_do_iread(int argc, char **argv) return INVALID_ARGS; } - last_ret_val = (int) iread(fd, buf, count); + last_ret_val = (long) iread(fd, buf, count); if (last_ret_val < 0) { my_perror("iread"); } @@ -1584,9 +1587,9 @@ int test_do_ipreadv(int argc, char **arg } DBG(3, fprintf(outfp, "ipreadv(fd: %d vector:{iov_base: %p iov_len %d} count: %d offset: %d\n", - fd, iov->iov_base, iov->iov_len, count, (int) offset)); + fd, iov->iov_base, (int)iov->iov_len, count, (int) offset)); - last_ret_val = (int) ipreadv(fd, iov, count, offset); + last_ret_val = (long) ipreadv(fd, iov, count, offset); if (last_ret_val < 0) my_perror("ipreadv"); my_errno = errno; @@ -1639,7 +1642,7 @@ int test_do_preadv(int argc, char **argv } DBG(3, fprintf(outfp, "preadv(fd: %d vector:{iov_base: %p iov_len %d} count: %d offset: %d\n", - fd, iov->iov_base, iov->iov_len, count, (int) offset)); + fd, iov->iov_base, (int) iov->iov_len, count, (int) offset)); last_ret_val = preadv(fd, iov, count, offset); my_errno = errno; @@ -1740,9 +1743,9 @@ int test_do_ireadv(int argc, char **argv } DBG(3, fprintf(outfp, "ireadv (fd: %d, vector:{ iov_base: %p iov_len %d }, count: %d\n", - fd, iov->iov_base, iov->iov_len, count)); + fd, iov->iov_base, (int)iov->iov_len, count)); - last_ret_val = (int) ireadv(fd, iov, count); + last_ret_val = (long) ireadv(fd, iov, count); if (last_ret_val < 0) my_perror("ireadv"); my_errno = errno; @@ -1787,7 +1790,7 @@ int test_do_readv(int argc, char **argv) } DBG(3, fprintf(outfp, "ireadv (fd: %d, vector:{ iov_base: %p iov_len %d }, count: %d\n", - fd, iov->iov_base, iov->iov_len, count)); + fd, iov->iov_base, (int)iov->iov_len, count)); last_ret_val = readv(fd, iov, count); if (last_ret_val < 0) @@ -1894,9 +1897,9 @@ int test_do_ipwritev(int argc, char **ar DBG(3, fprintf(outfp, "ipwritev(fd: %d, vector: { iov_base: %p iov_len %d }, count: %d, offset: %d\n", - fd, iov->iov_base, iov->iov_len, count, offset)); + fd, iov->iov_base, (int)iov->iov_len, count, offset)); - last_ret_val = (int) ipwritev(fd, iov, count, offset); + last_ret_val = (long) ipwritev(fd, iov, count, offset); my_errno = errno; if (last_ret_val < 0) my_perror("ipwritev"); @@ -1943,7 +1946,7 @@ int test_do_ipwrite(int argc, char **arg return INVALID_ARGS; } - last_ret_val = (int) ipwrite(fd, buf, count, offset); + last_ret_val = (long) ipwrite(fd, buf, count, offset); if (last_ret_val < 0) my_perror("ipwrite"); my_errno = errno; @@ -1996,9 +1999,9 @@ int test_do_pwritev(int argc, char **arg DBG(3, fprintf(outfp, "pwritev(fd: %d, vector: { iov_base: %p iov_len %d }, count: %d, offset: %d\n", - fd, iov->iov_base, iov->iov_len, count, offset)); + fd, iov->iov_base, (int)iov->iov_len, count, offset)); - last_ret_val = pwritev(fd, iov, count, offset); + last_ret_val = (long) pwritev(fd, iov, count, offset); if (last_ret_val < 0) my_perror("ipwritev"); my_errno = errno; @@ -2091,9 +2094,9 @@ int test_do_iwritev(int argc, char **arg } DBG(3, fprintf(outfp, "iwritev(fd: %d, vector: { iov_base: %p iov_len %d }, count: %d\n", - fd, iov->iov_base, iov->iov_len, count)); + fd, iov->iov_base, (int)iov->iov_len, count)); - last_ret_val = (int) iwritev(fd, iov, count); + last_ret_val = (long) iwritev(fd, iov, count); my_errno = errno; if (last_ret_val < 0) my_perror("iwritev"); @@ -2134,7 +2137,7 @@ int test_do_iwrite(int argc, char **argv return INVALID_ARGS; } - last_ret_val = (int) iwrite(fd, buf, count); + last_ret_val = (long) iwrite(fd, buf, count); my_errno = errno; if (last_ret_val < 0) my_perror("iwrite"); @@ -2226,7 +2229,7 @@ int test_do_writev(int argc, char **argv } DBG(3, fprintf(outfp, "writev(fd: %d, vector: { iov_base: %p iov_len %d }, count: %d\n", - fd, iov->iov_base, iov->iov_len, count)); + fd, iov->iov_base, (int)iov->iov_len, count)); last_ret_val = writev(fd, iov, count); if (last_ret_val < 0) @@ -2320,7 +2323,7 @@ int test_do_init_iovec(int argc, char ** 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)); + (int)iov_ptr[pos].iov_len, iov_ptr[pos].iov_base)); my_errno = errno; last_type = PTR; @@ -2364,7 +2367,7 @@ int test_do_init_xtvec(int argc, char ** xtv_ptr[pos].xtv_off = offset; DBG(3, fprintf(outfp, "xtv_ptr.len is %d and offset is %d\n", - xtv_ptr[pos].xtv_len, (int)xtv_ptr[pos].xtv_off)); + (int)xtv_ptr[pos].xtv_len, (int)xtv_ptr[pos].xtv_off)); my_errno = errno; last_type = PTR; @@ -2494,7 +2497,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, (void *)iov, iov_count, (void *)xtv, xtv_count)); - last_ret_val = (int) iwritex(fd, iov, iov_count, xtv, xtv_count); + last_ret_val = (long) iwritex(fd, iov, iov_count, xtv, xtv_count); if (last_ret_val < 0) my_perror("iwritex"); my_errno = errno; @@ -2626,7 +2629,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, (void *)iov, iov_count, (void *)xtv, xtv_count)); - last_ret_val = (int) ireadx(fd, iov, iov_count, xtv, xtv_count); + last_ret_val = (long) ireadx(fd, iov, iov_count, xtv, xtv_count); if (last_ret_val < 0) my_perror("ireadx"); my_errno = errno; Index: sysio_tests.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/sysio_tests.c,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -w -b -B -p -r1.6 -r1.6.2.1 --- sysio_tests.c 24 Feb 2004 15:46:33 -0000 1.6 +++ sysio_tests.c 27 Apr 2004 23:00:53 -0000 1.6.2.1 @@ -13,9 +13,6 @@ #include <sys/queue.h> #include <dirent.h> -#include <pwd.h> -#include <grp.h> - #include "sysio.h" #include "mount.h" #include "test.h" @@ -31,21 +28,7 @@ */ int initilize_sysio() { - int err; char *wd; - extern int _test_sysio_startup(void); - - /* - * Init sysio lib. - */ - err = _test_sysio_startup(); - DBG(5, sprintf(output, "%s_test_sysio_startup: err %d\n", output, err)); - if (err) { - my_errno = err; - my_perror("sysio startup"); - last_ret_val = errno; - return SUCCESS; - } /* * Attempt to set the cwd by getting it out of the @@ -451,8 +434,6 @@ int sysio_chown(char *new_id, char *file { char *owner = NULL; char *group = NULL; - struct group *g_ent = NULL; - struct passwd *o_ent = NULL; uid_t o_id=-1, g_id=-1; int len, j, i=0; int state = 0; /* Correspond to getting owner name */ @@ -492,19 +473,12 @@ int sysio_chown(char *new_id, char *file /* Numeric -- just convert */ o_id = (uid_t) atoi(owner); - /* Make sure it is valid */ - if ((o_ent = getpwuid(o_id)) == NULL) { - DBG(2, sprintf(output, "Error: uid %d not found \n", o_id)); - return INVALID_ARGS; - } } else { - /* Get the id from the passwd file */ - if ((o_ent = getpwnam(owner)) == NULL) { - DBG(2, sprintf(output, "Error: name %s not found\n", owner)); + /* No longer support non-numeric ids */ + + DBG(2, sprintf(output, "Error: non-numeric ids unsupported\n")); return INVALID_ARGS; } - o_id = o_ent->pw_uid; - } } @@ -513,20 +487,11 @@ int sysio_chown(char *new_id, char *file if (isdigit(group[0])) { /* Numeric -- just convert */ g_id = (uid_t) atoi(group); - - /* Make sure it is valid */ - if ((g_ent = getgrgid(g_id)) == NULL) { - DBG(2, sprintf(output, "Error: gid %d not found \n", g_id)); - return INVALID_ARGS; - } } else { - /* Find group in group file */ - if ((g_ent = getgrnam(group)) == NULL) { - DBG(2, sprintf(output, "Error: group %s not found \n", group)); + /* Don't support group names either */ + DBG(2, sprintf(output, "Error: non-numeric ids unsupported\n")); return INVALID_ARGS; } - g_id = g_ent->gr_gid; - } } /* Now issue the syscall */ @@ -543,7 +508,7 @@ int sysio_open(char *path, int flags) last_ret_val = open(path, flags); my_errno = errno; DBG(3, sprintf(output, "Returning with errno set to %s (ret val is %d)\n", - strerror(my_errno), last_ret_val)); + strerror(my_errno), (int)last_ret_val)); return SUCCESS; } @@ -650,7 +615,7 @@ void print_stat(struct stat *st) DBG(3, sprintf(output, "%s st_dev: %#16x\n", output, (unsigned int)st->st_dev)); DBG(3, sprintf(output, "%s st_ino: %#16x\n", output, (unsigned int) st->st_ino)); DBG(3, sprintf(output, "%s st_mode: %#16x\n", output, st->st_mode)); - DBG(3, sprintf(output, "%s st_nlink: %#16x\n", output, st->st_nlink)); + DBG(3, sprintf(output, "%s st_nlink: %#16x\n", output, (int)st->st_nlink)); DBG(3, sprintf(output, "%s st_uid: %#16x\n", output, st->st_uid)); DBG(3, sprintf(output, "%s st_gid: %#16x\n", output, st->st_gid)); DBG(3, sprintf(output, "%s st_rdev: %#16x\n", output, (int)st->st_rdev)); Index: test_all.pl =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_all.pl,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -u -w -b -B -p -r1.9 -r1.9.2.1 --- test_all.pl 14 Feb 2004 19:43:00 -0000 1.9 +++ test_all.pl 27 Apr 2004 23:00:53 -0000 1.9.2.1 @@ -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 Index: test_copy.pl =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_copy.pl,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -u -w -b -B -p -r1.5 -r1.5.2.1 --- test_copy.pl 14 Feb 2004 19:43:00 -0000 1.5 +++ test_copy.pl 27 Apr 2004 23:00:53 -0000 1.5.2.1 @@ -68,12 +68,14 @@ sub process_cmd $bufsize = $size; } - + my $cmdstr; # Open src - my $cmdstr = '$src = CALL open '."$src O_RDONLY\n"; + if ($src ne "/dev/stdin") { + $cmdstr = '$src = CALL open '."$src O_RDONLY\n"; helper::send_cmd($cmdfh, $outfh, "open", $cmdstr); helper::verify_cmd($cmdfh, $outfh, "open $src"); - + } + if ($dest ne "/dev/stdout") { # Open dest my $flags = "O_WRONLY|O_CREAT"; if ($overwrite == 0) { @@ -82,6 +84,7 @@ sub process_cmd $cmdstr = '$dest = CALL open '."$dest $flags 0666\n"; helper::send_cmd($cmdfh, $outfh, "open", $cmdstr); my $destfile = helper::verify_cmd($cmdfh, $outfh, "open $dest"); + } # Allocate buffer $cmdstr = '$buf = ALLOC '."$bufsize\n"; @@ -96,7 +99,7 @@ sub process_cmd if ($src eq "/dev/stdin") { # Send "delay" option to read which will give us time to # put something in stdin (since we can't send an eof) - my $cmdstr = "CALL read ".'$src $buf '."$bytes delay\n"; + my $cmdstr = "CALL read ".'0 $buf '."$bytes delay\n"; print $cmdfh $cmdstr; # Give time to process command sleep 1; @@ -119,7 +122,11 @@ sub process_cmd helper::print_and_exit($cmdfh, $outfh, 0, "Short read\n"); } + if ($dest eq "/dev/stdout") { + $cmdstr = "CALL write ".'1 $buf '."$readb\n"; + } else { $cmdstr = "CALL write ".'$dest $buf '."$readb\n"; + } print $cmdfh $cmdstr; # Suck up the stdout... @@ -156,11 +163,14 @@ sub process_cmd } # Clean up + if ($src ne "/dev/stdin") { $cmdstr = 'CALL close $src'."\n"; helper::send_cmd($cmdfh, $outfh, "close", $cmdstr); + } + if ($dest ne "/dev/stdout") { $cmdstr = 'CALL close $dest'."\n"; helper::send_cmd($cmdfh, $outfh, "close", $cmdstr); - + } if ($src ne "/dev/stdin") { my $cmpres = system("cmp -s $src $dest"); if ($cmpres != 0) { Index: test_driver.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_driver.c,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -u -w -b -B -p -r1.8 -r1.8.2.1 --- test_driver.c 24 Feb 2004 15:46:34 -0000 1.8 +++ test_driver.c 27 Apr 2004 23:00:53 -0000 1.8.2.1 @@ -961,6 +961,17 @@ int main(int argc, char *argv[]) char *input, *name; char **cmd; cmd_tree *tree; + extern int _test_sysio_startup(void); + + /* + * Init sysio lib. + */ + err = _test_sysio_startup(); + + /* Temp. hack until I do the right thing to fix this...*/ + open("/dev/stdin",O_RDONLY); + open("/dev/stdout",O_WRONLY); + open("/dev/stderr",O_WRONLY); infp = stdin; outfp = stdout; Index: test_getcwd.pl =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_getcwd.pl,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -u -w -b -B -p -r1.5 -r1.5.2.1 --- test_getcwd.pl 21 Jan 2004 15:13:56 -0000 1.5 +++ test_getcwd.pl 27 Apr 2004 23:00:53 -0000 1.5.2.1 @@ -6,6 +6,8 @@ use strict; use FindBin; use lib "$FindBin::Bin"; use helper; +use Fcntl; + sub usage { @@ -35,9 +37,15 @@ sub check_wkdir my $iodir = <$outfh>; chop($iodir); - if ($wdir ne $iodir) { - helper::print_and_exit($cmdfh, $outfh, 0, - "ERROR! wdir ($wdir) does not match sysio's cwd ($iodir)\n"); + # Only compare the last portion of the working directory + my @iodirs = split(/\//, $iodir); + my @wdirs = split(/\//, $wdir); + + if ($iodirs[-1] ne $wdirs[-1]) { + helper::print_and_exit + ($cmdfh, + $outfh, 0, + "ERROR! topmost wdir ($wdirs[-1]) does not match sysio's ($iodirs[-1])\n"); } } @@ -75,7 +83,7 @@ sub process_cmd # Get current working directory from environment my $cwd = $ENV{PWD}; - check_wkdir($cwd, $outfh, $cmdfh); + } # Now change to dir Index: test_path.pl =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_path.pl,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -w -b -B -p -r1.4 -r1.4.2.1 --- test_path.pl 21 Jan 2004 15:13:56 -0000 1.4 +++ test_path.pl 27 Apr 2004 23:00:53 -0000 1.4.2.1 @@ -12,10 +12,11 @@ use FindBin; use lib "$FindBin::Bin"; use helper; use POSIX; +use Fcntl; sub usage { - print "Usage ./test_path.pl path1 [path2] [path3...] : Print each path listed and its type\n"; + print "Usage ./test_path.pl [path1 path2...] : Print each path listed and its type\n"; print " : If no paths are given, stdin is read\n"; exit(-1); } @@ -54,7 +55,7 @@ sub print_path sub process_path { - my ($cmdfh, $outfh, $path) = @_; + my ($cmdfh, $outfh, $bits, $path) = @_; # Issue the stat command my $cmdstr = 'CALL stat "'; @@ -64,7 +65,11 @@ sub process_path helper::verify_cmd($cmdfh, $outfh, "stat"); # Print out the stat buffer + if ($bits == 32) { $cmdstr = 'PRINT $buf 0 8 LONG 12 24 INT 44 8 LONG 52 8 INT 64 24 LONG'; + } else { + $cmdstr = 'PRINT $buf 0 24 LONG 24 16 INT 48 32 LONG 88 8 LONG 104 8 LONG'; + } $cmdstr .= "\n"; helper::send_cmd($cmdfh, $outfh, "PRINT", $cmdstr); @@ -73,7 +78,11 @@ sub process_path my ( $iodev, $ioino, $iomode, $ionlink, $iouid, $iogid, $iordev, $iosize, $ioblksize, $ioblks, $ioatime, $iomtime, $ioctime ) = split(' ', $res); - + if ($bits == 64) { + ( $iodev, $ioino, $ionlink, $iomode, $iouid, $iogid, $iordev, + $iosize, $ioblksize, $ioblks, $ioatime, $iomtime, $ioctime ) + = split(' ', $res); + } $iomode = oct($iomode); # Print out the path @@ -118,6 +127,17 @@ sub process_cmd $cmdstr .= "\n"; helper::send_cmd($cmdfh, $outfh, "alloc", $cmdstr); + # Attempt to determine type + $cmdstr = 'PRINT $size'."\n"; + helper::send_cmd($cmdfh, $outfh, "print", $cmdstr); + my $statsize = <$outfh>; + chop($statsize); + $statsize = oct($statsize); + my $bits = 32; + if ($statsize == 144) { + $bits = 64; + } + my $i=0; if ($usestdin) { $path = <STDIN>; @@ -132,7 +152,7 @@ sub process_cmd # phase of loop. while (defined($path)) { - process_path($cmdfh, $outfh, $path); + process_path($cmdfh, $outfh, $bits, $path); if ($usestdin) { $path = <STDIN>; Index: test_stats.pl =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_stats.pl,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -u -w -b -B -p -r1.7 -r1.7.2.1 --- test_stats.pl 6 Feb 2004 20:07:31 -0000 1.7 +++ test_stats.pl 27 Apr 2004 23:00:53 -0000 1.7.2.1 @@ -30,7 +30,7 @@ sub usage sub cmp_stats { - my ( $cmdfh, $outfh, $is_alpha, @stats) = @_; + my ( $cmdfh, $outfh, $is_alpha, $bits, @stats) = @_; my ($iodev, $ioino, $iomode, $ionlink, $iouid, $iogid, $iordev, @@ -42,6 +42,11 @@ sub cmp_stats $iosize, $ioatime, $iomtime, $ioctime, $ioblks, $ioblksize, @pstats) = @stats; } + if ($bits == 64) { + ($iodev, $ioino, $ionlink, $iomode, $iouid, $iogid, $iordev, + $iosize, $ioblksize, $ioblks, $ioatime, $iomtime, $ioctime,@pstats) = + @stats; + } my ($pdev, $pino, $pmode, $pnlink, $puid, $pgid, $prdev, $psize, $patime, $pmtime, $pctime, $pblksize, $pblks) = @pstats; @@ -65,16 +70,19 @@ sub cmp_stats # Perl's output sub verify_stat { - my ($cmdfh, $outfh, $cmd, $is_alpha, @stats) = @_; + my ($cmdfh, $outfh, $cmd, $is_alpha, $bits, @stats) = @_; my $i=0; my $cmdstr; # Print out the stat buffer - if ($is_alpha == 0) { + if ($is_alpha == 1) { + $cmdstr = 'PRINT $buf 0 16 LONG 16 16 INT 32 8 LONG 40 4 INT 48 40 LONG'."\n"; + } elsif ($bits == 32) { $cmdstr = 'PRINT $buf 0 8 LONG 12 24 INT 44 8 LONG 48 8 INT 56 24 LONG'."\n"; } else { - $cmdstr = 'PRINT $buf 0 16 LONG 16 16 INT 32 8 LONG 40 4 INT 48 40 LONG'."\n"; + $cmdstr = 'PRINT $buf 0 24 LONG 24 16 INT 48 32 LONG 88 8 LONG 104 8 LONG'."\n"; } + helper::send_cmd($cmdfh, $outfh, "PRINT", $cmdstr); my $res = <$outfh>; @@ -86,7 +94,7 @@ sub verify_stat $i++; } - cmp_stats($cmdfh, $outfh, $is_alpha, @iostats, @stats); + cmp_stats($cmdfh, $outfh, $is_alpha, $bits, @iostats, @stats); } @@ -138,10 +146,21 @@ sub process_cmd helper::send_cmd($cmdfh, $outfh, "stat", $cmdstr); helper::verify_cmd($cmdfh, $outfh, "stat"); + # Attempt to determine type + $cmdstr = 'PRINT $size'."\n"; + helper::send_cmd($cmdfh, $outfh, "print", $cmdstr); + my $statsize = <$outfh>; + chop($statsize); + $statsize = oct($statsize); + my $bits = 32; + if ($statsize == 144) { + $bits = 64; + } + if ($use_system == 1) { # Now print the buffer out and verify that it matches # what Perl has - verify_stat($cmdfh, $outfh, "stat", $is_alpha, @stats); + verify_stat($cmdfh, $outfh, "stat", $is_alpha, $bits, @stats); } # Open the file @@ -156,7 +175,7 @@ sub process_cmd helper::verify_cmd($cmdfh, $outfh, "fstat"); if ($use_system == 1) { - verify_stat($cmdfh, $outfh, "fstat", $is_alpha, @stats); + verify_stat($cmdfh, $outfh, "fstat", $is_alpha, $bits, @stats); } # Test lstat @@ -169,7 +188,7 @@ sub process_cmd helper::verify_cmd($cmdfh, $outfh, "lstat"); if ($use_system == 1) { - verify_stat($cmdfh, $outfh, "lstat", $is_alpha, @stats); + verify_stat($cmdfh, $outfh, "lstat", $is_alpha, $bits, @stats); } if (0) { |
From: Ruth K. <rk...@us...> - 2004-04-27 22:55:49
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29858/native Modified Files: Tag: gmdev fs_native.c Log Message: merge head changes into gmdev branch Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.33.2.1 retrieving revision 1.33.2.2 diff -u -w -b -B -p -r1.33.2.1 -r1.33.2.2 --- fs_native.c 4 Mar 2004 18:08:06 -0000 1.33.2.1 +++ fs_native.c 27 Apr 2004 22:55:40 -0000 1.33.2.2 @@ -82,6 +82,33 @@ #include <sys/uio.h> #endif +#if defined(SYS_getdirentries) +#define DIR_STREAMED 0 +#define DIR_CVT_64 0 +#elif defined(SYS_getdents64) +#define DIR_STREAMED 0 +#define DIR_CVT_64 0 +#elif defined(SYS_getdents) +#define DIR_STREAMED 0 +#if defined(_LARGEFILE64_SOURCE) +#define DIR_CVT_64 1 +/* + * Kernel version of directory entry. + */ +struct linux_dirent { + unsigned long ld_ino; + unsigned long ld_off; + unsigned short ld_reclen; + char ld_name[1]; +}; +#include <dirent.h> +#else /* !defined(_LARGEFILE64_SOURCE) */ +#define DIR_CVT_64 0 +#endif /* defined(_LARGEFILE64_SOURCE) */ +#else /* catch-none */ +#error No usable directory fill entries interface available +#endif + /* * Local host file system driver. */ @@ -220,6 +247,7 @@ static int native_inop_unlink(struct pno static int native_inop_rename(struct pnode *old, struct pnode *new); static int native_inop_read(struct inode *ino, struct ioctx *ioctx); static int native_inop_write(struct inode *ino, struct ioctx *ioctx); +static _SYSIO_OFF_T native_inop_pos(struct inode *ino, _SYSIO_OFF_T off); static int native_inop_iodone(struct ioctx *ioctx); static int native_inop_fcntl(struct inode *ino, int cmd, va_list ap); static int native_inop_sync(struct inode *ino); @@ -257,6 +285,7 @@ static struct inode_ops native_i_ops = { native_inop_rename, native_inop_read, native_inop_write, + native_inop_pos, native_inop_iodone, native_inop_fcntl, native_inop_sync, @@ -890,46 +919,125 @@ native_pos(int fd, _SYSIO_OFF_T *offset, } static ssize_t -native_getdirentries(struct inode *ino, +native_filldirentries(struct native_inode *nino, char *buf, size_t nbytes, _SYSIO_OFF_T *basep) { - struct native_inode *nino = I2NI(ino); int err; -#ifndef SYS_getdirentries - _SYSIO_OFF_T result; -#endif ssize_t cc; - assert(nino->ni_fd >= 0); + if (*basep < 0) + return -EINVAL; -#ifndef SYS_getdirentries - result = *basep; - if (*basep != nino->ni_fpos) { - err = native_pos(nino->ni_fd, &result, SEEK_SET); - if (err) +#if !DIR_STREAMED + /* + * Stream-oriented access requires that we reposition prior to the + * fill call. + */ + if ((err = native_pos(nino->ni_fd, basep, SEEK_SET)) != 0) return err; - } - nino->ni_fpos = result; -#ifdef SYS_getdents64 - cc = syscall(SYS_getdents64, nino->ni_fd, buf, nbytes); -#else - cc = syscall(SYS_getdents, nino->ni_fd, buf, nbytes); #endif -#else /* defined(SYS_getdirentries) */ + nino->ni_fpos = *basep; + cc = +#if defined(SYS_getdirentries) syscall(SYS_getdirentries, nino->ni_fd, buf, nbytes, basep, &nino->ni_fpos); -#endif /* !defined(SYS_getdirentries) */ +#elif defined(SYS_getdents64) + syscall(SYS_getdents64, nino->ni_fd, buf, nbytes); +#elif defined(SYS_getdents) + syscall(SYS_getdents, nino->ni_fd, buf, nbytes); +#endif + if (cc < 0) return -errno; -#ifndef SYS_getdirentries - nino->ni_fpos += cc; +#if !DIR_STREAMED + /* + * Stream-oriented access requires that we discover where we are + * after the call. + */ + *basep = 0; + if ((err = native_pos(nino->ni_fd, basep, SEEK_CUR)) != 0) + return err; +#endif + nino->ni_fpos = *basep; + return cc; +} + +static ssize_t +native_getdirentries(struct inode *ino, + char *buf, + size_t nbytes, + _SYSIO_OFF_T *basep) +{ + struct native_inode *nino = I2NI(ino); +#if DIR_CVT_64 + char *bp; + size_t count; + struct linux_dirent *ldp; + struct dirent64 *d64p; + size_t namlen; + size_t reclen; +#else +#define bp buf +#define count nbytes +#endif + ssize_t cc; + + assert(nino->ni_fd >= 0); + +#if DIR_CVT_64 + count = nbytes; + while (!(bp = malloc(count))) { + count /= 2; + if (count < sizeof(struct dirent)) + return -ENOMEM; + } +#endif + cc = native_filldirentries(nino, bp, count, basep); + if (cc < 0) { +#if DIR_CVT_64 + free(bp); +#endif + return cc; + } +#if DIR_CVT_64 + ldp = (struct linux_dirent *)bp; + d64p = (struct dirent64 *)buf; + for (;;) { + if (cc < 0 || (size_t )cc <= sizeof(*ldp)) + break; + namlen = strlen(ldp->ld_name); + reclen = sizeof(*d64p) - sizeof(d64p->d_name) + namlen + 1; + if (nbytes < reclen) + break; + d64p->d_ino = ldp->ld_ino; + d64p->d_off = ldp->ld_off; + d64p->d_reclen = + (((reclen + sizeof(long) - 1)) / sizeof(long)) * + sizeof(long); + if (nbytes < d64p->d_reclen) + d64p->d_reclen = reclen; + d64p->d_type = DT_UNKNOWN; /* you lose -- sorry. */ + (void )strncpy(d64p->d_name, ldp->ld_name, namlen); + *(d64p->d_name + namlen) = '\0'; + cc -= ldp->ld_reclen; + ldp = (struct linux_dirent *)((char *)ldp + ldp->ld_reclen); + nbytes -= d64p->d_reclen; + d64p = (struct dirent64 *)((char *)d64p + d64p->d_reclen); + } + free(bp); + if (d64p == (struct dirent64 *)buf && cc) + cc = -EINVAL; /* buf too small */ + cc = (char *)d64p - buf; +#else +#undef bp +#undef count #endif return cc; } @@ -1197,24 +1305,49 @@ out: static ssize_t dopio(void *buf, size_t count, _SYSIO_OFF_T off, struct native_io *nio) { +#if defined(_LARGEFILE64_SOURCE) && \ + defined(SYS_pread64) && \ + defined(SYS_pwrite64) +#define _NATIVE_SYSCALL_PREAD SYS_pread64 +#define _NATIVE_SYSCALL_PWRITE SYS_pwrite64 +#else +#define _NATIVE_SYSCALL_PREAD SYS_pread +#define _NATIVE_SYSCALL_PWRITE SYS_pwrite +#endif + ssize_t cc; + + if (!(off == nio->nio_nino->ni_fpos || nio->nio_nino->ni_seekok)) + return -ESPIPE; + if (!nio->nio_nino->ni_seekok) { + if (off != nio->nio_nino->ni_fpos) { /* - * Avoid the reposition call if we're already at the right place. - * Allows us to access pipes and fifos. + * They've done a p{read,write} or somesuch. Can't + * seek on this descriptor so we err out now. */ - if (off != nio->nio_nino->ni_fpos) { - int err; - - err = native_pos(nio->nio_nino->ni_fd, &off, SEEK_SET); - if (err) - return err; - nio->nio_nino->ni_fpos = off; + errno = ESPIPE; + return -1; } - - return syscall(nio->nio_op == 'r' ? SYS_read : SYS_write, + cc = + syscall(nio->nio_op == 'r' ? SYS_read : SYS_write, nio->nio_nino->ni_fd, buf, count); + if (cc > 0) + nio->nio_nino->ni_fpos += cc; + } else + cc = + syscall((nio->nio_op == 'r' + ? _NATIVE_SYSCALL_PREAD + : _NATIVE_SYSCALL_PWRITE), + nio->nio_nino->ni_fd, + buf, + count, + off); + + return cc; +#undef _NATIVE_SYSCALL_PREAD +#undef _NATIVE_SYSCALL_PWRITE } static ssize_t @@ -1419,6 +1552,16 @@ native_inop_write(struct inode *ino __IS return doio('w', ioctx); } +static _SYSIO_OFF_T +native_inop_pos(struct inode *ino, _SYSIO_OFF_T off) +{ + struct native_inode *nino = I2NI(ino); + int err; + + err = native_pos(nino->ni_fd, &off, SEEK_SET); + return err < 0 ? err : off; +} + static int native_inop_iodone(struct ioctx *ioctxp __IS_UNUSED) { |
From: Ruth K. <rk...@us...> - 2004-04-27 22:55:49
|
Update of /cvsroot/libsysio/libsysio/drivers/yod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29858/yod Modified Files: Tag: gmdev fs_yod.c Log Message: merge head changes into gmdev branch Index: fs_yod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/yod/fs_yod.c,v retrieving revision 1.11.2.2 retrieving revision 1.11.2.3 diff -u -w -b -B -p -r1.11.2.2 -r1.11.2.3 --- fs_yod.c 22 Apr 2004 19:31:29 -0000 1.11.2.2 +++ fs_yod.c 27 Apr 2004 22:55:40 -0000 1.11.2.3 @@ -173,6 +173,7 @@ 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 _SYSIO_OFF_T yod_inop_pos (struct inode *ino, _SYSIO_OFF_T off); static int yod_inop_read(struct inode *ino, struct ioctx *ioctx); static int yod_inop_write(struct inode *ino, struct ioctx *ioctx); static int yod_inop_iodone(struct ioctx *ioctx); @@ -212,6 +213,7 @@ static struct inode_ops yod_i_ops = { yod_inop_rename, yod_inop_read, yod_inop_write, + yod_inop_pos, yod_inop_iodone, yod_inop_fcntl, yod_inop_sync, @@ -1085,6 +1087,16 @@ yod_inop_write(struct inode *ino __IS_UN return doio(yod_write_simple, ioctx); } +static _SYSIO_OFF_T +yod_inop_pos(struct inode *ino, _SYSIO_OFF_T off) +{ + struct yod_inode *nino = I2NI(ino); + int err; + + err = lseek_yod(nino->ni_fd, off, SEEK_SET); + return err < 0 ? err : off; +} + static int yod_inop_iodone(struct ioctx *ioctxp __IS_UNUSED) { |
From: Ruth K. <rk...@us...> - 2004-04-27 22:55:49
|
Update of /cvsroot/libsysio/libsysio/drivers/incore In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29858/incore Modified Files: Tag: gmdev fs_incore.c Log Message: merge head changes into gmdev branch Index: fs_incore.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/incore/fs_incore.c,v retrieving revision 1.16.2.1 retrieving revision 1.16.2.2 diff -u -w -b -B -p -r1.16.2.1 -r1.16.2.2 --- fs_incore.c 4 Mar 2004 18:08:06 -0000 1.16.2.1 +++ fs_incore.c 27 Apr 2004 22:55:36 -0000 1.16.2.2 @@ -144,6 +144,8 @@ static int _sysio_incore_dirop_unlink(st static int _sysio_incore_dirop_rename(struct pnode *old, struct pnode *new); static int _sysio_incore_filop_read(struct inode *ino, struct ioctx *ioctx); static int _sysio_incore_filop_write(struct inode *ino, struct ioctx *ioctx); +static _SYSIO_OFF_T _sysio_incore_filop_pos(struct inode *ino, + _SYSIO_OFF_T off); static int _sysio_incore_filop_iodone(struct ioctx *ioctx); static int _sysio_incore_filop_fcntl(struct inode *ino, int cmd, va_list ap); static int _sysio_incore_inop_sync(struct inode *ino); @@ -157,36 +159,35 @@ static int _sysio_incore_inop_statvfs(st struct intnl_statvfs *buf); #endif static void _sysio_incore_inop_gone(struct inode *ino); -static int _sysio_incore_e_isdir(void); -static int _sysio_incore_e_inval(void); -static int _sysio_incore_e_nosys(void); -static void _sysio_incore_illop(void); #define _sysio_incore_dirop_symlink \ - (int (*)(struct pnode *, const char *))_sysio_incore_e_nosys + (int (*)(struct pnode *, const char *))_sysio_do_enosys #define _sysio_incore_dirop_readlink \ - (int (*)(struct pnode *, char *, size_t))_sysio_incore_e_inval + (int (*)(struct pnode *, char *, size_t))_sysio_do_einval #define _sysio_incore_dirop_read \ (int (*)(struct inode *, \ - struct ioctx *))_sysio_incore_e_isdir + struct ioctx *))_sysio_do_eisdir #define _sysio_incore_dirop_write \ (int (*)(struct inode *, \ - struct ioctx *))_sysio_incore_e_isdir + struct ioctx *))_sysio_do_eisdir +#define _sysio_incore_dirop_pos \ + (_SYSIO_OFF_T (*)(struct inode *, \ + _SYSIO_OFF_T))_sysio_do_eisdir #define _sysio_incore_dirop_iodone \ - (int (*)(struct ioctx *))_sysio_incore_illop + (int (*)(struct ioctx *))_sysio_do_illop #define _sysio_incore_dirop_fcntl \ - (int (*)(struct inode *, int, va_list))_sysio_incore_e_isdir + (int (*)(struct inode *, int, va_list))_sysio_do_eisdir #define _sysio_incore_dirop_ioctl \ (int (*)(struct inode *, \ unsigned long int, \ - va_list))_sysio_incore_e_isdir + va_list))_sysio_do_eisdir #define _sysio_incore_inop_mmap \ (void *(*)(struct inode *, \ void *, \ size_t, \ int, \ int, \ - _SYSIO_OFF_T))_sysio_incore_illop + _SYSIO_OFF_T))_sysio_do_illop static struct inode_ops _sysio_incore_dir_ops = { _sysio_incore_dirop_lookup, @@ -204,6 +205,7 @@ static struct inode_ops _sysio_incore_di _sysio_incore_dirop_rename, _sysio_incore_dirop_read, _sysio_incore_dirop_write, + _sysio_incore_dirop_pos, _sysio_incore_dirop_iodone, _sysio_incore_dirop_fcntl, _sysio_incore_inop_sync, @@ -221,28 +223,28 @@ static struct inode_ops _sysio_incore_di (int (*)(struct pnode *, \ struct inode **, \ struct intent *, \ - const char *))_sysio_incore_illop + const char *))_sysio_do_illop #define _sysio_incore_filop_getdirentries \ (ssize_t (*)(struct inode *, \ char *, \ size_t, \ - _SYSIO_OFF_T *))_sysio_incore_illop + _SYSIO_OFF_T *))_sysio_do_illop #define _sysio_incore_filop_mkdir \ - (int (*)(struct pnode *, mode_t))_sysio_incore_illop + (int (*)(struct pnode *, mode_t))_sysio_do_illop #define _sysio_incore_filop_rmdir \ - (int (*)(struct pnode *))_sysio_incore_illop + (int (*)(struct pnode *))_sysio_do_illop #define _sysio_incore_filop_symlink \ - (int (*)(struct pnode *, const char *))_sysio_incore_illop + (int (*)(struct pnode *, const char *))_sysio_do_illop #define _sysio_incore_symlinkop_readlink \ - (int (*)(struct pnode *, char *, size_t))_sysio_incore_illop + (int (*)(struct pnode *, char *, size_t))_sysio_do_illop #define _sysio_incore_filop_link \ - (int (*)(struct pnode *old, struct pnode *new))_sysio_incore_illop + (int (*)(struct pnode *old, struct pnode *new))_sysio_do_illop #define _sysio_incore_filop_unlink \ - (int (*)(struct pnode *pno))_sysio_incore_illop + (int (*)(struct pnode *pno))_sysio_do_illop #define _sysio_incore_filop_rename \ - (int (*)(struct pnode *old, struct pnode *new))_sysio_incore_illop + (int (*)(struct pnode *old, struct pnode *new))_sysio_do_illop #define _sysio_incore_filop_mknod \ - (int (*)(struct pnode *pno, mode_t, dev_t))_sysio_incore_illop + (int (*)(struct pnode *pno, mode_t, dev_t))_sysio_do_illop static struct inode_ops _sysio_incore_file_ops = { _sysio_incore_filop_lookup, @@ -260,6 +262,7 @@ static struct inode_ops _sysio_incore_fi _sysio_incore_filop_rename, _sysio_incore_filop_read, _sysio_incore_filop_write, + _sysio_incore_filop_pos, _sysio_incore_filop_iodone, _sysio_incore_filop_fcntl, _sysio_incore_inop_sync, @@ -289,6 +292,7 @@ static struct inode_ops _sysio_incore_de _sysio_incore_filop_rename, _sysio_nodev_inop_read, _sysio_nodev_inop_write, + _sysio_nodev_inop_pos, _sysio_nodev_inop_iodone, _sysio_incore_filop_fcntl, _sysio_incore_inop_sync, @@ -1559,6 +1563,13 @@ _sysio_incore_filop_write(struct inode * ioctx); } +static _SYSIO_OFF_T +_sysio_incore_filop_pos(struct inode *ino __IS_UNUSED, _SYSIO_OFF_T off) +{ + + return off; +} + static int _sysio_incore_filop_iodone(struct ioctx *iocp __IS_UNUSED) { @@ -1690,34 +1701,3 @@ _sysio_incore_inop_gone(struct inode *in incore_i_destroy(icino); } - -static int -_sysio_incore_e_isdir(void) -{ - - return -EISDIR; -} - -static int -_sysio_incore_e_inval(void) -{ - - return -EINVAL; -} - -static int -_sysio_incore_e_nosys(void) -{ - - return -ENOSYS; -} - -static void -_sysio_incore_illop(void) -{ - - /* - * Uh-oh! Goodbye Bruce. - */ - abort(); -} |
From: Ruth K. <rk...@us...> - 2004-04-27 22:50:57
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28979 Modified Files: Tag: gmdev dev.h inode.h sysio.h Log Message: merge head changes into gmdev branch Index: dev.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/dev.h,v retrieving revision 1.6.2.1 retrieving revision 1.6.2.2 diff -u -w -b -B -p -r1.6.2.1 -r1.6.2.2 --- dev.h 4 Mar 2004 18:08:06 -0000 1.6.2.1 +++ dev.h 27 Apr 2004 22:50:48 -0000 1.6.2.2 @@ -70,84 +70,86 @@ extern const struct inode_ops _sysio_nod (int (*)(struct pnode *, \ struct inode **, \ struct intent *, \ - const char *))_sysio_dev_illop + const char *))_sysio_do_illop #define _sysio_nodev_inop_getattr \ (int (*)(struct pnode *, \ struct inode *, \ - struct intnl_stat *))_sysio_dev_illop + struct intnl_stat *))_sysio_do_ebadf #define _sysio_nodev_inop_setattr \ (int (*)(struct pnode *, \ struct inode *, \ unsigned , \ - struct intnl_stat *))_sysio_dev_illop + struct intnl_stat *))_sysio_do_ebadf #define _sysio_nodev_getdirentries \ (ssize_t (*)(struct inode *, \ char *, \ size_t , \ - _SYSIO_OFF_T *))_sysio_dev_illop + _SYSIO_OFF_T *))_sysio_do_illop #define _sysio_nodev_inop_mkdir \ (int (*)(struct pnode *, \ - mode_t))_sysio_dev_illop + mode_t))_sysio_do_illop #define _sysio_nodev_inop_rmdir \ - (int (*)(struct pnode *))_sysio_dev_illop + (int (*)(struct pnode *))_sysio_do_illop #define _sysio_nodev_inop_symlink \ (int (*)(struct pnode *, \ - const char *))_sysio_dev_illop + const char *))_sysio_do_illop #define _sysio_nodev_inop_readlink \ (int (*)(struct pnode *, \ char *, \ - size_t))_sysio_dev_illop + size_t))_sysio_do_illop #define _sysio_nodev_inop_open \ (int (*)(struct pnode *, \ int, \ - mode_t))_sysio_dev_illop + mode_t))_sysio_do_enoent #define _sysio_nodev_inop_close \ - (int (*)(struct inode *))_sysio_dev_illop + (int (*)(struct inode *))_sysio_do_ebadf #define _sysio_nodev_inop_link \ - (int (*)(struct pnode *, struct pnode *))_sysio_dev_illop + (int (*)(struct pnode *, struct pnode *))_sysio_do_illop #define _sysio_nodev_inop_unlink \ - (int (*)(struct pnode *))_sysio_dev_illop + (int (*)(struct pnode *))_sysio_do_illop #define _sysio_nodev_inop_rename \ - (int (*)(struct pnode *, struct pnode *))_sysio_dev_illop + (int (*)(struct pnode *, struct pnode *))_sysio_do_illop #define _sysio_nodev_inop_read \ (int (*)(struct inode *, \ - struct ioctx *))_sysio_dev_illop + struct ioctx *))_sysio_do_ebadf #define _sysio_nodev_inop_write \ (int (*)(struct inode *, \ - struct ioctx *))_sysio_dev_illop + struct ioctx *))_sysio_do_ebadf +#define _sysio_nodev_inop_pos \ + (_SYSIO_OFF_T (*)(struct inode *, _SYSIO_OFF_T))_sysio_do_ebadf #define _sysio_nodev_inop_iodone \ - (int (*)(struct ioctx *))_sysio_dev_illop + (int (*)(struct ioctx *))_sysio_do_einval #define _sysio_nodev_inop_fcntl \ (int (*)(struct inode *, \ int, \ - va_list))_sysio_dev_illop + va_list))_sysio_do_ebadf #define _sysio_nodev_inop_sync \ - (int (*)(struct inode *))_sysio_dev_illop + (int (*)(struct inode *))_sysio_do_ebadf #define _sysio_nodev_inop_datasync \ - (int (*)(struct inode *))_sysio_dev_illop + (int (*)(struct inode *))_sysio_do_ebadf #define _sysio_nodev_inop_ioctl \ (int (*)(struct inode *, \ unsigned long int, \ - va_list))_sysio_dev_illop + va_list))_sysio_do_ebadf #define _sysio_nodev_inop_mknod \ (int (*)(struct pnode *, \ mode_t, \ - dev_t))_sysio_dev_illop + dev_t))_sysio_do_illop #define _sysio_nodev_inop_mmap \ (void *(*)(struct inode *, \ void *, \ size_t, \ int, \ int, \ - _SYSIO_OFF_T))_sysio_dev_illop + _SYSIO_OFF_T))_sysio_do_illop #ifdef _HAVE_STATVFS #define _sysio_nodev_inop_statvfs \ (int (*)(struct pnode *, \ struct inode *, \ - struct intnl_statvfs *))_sysio_dev_illop + struct intnl_statvfs *))_sysio_do_illop #endif #define _sysio_nodev_inop_gone \ - (void (*)(struct inode *ino))_sysio_dev_noop + (void (*)(struct inode *ino))_sysio_do_noop extern int _sysio_dev_init(void); extern dev_t _sysio_dev_alloc(void); @@ -155,5 +157,3 @@ extern struct inode_ops *_sysio_dev_look extern int _sysio_char_dev_register(int major, const char *name, struct inode_ops *ops); -extern int _sysio_dev_illop(void); -extern void _sysio_dev_noop(void); Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.15.2.1 retrieving revision 1.15.2.2 diff -u -w -b -B -p -r1.15.2.1 -r1.15.2.2 --- inode.h 4 Mar 2004 18:08:06 -0000 1.15.2.1 +++ inode.h 27 Apr 2004 22:50:48 -0000 1.15.2.2 @@ -101,6 +101,7 @@ struct inode_ops { int (*inop_rename)(struct pnode *old, struct pnode *new); int (*inop_read)(struct inode *ino, struct ioctx *ioctx); int (*inop_write)(struct inode *ino, struct ioctx *ioctx); + _SYSIO_OFF_T (*inop_pos)(struct inode *ino, _SYSIO_OFF_T off); int (*inop_iodone)(struct ioctx *iocp); int (*inop_fcntl)(struct inode *ino, int cmd, va_list ap); int (*inop_sync)(struct inode *ino); @@ -459,6 +460,14 @@ extern int _sysio_setattr(struct pnode * struct inode *ino, unsigned mask, struct intnl_stat *stbuf); +extern void _sysio_do_noop(void); +extern void _sysio_do_illop(void); +extern int _sysio_do_ebadf(void); +extern int _sysio_do_einval(void); +extern int _sysio_do_enoent(void); +extern int _sysio_do_espipe(void); +extern int _sysio_do_eisdir(void); +extern int _sysio_do_enosys(void); extern int _sysio_path_walk(struct pnode *parent, struct nameidata *nd); #ifdef AUTOMOUNT_FILE_NAME extern void _sysio_next_component(const char *path, struct qstr *name); Index: sysio.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio.h,v retrieving revision 1.18.2.3 retrieving revision 1.18.2.4 diff -u -w -b -B -p -r1.18.2.3 -r1.18.2.4 |
From: Ruth K. <rk...@us...> - 2004-04-27 22:46:11
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27948 Modified Files: Tag: gmdev chdir.c dev.c getdirentries.c inode.c ioctx.c link.c lseek.c mknod.c rmdir.c rw.c stat.c Log Message: merge head changes into gmdev branch Index: chdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chdir.c,v retrieving revision 1.13.2.1 retrieving revision 1.13.2.2 diff -u -w -b -B -p -r1.13.2.1 -r1.13.2.2 Index: dev.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/dev.c,v retrieving revision 1.6.2.1 retrieving revision 1.6.2.2 diff -u -w -b -B -p -r1.6.2.1 -r1.6.2.2 --- dev.c 4 Mar 2004 18:08:07 -0000 1.6.2.1 +++ dev.c 27 Apr 2004 22:46:01 -0000 1.6.2.2 @@ -68,6 +68,7 @@ const struct inode_ops _sysio_nodev_ops _sysio_nodev_inop_rename, _sysio_nodev_inop_read, _sysio_nodev_inop_write, + _sysio_nodev_inop_pos, _sysio_nodev_inop_iodone, _sysio_nodev_inop_fcntl, _sysio_nodev_inop_sync, @@ -170,17 +171,3 @@ _sysio_dev_lookup(mode_t mode, dev_t dev return &devtbl[major].dev_ops; } - -int -_sysio_dev_illop() -{ - - abort(); -} - -void -_sysio_dev_noop() -{ - - return; -} Index: getdirentries.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/getdirentries.c,v retrieving revision 1.8.2.3 retrieving revision 1.8.2.4 diff -u -w -b -B -p -r1.8.2.3 -r1.8.2.4 --- getdirentries.c 19 Apr 2004 18:24:14 -0000 1.8.2.3 +++ getdirentries.c 27 Apr 2004 22:46:01 -0000 1.8.2.4 @@ -143,7 +143,7 @@ sysio_sym_strong_alias(_getdirentries64, #ifndef BSD ssize_t -getdirentries(int fd, +SYSIO_INTERFACE_NAME(getdirentries)(int fd, char *buf, size_t nbytes, off_t * __restrict basep) Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.14.2.2 retrieving revision 1.14.2.3 diff -u -w -b -B -p -r1.14.2.2 -r1.14.2.3 --- inode.c 19 Apr 2004 16:15:50 -0000 1.14.2.2 +++ inode.c 27 Apr 2004 22:46:01 -0000 1.14.2.3 @@ -252,6 +252,7 @@ _sysio_i_new(struct filesys *fs, operations.inop_close = o->inop_close; operations.inop_read = o->inop_read; operations.inop_write = o->inop_write; + operations.inop_pos = o->inop_pos; operations.inop_iodone = o->inop_iodone; operations.inop_datasync = o->inop_datasync; operations.inop_ioctl = o->inop_ioctl; Index: ioctx.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctx.c,v retrieving revision 1.11.2.1 retrieving revision 1.11.2.2 diff -u -w -b -B -p -r1.11.2.1 -r1.11.2.2 --- ioctx.c 19 Apr 2004 16:15:50 -0000 1.11.2.1 +++ ioctx.c 27 Apr 2004 22:46:01 -0000 1.11.2.2 @@ -495,6 +495,7 @@ _sysio_enumerate_iovec(const struct iove return acc; return cc; } + off += cc; limit -= cc; remain = iov->iov_len - cc; cc += acc; Index: link.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/link.c,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -u -w -b -B -p -r1.4.2.1 -r1.4.2.2 --- link.c 19 Apr 2004 16:15:50 -0000 1.4.2.1 +++ link.c 27 Apr 2004 22:46:01 -0000 1.4.2.2 @@ -98,11 +98,12 @@ error2: P_RELE(new); error1: P_RELE(old); +out: if (err) { errno = -err; err = -1; } -out: + SYSIO_INTERFACE_RETURN(err, err); } Index: lseek.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/lseek.c,v retrieving revision 1.13.2.2 retrieving revision 1.13.2.3 diff -u -w -b -B -p -r1.13.2.2 -r1.13.2.3 --- lseek.c 20 Apr 2004 16:54:38 -0000 1.13.2.2 +++ lseek.c 27 Apr 2004 22:46:01 -0000 1.13.2.3 @@ -105,6 +105,10 @@ _sysio_lseek(int fd, _SYSIO_OFF_T offset if (pos >= _SYSIO_OFF_T_MAX) SYSIO_INTERFACE_RETURN(-EOVERFLOW, -EOVERFLOW); #endif + pos = (fil->f_ino->i_ops.inop_pos)(fil->f_ino, pos); + if (pos < 0) + SYSIO_INTERFACE_RETURN(pos, pos); + fil->f_pos = pos; SYSIO_INTERFACE_RETURN(pos, 0); } Index: mknod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mknod.c,v retrieving revision 1.7.2.1 retrieving revision 1.7.2.2 diff -u -w -b -B -p -r1.7.2.1 -r1.7.2.2 --- mknod.c 19 Apr 2004 16:15:50 -0000 1.7.2.1 +++ mknod.c 27 Apr 2004 22:46:01 -0000 1.7.2.2 @@ -86,7 +86,7 @@ PREPEND(__,SYSIO_INTERFACE_NAME(xmknod)) /* * Support only character-special and fifos right now. */ - if (!(S_ISDIR(mode) || S_ISFIFO(mode))) { + if (!(S_ISCHR(mode) || S_ISFIFO(mode))) { err = -EINVAL; goto out; } Index: rmdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rmdir.c,v retrieving revision 1.8.2.1 retrieving revision 1.8.2.2 diff -u -w -b -B -p -r1.8.2.1 -r1.8.2.2 --- rmdir.c 19 Apr 2004 16:15:50 -0000 1.8.2.1 +++ rmdir.c 27 Apr 2004 22:46:01 -0000 1.8.2.2 @@ -71,6 +71,10 @@ rmdir(const char *path) err = -EROFS; goto error; } + if (pno->p_ref > 1) { + err = -EBUSY; + goto error; + } err = pno->p_base->pb_ino->i_ops.inop_rmdir(pno); if (err) goto error; Index: rw.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rw.c,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -u -w -b -B -p -r1.3.2.1 -r1.3.2.2 --- rw.c 19 Apr 2004 16:15:50 -0000 1.3.2.1 +++ rw.c 27 Apr 2004 22:46:01 -0000 1.3.2.2 @@ -696,7 +696,7 @@ SYSIO_INTERFACE_NAME(pread)(int fd, void } #if __GLIBC__ -#undef _pread +#undef __pread sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(pread), __pread) #undef __libc_pread sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(pread), __libc_pread) Index: stat.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/stat.c,v retrieving revision 1.9.2.2 retrieving revision 1.9.2.3 diff -u -w -b -B -p -r1.9.2.2 -r1.9.2.3 |