libsysio-commit Mailing List for libsysio (Page 33)
Brought to you by:
lward
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
(25) |
May
(28) |
Jun
(25) |
Jul
(30) |
Aug
(60) |
Sep
(52) |
Oct
(100) |
Nov
(15) |
Dec
(34) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(89) |
Feb
(48) |
Mar
(22) |
Apr
(59) |
May
(16) |
Jun
(15) |
Jul
(50) |
Aug
(26) |
Sep
(40) |
Oct
(27) |
Nov
(12) |
Dec
|
| 2005 |
Jan
(24) |
Feb
(11) |
Mar
|
Apr
|
May
(3) |
Jun
(6) |
Jul
|
Aug
(14) |
Sep
(21) |
Oct
(10) |
Nov
|
Dec
|
| 2006 |
Jan
(8) |
Feb
(5) |
Mar
(2) |
Apr
(6) |
May
(11) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(3) |
| 2007 |
Jan
(3) |
Feb
(5) |
Mar
(20) |
Apr
(41) |
May
(21) |
Jun
(3) |
Jul
(5) |
Aug
(12) |
Sep
(21) |
Oct
(5) |
Nov
(16) |
Dec
|
| 2008 |
Jan
|
Feb
(2) |
Mar
(4) |
Apr
(23) |
May
|
Jun
(22) |
Jul
(13) |
Aug
|
Sep
|
Oct
(9) |
Nov
(3) |
Dec
(13) |
| 2009 |
Jan
(14) |
Feb
(10) |
Mar
(2) |
Apr
(11) |
May
(7) |
Jun
(1) |
Jul
(1) |
Aug
(36) |
Sep
(12) |
Oct
|
Nov
|
Dec
(10) |
| 2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
|
From: Lee W. <lw...@us...> - 2004-01-28 13:18:09
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15431/include Modified Files: Tag: namespace_assembly sysio.h Log Message: Bring in changes from the HEAD. Index: sysio.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio.h,v retrieving revision 1.14 retrieving revision 1.14.2.1 diff -u -w -b -B -p -r1.14 -r1.14.2.1 --- sysio.h 29 Oct 2003 00:25:53 -0000 1.14 +++ sysio.h 28 Jan 2004 13:16:56 -0000 1.14.2.1 @@ -258,3 +258,42 @@ extern int mount(const char *source, con unsigned long mountflags, const void *data); extern int umount(const char *target); + +/* for debugging */ +#if 1 +#define ASSERT(cond) \ + if (!(cond)) { \ + printf("ASSERTION(" #cond ") failed: " __FILE__ ":" \ + __FUNCTION__ ":%d\n", __LINE__); \ + abort(); \ + } + +#define ERROR(fmt, a...) \ + do { \ + printf("ERROR(" __FILE__ ":%d):" fmt, __LINE__, ##a); \ + while(0) + +#else +#define ERROR(fmt) do{}while(0) +#define ASSERT do{}while(0) +#endif + +/* syscall enter/leave hook functions */ +#if 1 +#define SYSIO_ENTER +#define SYSIO_LEAVE + +#else +extern void _sysio_sysenter(); +extern void _sysio_sysleave(); + +#define SYSIO_ENTER \ + do { \ + _sysio_sysenter(); \ + } while(0) + +#define SYSIO_LEAVE \ + do { \ + _sysio_sysleave(); \ + } while(0) +#endif |
|
From: Lee W. <lw...@us...> - 2004-01-28 13:18:09
|
Update of /cvsroot/libsysio/libsysio/drivers/yod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15431/drivers/yod Modified Files: Tag: namespace_assembly fs_yod.c Log Message: Bring in changes from the HEAD. Index: fs_yod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/yod/fs_yod.c,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -u -w -b -B -p -r1.8 -r1.8.2.1 --- fs_yod.c 12 Nov 2003 21:51:40 -0000 1.8 +++ fs_yod.c 28 Jan 2004 13:16:56 -0000 1.8.2.1 @@ -808,7 +808,7 @@ yod_inop_symlink(struct pnode *pno, cons if (!path) return -ENOMEM; - err = symlink_yod(path, data); + err = symlink_yod(data, path); free(path); return err; } @@ -987,7 +987,11 @@ doio(ssize_t (*f)(int, const struct iove assert(nino->ni_fd >= 0); - if (ioctx->ioctx_iovlen && (int )ioctx->ioctx_iovlen < 0) + if ((ioctx->ioctx_iovlen && (int )ioctx->ioctx_iovlen < 0) || + !(S_ISREG(ino->i_mode) || + S_ISCHR(ino->i_mode) || + S_ISSOCK(ino->i_mode) || + S_ISFIFO(ino->i_mode))) return -EINVAL; /* @@ -1002,30 +1006,29 @@ doio(ssize_t (*f)(int, const struct iove * Avoid the reposition call if we're already at the right place. * Allows us to access pipes and fifos. */ - result = nino->ni_fpos; - if (ioctx->ioctx_offset != nino->ni_fpos && - !(S_ISCHR(ino->i_mode) || - S_ISSOCK(ino->i_mode) || - S_ISFIFO(ino->i_mode)) && - (result = lseek_yod(nino->ni_fd, + result = ioctx->ioctx_offset; + if (ioctx->ioctx_offset != nino->ni_fpos) { + result = lseek_yod(nino->ni_fd, ioctx->ioctx_offset, - SEEK_SET) == -1)) { + SEEK_SET); + if (result == -1) { ioctx->ioctx_cc = -1; ioctx->ioctx_errno = errno; - } else { + goto out; + } + nino->ni_fpos = result; + } /* * Call the appropriate (read/write) IO function to * transfer the data now. */ - nino->ni_fpos = result; ioctx->ioctx_cc = (*f)(nino->ni_fd, ioctx->ioctx_iovec, ioctx->ioctx_iovlen); if (ioctx->ioctx_cc < 0) ioctx->ioctx_errno = errno; if (ioctx->ioctx_cc > 0) nino->ni_fpos += ioctx->ioctx_cc; - } - +out: ioctx->ioctx_done = 1; return 0; } |
|
From: Lee W. <lw...@us...> - 2004-01-28 13:18:08
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15431/drivers/native Modified Files: Tag: namespace_assembly fs_native.c Log Message: Bring in changes from the HEAD. Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.25 retrieving revision 1.25.2.1 diff -u -w -b -B -p -r1.25 -r1.25.2.1 --- fs_native.c 22 Oct 2003 15:57:23 -0000 1.25 +++ fs_native.c 28 Jan 2004 13:16:56 -0000 1.25.2.1 @@ -76,7 +76,6 @@ #ifdef REDSTORM #include <sys/uio.h> -#include <catamount/syscall.h> /* ! in sys include? */ #endif #ifdef REDSTORM @@ -137,11 +136,6 @@ do { (dest)->st_gen = (src)->st_gen; \ } while (0); -/* SYS_lseek has a different interface on alpha - */ -#define CALL_LSEEK(fd, off, rc, wh) \ - (rc = syscall(SYS_lseek, fd, off, wh)) - #else #define __native_stat intnl_stat @@ -1342,15 +1336,33 @@ native_inop_iodone(struct ioctx *ioctxp } static int -native_inop_fcntl(struct inode *ino __IS_UNUSED, - int cmd __IS_UNUSED, - va_list ap __IS_UNUSED) +native_inop_fcntl(struct inode *ino, + int cmd, + va_list ap) { + struct native_inode *nino = I2NI(ino); + long arg; - /* - * I'm lazy. Maybe implemented later. - */ - errno = ENOTTY; + if (nino->ni_fd < 0) + abort(); + + switch (cmd) { + case F_GETFD: + case F_GETFL: + case F_GETOWN: + return syscall(SYS_fcntl, nino->ni_fd, cmd); + case F_DUPFD: + case F_SETFD: + case F_SETFL: + case F_GETLK: + case F_SETLK: + case F_SETLKW: + case F_SETOWN: + arg = va_arg(ap, long); + return syscall(SYS_fcntl, nino->ni_fd, cmd, arg); + default: + abort(); + } return -1; } |
|
From: Lee W. <lw...@us...> - 2004-01-28 13:18:08
|
Update of /cvsroot/libsysio/libsysio/drivers/sockets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15431/drivers/sockets Added Files: Tag: namespace_assembly module.mk sockets.c Log Message: Bring in changes from the HEAD. --- NEW FILE --- SOCKETS_SRCS = drivers/sockets/sockets.c SOCKETS_EXTRA = drivers/sockets/module.mk --- NEW FILE --- /* * This Cplant(TM) source code is the property of Sandia National * Laboratories. * * This Cplant(TM) source code is copyrighted by Sandia National * Laboratories. * * The redistribution of this Cplant(TM) source code is subject to the * terms of the GNU Lesser General Public License * (see cit/LGPL or http://www.gnu.org/licenses/lgpl.html) * * Cplant(TM) Copyright 1998-2003 Sandia Corporation. * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive * license for use of this work by or on behalf of the US Government. * Export of this program may require a license from the United States * Government. */ /* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Questions or comments about this library should be sent to: * * Lee Ward * Sandia National Laboratories, New Mexico * P.O. Box 5800 * Albuquerque, NM 87185-1110 * * le...@sa... */ #ifdef __linux__ #define _BSD_SOURCE #endif #include <stdio.h> /* for NULL */ #include <stdlib.h> #ifdef __linux__ #include <string.h> #endif #include <unistd.h> #include <errno.h> #include <assert.h> #include <syscall.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/fcntl.h> #include <sys/queue.h> #include <sys/syscall.h> #include <sys/socket.h> #include <linux/net.h> #include "sysio.h" #include "fs.h" #include "inode.h" #include "file.h" #include "dev.h" /* _sysio_nodev_ops */ /* * Sockets interface driver */ /* * Sockets file identifiers format. */ struct sockets_ino_identifier { ino_t inum; /* i-number */ }; /* * Driver-private i-node information we keep about in-use sockets. */ struct socket_info { struct sockets_ino_identifier ski_ident; /* unique identifier */ struct file_identifier ski_fileid; /* ditto */ int ski_fd; /* host fildes */ }; static int sockets_inop_close(struct inode *ino); static int sockets_inop_ipreadv(struct inode *ino, struct ioctx *ioctx); static int sockets_inop_ipwritev(struct inode *ino, struct ioctx *ioctxp); static int sockets_inop_iodone(struct ioctx *ioctx); static int sockets_inop_sync(struct inode *ino); static int sockets_inop_datasync(struct inode *ino); static int sockets_inop_fcntl(struct inode *ino, int cmd, va_list ap); static int sockets_inop_ioctl(struct inode *ino, unsigned long int request, va_list ap); static void sockets_inop_gone(struct inode *ino); static void sockets_illop(void); /* * Given i-node, return driver private part. */ #define I2SKI(ino) ((struct socket_info *)((ino)->i_private)) struct filesys_ops sockets_filesys_ops = { (void (*)(struct filesys *))sockets_illop }; static struct filesys *sockets_fs; static struct inode_ops sockets_i_ops; /* * Initialize this driver. */ int _sysio_sockets_init() { sockets_i_ops = _sysio_nodev_ops; sockets_i_ops.inop_close = sockets_inop_close; sockets_i_ops.inop_ipreadv = sockets_inop_ipreadv; sockets_i_ops.inop_ipwritev = sockets_inop_ipwritev; sockets_i_ops.inop_iodone = sockets_inop_iodone; sockets_i_ops.inop_fcntl = sockets_inop_fcntl; sockets_i_ops.inop_sync = sockets_inop_sync; sockets_i_ops.inop_datasync = sockets_inop_datasync; sockets_i_ops.inop_ioctl = sockets_inop_ioctl; sockets_i_ops.inop_gone = sockets_inop_gone; sockets_fs = _sysio_fs_new(&sockets_filesys_ops, 0, NULL); if (!sockets_fs) return -ENOMEM; return 0; } static int sockets_inop_close(struct inode *ino) { struct socket_info *ski = I2SKI(ino); int err; if (ski->ski_fd < 0) return -EBADF; err = syscall(SYS_close, ski->ski_fd); if (err) return -errno; ski->ski_fd = -1; return 0; } /* * A helper function performing the real IO operation work. * * We don't really have async IO. We'll just perform the function * now. */ static int doio(ssize_t (*f)(int, const struct iovec *, int), struct inode *ino, struct ioctx *ioctx) { struct socket_info *ski = I2SKI(ino); assert(ski->ski_fd >= 0); if (ioctx->ioctx_iovlen && (int) ioctx->ioctx_iovlen < 0) return -EINVAL; /* * Call the appropriate (read/write) IO function to * transfer the data now. */ ioctx->ioctx_cc = (*f)(ski->ski_fd, ioctx->ioctx_iovec, ioctx->ioctx_iovlen); if (ioctx->ioctx_cc < 0) ioctx->ioctx_errno = errno; ioctx->ioctx_done = 1; return 0; } /* * Helper function passed to doio(), above, to accomplish a real readv. */ static ssize_t _readv(int fd, const struct iovec *vector, int count) { return syscall(SYS_readv, fd, vector, count); } static int sockets_inop_ipreadv(struct inode *ino, struct ioctx *ioctx) { return doio(_readv, ino, ioctx); } /* * Helper function passed to doio(), above, to accomplish a real writev. */ static ssize_t _writev(int fd, const struct iovec *vector, int count) { return syscall(SYS_writev, fd, vector, count); } static int sockets_inop_ipwritev(struct inode *ino, struct ioctx *ioctx) { return doio(_writev, ino, ioctx); } static int sockets_inop_iodone(struct ioctx *ioctxp __IS_UNUSED) { /* * It's always done in this driver. It completed when posted. */ return 1; } static int sockets_inop_fcntl(struct inode *ino __IS_UNUSED, int cmd __IS_UNUSED, va_list ap __IS_UNUSED) { long arg; assert(I2SKI(ino)->ski_fd >= 0); switch (cmd) { case F_GETFD: case F_GETFL: case F_GETOWN: return syscall(SYS_fcntl, I2SKI(ino)->ski_fd, cmd); case F_DUPFD: case F_SETFD: case F_SETFL: case F_GETLK: case F_SETLK: case F_SETLKW: case F_SETOWN: arg = va_arg(ap, long); return syscall(SYS_fcntl, I2SKI(ino)->ski_fd, cmd, arg); default: printf("uncatched cmd %d\n", cmd); abort(); } return -1; } static int sockets_inop_sync(struct inode *ino) { assert(I2SKI(ino)->ski_fd >= 0); return syscall(SYS_fsync, I2SKI(ino)->ski_fd); } static int sockets_inop_datasync(struct inode *ino) { assert(I2SKI(ino)->ski_fd >= 0); return syscall(SYS_fdatasync, I2SKI(ino)->ski_fd); } static int sockets_inop_ioctl(struct inode *ino __IS_UNUSED, unsigned long int request __IS_UNUSED, va_list ap __IS_UNUSED) { /* * I'm lazy. Maybe implemented later. */ return -ENOTTY; } static void sockets_inop_gone(struct inode *ino) { (void )sockets_inop_close(ino); free(ino->i_private); } static void sockets_illop(void) { abort(); } static struct inode * _sysio_sockets_inew() { static ino_t inum = 1; struct socket_info *ski; struct inode *ino; ski = malloc(sizeof(struct socket_info)); if (!ski) return NULL; ski->ski_ident.inum = inum++; ski->ski_fileid.fid_data = &ski->ski_ident; ski->ski_fileid.fid_len = sizeof(ski->ski_ident); ski->ski_fd = -1; ino = _sysio_i_new(sockets_fs, &ski->ski_fileid, 0, 0, 0, &sockets_i_ops, ski); if (!ino) free(ski); return ino; } int socket(int domain, int type, int protocol) { int err; struct inode *ino; struct socket_info *ski; struct file *fil; err = 0; fil = NULL; ino = _sysio_sockets_inew(); if (!ino) { err = -ENOMEM; goto error; } ski = I2SKI(ino); #ifndef SYS_socketcall ski->ski_fd = syscall(SYS_socket, domain, type, protocol); #else { unsigned long avec[3] = {domain, type, protocol}; ski->ski_fd = syscall(SYS_socketcall, SYS_SOCKET, avec); } #endif if (ski->ski_fd < 0) { err = -errno; goto error; } fil = _sysio_fnew(ino, O_RDWR); if (!fil) { err = -ENOMEM; goto error; } err = _sysio_fd_set(fil, ski->ski_fd); if (err < 0) goto error; return err; error: if (fil) F_RELE(fil); if (ino) I_RELE(ino); errno = -err; return -1; } int accept(int s, struct sockaddr *addr, socklen_t *addrlen) { int err; struct inode *ino; struct socket_info *ski; struct file *ofil, *nfil; err = 0; nfil = NULL; ino = NULL; ofil = _sysio_fd_find(s); if (!ofil) { err = -EBADF; goto error; } ino = _sysio_sockets_inew(); if (!ino) { err = -ENOMEM; goto error; } nfil = _sysio_fnew(ino, O_RDWR); if (!nfil) { err = -ENOMEM; goto error; } ski = I2SKI(ino); #ifndef SYS_socketcall ski->ski_fd = syscall(SYS_accept, I2SKI(ofil->f_ino)->ski_fd, addr, addrlen); #else { unsigned long avec[3] = { (unsigned long) I2SKI(ofil->f_ino)->ski_fd, (unsigned long) addr, (unsigned long) addrlen}; ski->ski_fd = syscall(SYS_socketcall, SYS_ACCEPT, avec); } #endif if (ski->ski_fd < 0) { err = -errno; goto error; } err = _sysio_fd_set(nfil, ski->ski_fd); if (err < 0) goto error; return err; error: if (nfil) F_RELE(nfil); if (ino) I_RELE(ino); errno = -err; return -1; } #if 0 int bind(int sockfd, const struct sockaddr *my_addr, socklen_t addrlen) { int err; struct file *fil; unsigned long avec[3]; err = 0; fil = _sysio_fd_find(sockfd); if (!fil) { err = -EBADF; goto out; } avec[0] = I2SKI(fil->f_ino)->ski_fd; avec[1] = (unsigned long )my_addr; avec[2] = addrlen; #ifndef SYS_socketcall if (syscall(SYS_bind, I2SKI(fil->f_ino)->ski_fd, my_addr, addrlen)) { #else if (syscall(SYS_socketcall, SYS_BIND, avec) != 0) { #endif err = -errno; goto out; } return 0; out: errno = -err; return -1; } int listen(int s, int backlog) { int err; struct file *fil; unsigned long avec[2]; err = 0; fil = _sysio_fd_find(s); if (!fil) { err = -EBADF; goto out; } avec[0] = I2SKI(fil->f_ino)->ski_fd; avec[1] = backlog; #ifndef SYS_socketcall if (syscall(SYS_listen, I2SKI(fil->f_ino)->ski_fd, backlog) != 0) { #else if (syscall(SYS_socketcall, SYS_LISTEN, avec) != 0) { #endif err = -errno; goto out; } return 0; out: errno = -err; return -1; } int connect(int sockfd, const struct sockaddr *serv_addr, socklen_t addrlen) { int err; struct file *fil; unsigned long avec[3]; err = 0; fil = _sysio_fd_find(sockfd); if (!fil) { err = -EBADF; goto out; } avec[0] = I2SKI(fil->f_ino)->ski_fd; avec[1] = (unsigned long )serv_addr; avec[2] = addrlen; #ifndef SYS_socketcall if (syscall(SYS_connect, I2SKI(fil->f_ino)->ski_fd, serv_addr, addrlen) != 0) { #else if (syscall(SYS_socketcall, SYS_CONNECT, avec) != 0) { #endif err = -errno; goto out; } return 0; out: errno = -err; return -1; } #endif |
|
From: Lee W. <lw...@us...> - 2004-01-28 13:18:08
|
Update of /cvsroot/libsysio/libsysio/drivers/incore In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15431/drivers/incore Modified Files: Tag: namespace_assembly fs_incore.c Log Message: Bring in changes from the HEAD. Index: fs_incore.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/incore/fs_incore.c,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -u -w -b -B -p -r1.11 -r1.11.2.1 --- fs_incore.c 17 Oct 2003 21:30:29 -0000 1.11 +++ fs_incore.c 28 Jan 2004 13:16:56 -0000 1.11.2.1 @@ -1312,7 +1312,7 @@ incore_create(struct pnode *pno, struct incore_directory_insert(I2IC(dino), &pno->p_base->pb_name, st->st_ino, - INCORE_D_TYPEOF(S_IFREG)); + INCORE_D_TYPEOF(icino->ici_st.st_mode)); if (err) { I_RELE(ino); _sysio_i_gone(ino); @@ -1625,6 +1625,8 @@ _sysio_incore_dirop_mknod(struct pnode * m = mode & S_IFMT; if (S_ISCHR(m)) m &= ~S_IFCHR; + else if (S_ISFIFO(m)) + m &= ~S_IFIFO; else if (S_ISBLK(m)) m &= ~S_IFCHR; else |
|
From: Lee W. <lw...@us...> - 2004-01-28 13:18:08
|
Update of /cvsroot/libsysio/libsysio In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15431 Modified Files: Tag: namespace_assembly Makefile.am Rules.make configure.in Log Message: Bring in changes from the HEAD. Index: Makefile.am =================================================================== RCS file: /cvsroot/libsysio/libsysio/Makefile.am,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -u -w -b -B -p -r1.9 -r1.9.2.1 --- Makefile.am 16 Dec 2003 15:43:14 -0000 1.9 +++ Makefile.am 28 Jan 2004 13:16:55 -0000 1.9.2.1 @@ -13,17 +13,61 @@ include $(top_srcdir)/dev/stdfd/module.m include $(top_srcdir)/drivers/incore/module.mk include $(top_srcdir)/drivers/native/module.mk include $(top_srcdir)/drivers/yod/module.mk +include $(top_srcdir)/drivers/sockets/module.mk lib_LIBRARIES = ${LIBBUILD_DIR}/libsysio.a -__LIBBUILD_DIR__libsysio_a_SOURCES = $(SRCDIR_SRCS) $(STDFD_SRCS) \ - $(INCORE_SRCS) $(NATIVE_SRCS) $(YOD_SRCS) +if WITH_STDFD_DEV +OPTIONAL_STDFD_SRCS = $(STDFD_SRCS) +else +OPTIONAL_STDFD_SRCS = +endif + +if WITH_INCORE_DRIVER +OPTIONAL_INCORE_SRCS = $(INCORE_SRCS) +else +OPTIONAL_INCORE_SRCS = +endif + +if WITH_NATIVE_DRIVER +OPTIONAL_NATIVE_SRCS = $(NATIVE_SRCS) +else +OPTIONAL_NATIVE_SRCS = +endif + +if WITH_SOCKETS_DRIVER +OPTIONAL_SOCKETS_SRCS = $(SOCKETS_SRCS) +else +OPTIONAL_SOCKETS_SRCS = +endif + +if WITH_CPLANT_YOD +OPTIONAL_YOD_SRCS = $(YOD_SRCS) +else +OPTIONAL_YOD_SRCS = +endif + +__LIBBUILD_DIR__libsysio_a_SOURCES = \ + $(SRCDIR_SRCS) \ + $(OPTIONAL_STDFD_SRCS) \ + $(OPTIONAL_INCORE_SRCS) \ + $(OPTIONAL_SOCKETS_SRCS) \ + $(OPTIONAL_NATIVE_SRCS) \ + $(OPTIONAL_YOD_SRCS) + +# +# Cygwin related? Configure seems to do this for us when appropriate. Why +# was this here? +# +# Commented out by Lee; Wed Jan 21 08:21:33 EST 2004 +# +#__LIBBUILD_DIR__libsysio_a_CFLAGS = -fPIC include $(top_srcdir)/Rules.make EXTRA_DIST = Rules.make $(TESTS_EXTRA) $(SRCDIR_EXTRA) \ $(INCLUDE_EXTRA) $(STDFD_EXTRA) $(INCORE_EXTRA) \ - $(NATIVE_EXTRA) $(YOD_EXTRA) + $(SOCKETS_EXTRA) $(NATIVE_EXTRA) $(YOD_EXTRA) AM_CPPFLAGS += ${YOD_DRIVER_FLAGS} Index: Rules.make =================================================================== RCS file: /cvsroot/libsysio/libsysio/Rules.make,v retrieving revision 1.4 retrieving revision 1.4.12.1 diff -u -w -b -B -p -r1.4 -r1.4.12.1 --- Rules.make 24 Mar 2003 22:06:38 -0000 1.4 +++ Rules.make 28 Jan 2004 13:16:55 -0000 1.4.12.1 @@ -5,6 +5,14 @@ else STFD_DEV_CPPFLAGS = endif +if WITH_SOCKETS_DRIVER +SOCKETS_CPPFLAGS=-DWITH_SOCKETS=1 +else +SOCKETS_CPPFLAGS= +endif + DEV_CPPFLAGS = $(STDFD_DEV_CPPFLAGS) -AM_CPPFLAGS = $(AUTOMOUNT) $(DEV_CPPFLAGS) -I$(top_srcdir)/include +AM_CPPFLAGS = \ + $(AUTOMOUNT) $(DEV_CPPFLAGS) $(SOCKETS_CPPFLAGS) \ + -I$(top_srcdir)/include Index: configure.in =================================================================== RCS file: /cvsroot/libsysio/libsysio/configure.in,v retrieving revision 1.12 retrieving revision 1.12.2.1 diff -u -w -b -B -p -r1.12 -r1.12.2.1 --- configure.in 16 Dec 2003 15:43:14 -0000 1.12 +++ configure.in 28 Jan 2004 13:16:55 -0000 1.12.2.1 @@ -32,7 +32,7 @@ AC_ARG_WITH(lib-dir, esac;], [ LIBBUILD_DIR=`pwd`/lib; test -d ${LIBBUILD_DIR} || mkdir ${LIBBUILD_DIR} || have_lib_dir=no;]) -if test x${have_lib_dir} == xyes; then +if test x${have_lib_dir} = xyes; then echo "Using sysio library directory ${LIBBUILD_DIR}" else AC_MSG_ERROR(Need writeable path to sysio library directory ${LIBBUILD_DIR}) @@ -122,6 +122,17 @@ AC_ARG_WITH(cplant_tests, [with_cplant_tests=no]) AM_CONDITIONAL(WITH_CPLANT_TESTS, test x$with_cplant_tests != xno) +AC_ARG_WITH(sockets, + AC_HELP_STRING([--with-sockets], + [build sockets interface driver (EXPERIMENTAL)]), + [ case "${withval}" in + yes) ;; + no) ;; + *) AC_MSG_ERROR(bad value ${withval} for --with-sockets) ;; + esac], + [with_sockets=no]) +AM_CONDITIONAL(WITH_SOCKETS_DRIVER, test x$with_sockets = xyes) + # We keep the original values in `$config_*' and never modify them, so we # can write them unchanged into config.make. Everything else uses # $machine, $vendor, and $os, and changes them whenever convenient. @@ -224,7 +235,7 @@ fi # Check for fdatasync syscall # AC_MSG_CHECKING(for fdatasync system call) -if test x$alpha_linux_env == xyes; then +if test x$alpha_linux_env = xyes; then _syscallnum=SYS_osf_fdatasync else _syscallnum=SYS_fdatasync |
|
From: Lee W. <lw...@us...> - 2004-01-28 04:50:43
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11915/src Modified Files: Tag: strided-io rw.c Log Message: Need proper aliases for REDSTORM due to rewrite and integration of {read,write}.c Much more lenient than before. No BSD support any longer and we always want the GLIBC symbols, REDSTORM or no. Index: rw.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/Attic/rw.c,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -w -b -B -p -r1.1.2.4 -r1.1.2.5 --- rw.c 27 Jan 2004 22:05:23 -0000 1.1.2.4 +++ rw.c 28 Jan 2004 04:49:35 -0000 1.1.2.5 @@ -310,9 +310,11 @@ readv(int fd, const struct iovec *iov, i return _sysio_ioctx_wait(ioctx); } -#if defined(BSD) || defined(REDSTORM) -#undef _readv -sysio_sym_weak_alias(readv, _readv) +#if defined(__GLIBC__) +#undef __readv +sysio_sym_weak_alias(readv, __readv) +#undef __libc_readv +sysio_sym_weak_alias(readv, __libc_readv) #endif static void @@ -411,11 +413,8 @@ read(int fd, void *buf, size_t count) #ifdef __GLIBC__ #undef __read sysio_sym_weak_alias(read, __read) -#endif - -#if defined(BSD) || defined(REDSTORM) -#undef _read -sysio_sym_weak_alias(read, _read) +#undef __libc_read +sysio_sym_weak_alias(read, __libc_read) #endif /* @@ -648,6 +647,12 @@ _pread(int fd, void *buf, size_t count, #if _LARGEFILE64_SOURCE #undef pread64 sysio_sym_weak_alias(_pread, pread64) +#if __GLIBC__ +#undef __pread64 +sysio_sym_weak_alias(_pread, __pread64) +#undef __libc_pread64 +sysio_sym_weak_alias(_pread, __libc_pread64) +#endif #endif ssize_t @@ -657,6 +662,13 @@ pread(int fd, void *buf, size_t count, o return _pread(fd, buf, count, offset); } +#if __GLIBC__ +#undef _pread +sysio_sym_weak_alias(pread, __pread) +#undef __libc_pread +sysio_sym_weak_alias(pread, __libc_pread) +#endif + static ioid_t _ireadx(int fd, const struct iovec *iov, size_t iov_count, @@ -749,7 +761,6 @@ ireadx(int fd, sysio_sym_weak_alias(_ireadx, ireadx) #endif -#undef readx ssize_t readx(int fd, const struct iovec *iov, size_t iov_count, @@ -860,9 +871,11 @@ writev(int fd, const struct iovec *iov, return _sysio_ioctx_wait(ioctx); } -#if defined(BSD) || defined(REDSTORM) -#undef _writev -sysio_sym_weak_alias(writev, _writev) +#ifdef __GLIBC__ +#undef __writev +sysio_sym_weak_alias(writev, __writev) +#undef __libc_writev +sysio_sym_weak_alias(writev, __libc_writev) #endif ioid_t @@ -953,11 +966,8 @@ write(int fd, const void *buf, size_t co #ifdef __GLIBC__ #undef __write sysio_sym_weak_alias(write, __write) -#endif - -#if defined(BSD) || defined(REDSTORM) -#undef _write -sysio_sym_weak_alias(write, _write) +#undef __libc_write +sysio_sym_weak_alias(write, __libc_write) #endif static ioid_t @@ -1152,6 +1162,12 @@ _pwrite(int fd, const void *buf, size_t #if _LARGEFILE64_SOURCE #undef pwrite64 sysio_sym_weak_alias(_pwrite, pwrite64) +#ifdef __GLIBC +#undef __pwrite64 +sysio_sym_weak_alias(_pwrite, __pwrite64) +#undef __libc_pwrite64 +sysio_sym_weak_alias(_pwrite, __libc_pwrite64) +#endif #endif ssize_t @@ -1161,6 +1177,11 @@ pwrite(int fd, const void *buf, size_t c return _pwrite(fd, buf, count, offset); } +#ifdef __GLIBC +#undef __libc_pwrite +sysio_sym_weak_alias(pwrite, __libc_pwrite) +#endif + static ioid_t _iwritex(int fd, const struct iovec *iov, size_t iov_count, |
|
From: Lee W. <lw...@us...> - 2004-01-28 01:04:07
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22917/src Modified Files: Tag: strided-io namei.c Log Message: Fixed two issues; 1) When following a symlink target that ends with a directory with the VTX mode bit set but no .mount or a failed automount the caller would redundantly try the automount again. 2) The reference to the pnode for a non-existent (negative) .mount entry or a failed mount with one that exists was not being dropped. This would leave the path node alias stuck in the system. Index: namei.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/namei.c,v retrieving revision 1.8.6.1 retrieving revision 1.8.6.2 diff -u -w -b -B -p -r1.8.6.1 -r1.8.6.2 --- namei.c 26 Jan 2004 16:27:48 -0000 1.8.6.1 +++ namei.c 28 Jan 2004 01:03:00 -0000 1.8.6.2 @@ -244,20 +244,19 @@ _sysio_path_walk(struct pnode *parent, s nd->nd_pno = nameidata.nd_pno; ino = nd->nd_pno->p_base->pb_ino; } - #ifdef AUTOMOUNT_FILE_NAME - /* - * We're committed to a lookup. It's time to see if we're - * going to do it in an automount-point and arrange the - * mount if so. - */ - if (ino && + else if (ino && S_ISDIR(ino->i_mode) && (nd->nd_pno->p_mount->mnt_flags & MOUNT_F_AUTO) && nd->nd_amcnt < MAX_MOUNT_DEPTH && ino->i_mode & S_ISVTX) { struct pnode *pno; + /* + * We're committed to a lookup. It's time to see if + * we're going to do it in an automount-point and + * arrange the mount if so. + */ assert(!nd->nd_pno->p_cover); err = lookup(nd->nd_pno, @@ -265,6 +264,8 @@ _sysio_path_walk(struct pnode *parent, s &pno, NULL, NULL); + if (pno) + P_RELE(pno); if (!err && _sysio_automount(pno) == 0) { struct pnode *root; @@ -285,7 +286,9 @@ _sysio_path_walk(struct pnode *parent, s assert(root); P_RELE(nd->nd_pno); nd->nd_pno = root; +#if 0 P_REF(nd->nd_pno); +#endif ino = nd->nd_pno->p_base->pb_ino; assert(ino); @@ -293,13 +296,11 @@ _sysio_path_walk(struct pnode *parent, s * Must send the intent-path again. */ path = nd->nd_path; - } - if (!err) { - P_RELE(pno); nd->nd_amcnt++; + /* * Must go back top and retry with this - * new pnode. + * new pnode as parent. */ continue; } @@ -426,7 +427,7 @@ _sysio_path_walk(struct pnode *parent, s * On error, we will want to drop our reference to the current * path node if at end. */ - if (err) { + if (err && nd->nd_pno) { P_RELE(nd->nd_pno); nd->nd_pno = NULL; } |
|
From: Lee W. <lw...@us...> - 2004-01-27 22:06:28
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10878/src Modified Files: Tag: strided-io rw.c Log Message: With the integration and rewrite of read.c and write.c, needed to go back and put the SYIO_{ENTER,LEAVE} pairs. Index: rw.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/Attic/rw.c,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -u -w -b -B -p -r1.1.2.3 -r1.1.2.4 --- rw.c 26 Jan 2004 07:24:29 -0000 1.1.2.3 +++ rw.c 27 Jan 2004 22:05:23 -0000 1.1.2.4 @@ -250,15 +250,19 @@ ireadv(int fd, const struct iovec *iov, struct ioctx *ioctx; int err; + SYSIO_ENTER; fil = _sysio_fd_find_capable(fd, O_WRONLY); if (!fil) { errno = EBADF; + SYSIO_LEAVE; return IOID_FAIL; } xtv = malloc(sizeof(struct intnl_xtvec)); - if (!xtv) + if (!xtv) { + SYSIO_LEAVE; return IOID_FAIL; + } err = _sysio_iiov(fil->f_ino->i_ops.inop_read, fil, @@ -268,8 +272,10 @@ ireadv(int fd, const struct iovec *iov, if (err) { free(xtv); errno = -err; + SYSIO_LEAVE; return IOID_FAIL; } + SYSIO_LEAVE; return ioctx->ioctx_id; } @@ -281,9 +287,11 @@ readv(int fd, const struct iovec *iov, i struct ioctx *ioctx; int err; + SYSIO_ENTER; fil = _sysio_fd_find_capable(fd, O_WRONLY); if (!fil) { errno = EBADF; + SYSIO_LEAVE; return -1; } @@ -295,8 +303,10 @@ readv(int fd, const struct iovec *iov, i &ioctx); if (err) { errno = -err; + SYSIO_LEAVE; return -1; } + SYSIO_LEAVE; return _sysio_ioctx_wait(ioctx); } @@ -322,15 +332,19 @@ iread(int fd, void *buf, size_t count) struct ioctx *ioctx; int err; + SYSIO_ENTER; fil = _sysio_fd_find_capable(fd, O_WRONLY); if (!fil) { errno = EBADF; + SYSIO_LEAVE; return IOID_FAIL; } iov = malloc(sizeof(struct iovec)); - if (!iov) + if (!iov) { + SYSIO_LEAVE; return IOID_FAIL; + } iov->iov_base = buf; iov->iov_len = count; xtv = malloc(sizeof(struct intnl_xtvec)); @@ -340,6 +354,7 @@ iread(int fd, void *buf, size_t count) oerrno = errno; free(iov); errno = oerrno; + SYSIO_LEAVE; return IOID_FAIL; } err = @@ -352,8 +367,10 @@ iread(int fd, void *buf, size_t count) free(xtv); free(iov); errno = -err; + SYSIO_LEAVE; return IOID_FAIL; } + SYSIO_LEAVE; return ioctx->ioctx_id; } @@ -366,9 +383,11 @@ read(int fd, void *buf, size_t count) int err; struct ioctx *ioctx; + SYSIO_ENTER; fil = _sysio_fd_find_capable(fd, O_WRONLY); if (!fil) { errno = EBADF; + SYSIO_LEAVE; return -1; } @@ -382,8 +401,10 @@ read(int fd, void *buf, size_t count) &ioctx); if (err) { errno = -err; + SYSIO_LEAVE; return -1; } + SYSIO_LEAVE; return _sysio_ioctx_wait(ioctx); } @@ -414,9 +435,12 @@ _sysio_ipiov(ssize_t (*f)(struct inode * ssize_t cc; int err; + SYSIO_ENTER; cc = _sysio_sum_iovec(iov, count); - if (cc < 0) + if (cc < 0) { + SYSIO_LEAVE; return (int )-cc; + } xtv->xtv_off = off, xtv->xtv_len = cc; err = @@ -426,6 +450,7 @@ _sysio_ipiov(ssize_t (*f)(struct inode * xtv, 1, xtv_free, NULL, ioctxp); + SYSIO_LEAVE; if (err) return err; return 0; @@ -439,15 +464,19 @@ _ipreadv(int fd, const struct iovec *iov struct ioctx *ioctx; int err; + SYSIO_ENTER; fil = _sysio_fd_find_capable(fd, O_WRONLY); if (!fil) { errno = EBADF; + SYSIO_LEAVE; return IOID_FAIL; } xtv = malloc(sizeof(struct intnl_xtvec)); - if (!xtv) + if (!xtv) { + SYSIO_LEAVE; return IOID_FAIL; + } err = _sysio_ipiov(fil->f_ino->i_ops.inop_read, fil, @@ -458,8 +487,10 @@ _ipreadv(int fd, const struct iovec *iov if (err) { free(xtv); errno = -err; + SYSIO_LEAVE; return IOID_FAIL; } + SYSIO_LEAVE; return ioctx->ioctx_id; } @@ -483,9 +514,11 @@ _preadv(int fd, const struct iovec *iov, struct ioctx *ioctx; int err; + SYSIO_ENTER; fil = _sysio_fd_find_capable(fd, O_WRONLY); if (!fil) { errno = EBADF; + SYSIO_LEAVE; return -1; } @@ -498,8 +531,10 @@ _preadv(int fd, const struct iovec *iov, &ioctx); if (err) { errno = -err; + SYSIO_LEAVE; return -1; } + SYSIO_LEAVE; return _sysio_ioctx_wait(ioctx); } @@ -524,9 +559,11 @@ _ipread(int fd, void *buf, size_t count, struct ioctx *ioctx; int err; + SYSIO_ENTER; fil = _sysio_fd_find_capable(fd, O_WRONLY); if (!fil) { errno = EBADF; + SYSIO_LEAVE; return IOID_FAIL; } @@ -553,8 +590,10 @@ error: if (xtv) free(xtv); errno = -err; + SYSIO_LEAVE; return IOID_FAIL; } + SYSIO_LEAVE; return ioctx->ioctx_id; } @@ -579,9 +618,11 @@ _pread(int fd, void *buf, size_t count, struct ioctx *ioctx; int err; + SYSIO_ENTER; fil = _sysio_fd_find_capable(fd, O_WRONLY); if (!fil) { errno = EBADF; + SYSIO_LEAVE; return -1; } @@ -597,8 +638,10 @@ _pread(int fd, void *buf, size_t count, &ioctx); if (err) { errno = -err; + SYSIO_LEAVE; return -1; } + SYSIO_LEAVE; return _sysio_ioctx_wait(ioctx); } @@ -623,9 +666,11 @@ _ireadx(int fd, int err; struct ioctx *ioctx; + SYSIO_ENTER; fil = _sysio_fd_find_capable(fd, O_WRONLY); if (!(fil && xtv_count)) { errno = EBADF; + SYSIO_LEAVE; return IOID_FAIL; } @@ -638,8 +683,10 @@ _ireadx(int fd, &ioctx); if (err) { errno = -err; + SYSIO_LEAVE; return IOID_FAIL; } + SYSIO_LEAVE; return ioctx->ioctx_id; } @@ -660,15 +707,19 @@ ireadx(int fd, int err; struct ioctx *ioctx; + SYSIO_ENTER; fil = _sysio_fd_find_capable(fd, O_WRONLY); if (!(fil && xtv_count)) { errno = EBADF; + SYSIO_LEAVE; return IOID_FAIL; } ixtv = ixtvent = malloc(xtv_count * sizeof(struct intnl_xtvec)); - if (!ixtv) + if (!ixtv) { + SYSIO_LEAVE; return IOID_FAIL; + } count = xtv_count; while (count--) { ixtvent->xtv_off = xtv->xtv_off; @@ -687,8 +738,10 @@ ireadx(int fd, if (err) { free(ixtv); errno = -err; + SYSIO_LEAVE; return IOID_FAIL; } + SYSIO_LEAVE; return ioctx->ioctx_id; } #else @@ -747,15 +800,19 @@ iwritev(int fd, const struct iovec *iov, struct ioctx *ioctx; int err; + SYSIO_ENTER; fil = _sysio_fd_find_capable(fd, O_RDONLY); if (!fil) { errno = EBADF; + SYSIO_LEAVE; return IOID_FAIL; } xtv = malloc(sizeof(struct intnl_xtvec)); - if (!xtv) + if (!xtv) { + SYSIO_LEAVE; return IOID_FAIL; + } err = _sysio_iiov(fil->f_ino->i_ops.inop_write, fil, @@ -765,8 +822,10 @@ iwritev(int fd, const struct iovec *iov, if (err) { free(xtv); errno = -err; + SYSIO_LEAVE; return IOID_FAIL; } + SYSIO_LEAVE; return ioctx->ioctx_id; } @@ -778,9 +837,11 @@ writev(int fd, const struct iovec *iov, struct ioctx *ioctx; int err; + SYSIO_ENTER; fil = _sysio_fd_find_capable(fd, O_RDONLY); if (!fil) { errno = EBADF; + SYSIO_LEAVE; return -1; } @@ -792,8 +853,10 @@ writev(int fd, const struct iovec *iov, &ioctx); if (err) { errno = -err; + SYSIO_LEAVE; return -1; } + SYSIO_LEAVE; return _sysio_ioctx_wait(ioctx); } @@ -811,15 +874,19 @@ iwrite(int fd, const void *buf, size_t c struct ioctx *ioctx; int err; + SYSIO_ENTER; fil = _sysio_fd_find_capable(fd, O_RDONLY); if (!fil) { errno = EBADF; + SYSIO_LEAVE; return IOID_FAIL; } iov = malloc(sizeof(struct iovec)); - if (!iov) + if (!iov) { + SYSIO_LEAVE; return IOID_FAIL; + } iov->iov_base = (void *)buf; iov->iov_len = count; xtv = malloc(sizeof(struct intnl_xtvec)); @@ -829,6 +896,7 @@ iwrite(int fd, const void *buf, size_t c oerrno = errno; free(iov); errno = oerrno; + SYSIO_LEAVE; return IOID_FAIL; } err = @@ -841,8 +909,10 @@ iwrite(int fd, const void *buf, size_t c free(xtv); free(iov); errno = -err; + SYSIO_LEAVE; return IOID_FAIL; } + SYSIO_LEAVE; return ioctx->ioctx_id; } @@ -855,9 +925,11 @@ write(int fd, const void *buf, size_t co int err; struct ioctx *ioctx; + SYSIO_ENTER; fil = _sysio_fd_find_capable(fd, O_RDONLY); if (!fil) { errno = EBADF; + SYSIO_LEAVE; return -1; } @@ -871,8 +943,10 @@ write(int fd, const void *buf, size_t co &ioctx); if (err) { errno = -err; + SYSIO_LEAVE; return -1; } + SYSIO_LEAVE; return _sysio_ioctx_wait(ioctx); } @@ -894,15 +968,19 @@ _ipwritev(int fd, const struct iovec *io struct ioctx *ioctx; int err; + SYSIO_ENTER; fil = _sysio_fd_find_capable(fd, O_RDONLY); if (!fil) { errno = EBADF; + SYSIO_LEAVE; return IOID_FAIL; } xtv = malloc(sizeof(struct intnl_xtvec)); - if (!xtv) + if (!xtv) { + SYSIO_LEAVE; return IOID_FAIL; + } err = _sysio_ipiov(fil->f_ino->i_ops.inop_write, fil, @@ -913,8 +991,10 @@ _ipwritev(int fd, const struct iovec *io if (err) { free(xtv); errno = -err; + SYSIO_LEAVE; return IOID_FAIL; } + SYSIO_LEAVE; return ioctx->ioctx_id; } @@ -938,9 +1018,11 @@ _pwritev(int fd, const struct iovec *iov struct ioctx *ioctx; int err; + SYSIO_ENTER; fil = _sysio_fd_find_capable(fd, O_RDONLY); if (!fil) { errno = EBADF; + SYSIO_LEAVE; return -1; } @@ -953,8 +1035,10 @@ _pwritev(int fd, const struct iovec *iov &ioctx); if (err) { errno = -err; + SYSIO_LEAVE; return -1; } + SYSIO_LEAVE; return _sysio_ioctx_wait(ioctx); } @@ -979,9 +1063,11 @@ _ipwrite(int fd, const void *buf, size_t struct ioctx *ioctx; int err; + SYSIO_ENTER; fil = _sysio_fd_find_capable(fd, O_RDONLY); if (!fil) { errno = EBADF; + SYSIO_LEAVE; return IOID_FAIL; } @@ -1008,8 +1094,10 @@ error: if (xtv) free(xtv); errno = -err; + SYSIO_LEAVE; return IOID_FAIL; } + SYSIO_LEAVE; return ioctx->ioctx_id; } @@ -1034,9 +1122,11 @@ _pwrite(int fd, const void *buf, size_t struct ioctx *ioctx; int err; + SYSIO_ENTER; fil = _sysio_fd_find_capable(fd, O_RDONLY); if (!fil) { errno = EBADF; + SYSIO_LEAVE; return -1; } @@ -1052,8 +1142,10 @@ _pwrite(int fd, const void *buf, size_t &ioctx); if (err) { errno = -err; + SYSIO_LEAVE; return -1; } + SYSIO_LEAVE; return _sysio_ioctx_wait(ioctx); } @@ -1078,9 +1170,11 @@ _iwritex(int fd, int err; struct ioctx *ioctx; + SYSIO_ENTER; fil = _sysio_fd_find_capable(fd, O_RDONLY); if (!(fil && xtv_count)) { errno = EBADF; + SYSIO_LEAVE; return IOID_FAIL; } @@ -1093,8 +1187,10 @@ _iwritex(int fd, &ioctx); if (err) { errno = -err; + SYSIO_LEAVE; return IOID_FAIL; } + SYSIO_LEAVE; return ioctx->ioctx_id; } @@ -1115,15 +1211,19 @@ iwritex(int fd, int err; struct ioctx *ioctx; + SYSIO_ENTER; fil = _sysio_fd_find_capable(fd, O_RDONLY); if (!(fil && xtv_count)) { errno = EBADF; + SYSIO_LEAVE; return IOID_FAIL; } ixtv = ixtvent = malloc(xtv_count * sizeof(struct intnl_xtvec)); - if (!ixtv) + if (!ixtv) { + SYSIO_LEAVE; return IOID_FAIL; + } count = xtv_count; while (count--) { ixtvent->xtv_off = xtv->xtv_off; @@ -1142,8 +1242,10 @@ iwritex(int fd, if (err) { free(ixtv); errno = -err; + SYSIO_LEAVE; return IOID_FAIL; } + SYSIO_LEAVE; return ioctx->ioctx_id; } #else |
|
From: Lee W. <lw...@us...> - 2004-01-27 21:34:50
|
Update of /cvsroot/libsysio/libsysio In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2222 Modified Files: Tag: strided-io Rules.make configure.in Log Message: Added --with-zero-sum-memory which causes _sysio_shutdown to have various global (variable sized) tables deallocated at shutdown time. This in order to make *all* memory dynamically allocated during the run is free'd. This is really a debugging only option. These tables, normally, need not be freed. Once that was accomplished valgrind was run. No errors/leaks are reported now. Index: Rules.make =================================================================== RCS file: /cvsroot/libsysio/libsysio/Rules.make,v retrieving revision 1.4.16.1 retrieving revision 1.4.16.2 diff -u -w -b -B -p -r1.4.16.1 -r1.4.16.2 --- Rules.make 26 Jan 2004 16:27:46 -0000 1.4.16.1 +++ Rules.make 27 Jan 2004 21:33:44 -0000 1.4.16.2 @@ -14,5 +14,5 @@ endif DEV_CPPFLAGS = $(STDFD_DEV_CPPFLAGS) AM_CPPFLAGS = \ - $(AUTOMOUNT) $(DEV_CPPFLAGS) $(SOCKETS_CPPFLAGS) \ + $(AUTOMOUNT) $(ZERO_SUM_MEMORY) $(DEV_CPPFLAGS) $(SOCKETS_CPPFLAGS) \ -I$(top_srcdir)/include Index: configure.in =================================================================== RCS file: /cvsroot/libsysio/libsysio/configure.in,v retrieving revision 1.12.6.2 retrieving revision 1.12.6.3 diff -u -w -b -B -p -r1.12.6.2 -r1.12.6.3 --- configure.in 26 Jan 2004 16:27:46 -0000 1.12.6.2 +++ configure.in 27 Jan 2004 21:33:44 -0000 1.12.6.3 @@ -90,6 +90,17 @@ AC_ARG_WITH(stdfd-dev, [with_stdfd_dev=yes]) AM_CONDITIONAL(WITH_STDFD_DEV, test x$with_stdfd_dev = xyes) +AC_ARG_WITH(zero-sum-memory, + AC_HELP_STRING([--with-zero-sum-memory], + [free all dynamically allocated memory at the end -- useful for debugging]), + [ case "${withval}" in + yes) ZERO_SUM_MEMORY=-DZERO_SUM_MEMORY=1 ;; + no) ;; + *) AC_MSG_ERROR(bad value ${withval} for --with-zero-sum-memory) ;; + esac], + [with_zero-sum-memory=no]) +AC_SUBST(ZERO_SUM_MEMORY) + AC_ARG_WITH(cplant_yod, AC_HELP_STRING([--with-cplant-yod],[build cplant yod I/O driver]), [ case "${withval}" in |
|
From: Lee W. <lw...@us...> - 2004-01-27 21:34:49
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2222/include Modified Files: Tag: strided-io file.h fs.h inode.h Log Message: Added --with-zero-sum-memory which causes _sysio_shutdown to have various global (variable sized) tables deallocated at shutdown time. This in order to make *all* memory dynamically allocated during the run is free'd. This is really a debugging only option. These tables, normally, need not be freed. Once that was accomplished valgrind was run. No errors/leaks are reported now. Index: file.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/file.h,v retrieving revision 1.7 retrieving revision 1.7.6.1 diff -u -w -b -B -p -r1.7 -r1.7.6.1 --- file.h 13 Oct 2003 01:04:35 -0000 1.7 +++ file.h 27 Jan 2004 21:33:44 -0000 1.7.6.1 @@ -98,3 +98,6 @@ extern struct file *_sysio_fd_find(int f extern int _sysio_fd_set(struct file *fil, int fd); extern int _sysio_fd_dup2(int oldfd, int newfd); extern int _sysio_fd_close_all(void); +#if ZERO_SUM_MEMORY +extern void _sysio_fd_shutdown(void); +#endif Index: fs.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/fs.h,v retrieving revision 1.4 retrieving revision 1.4.16.1 diff -u -w -b -B -p -r1.4 -r1.4.16.1 --- fs.h 24 Mar 2003 22:09:05 -0000 1.4 +++ fs.h 27 Jan 2004 21:33:44 -0000 1.4.16.1 @@ -167,3 +167,6 @@ extern struct filesys * _sysio_fs_new(st unsigned mask, void *private); extern void _sysio_fs_gone(struct filesys *fs); +#if ZERO_SUM_MEMORY +extern void _sysio_fssw_shutdown(void); +#endif Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.13.6.4 retrieving revision 1.13.6.5 diff -u -w -b -B -p -r1.13.6.4 -r1.13.6.5 --- inode.h 27 Jan 2004 19:41:59 -0000 1.13.6.4 +++ inode.h 27 Jan 2004 21:33:44 -0000 1.13.6.5 @@ -407,6 +407,9 @@ extern TAILQ_HEAD(inodes_head, inode) _s extern TAILQ_HEAD(pnodes_head, pnode) _sysio_pnodes; extern int _sysio_i_init(void); +#if ZERO_SUM_MEMORY +extern void _sysio_i_shutdown(void); +#endif extern struct inode *_sysio_i_new(struct filesys *fs, struct file_identifier *fid, mode_t type, |
|
From: Lee W. <lw...@us...> - 2004-01-27 21:34:49
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2222/src Modified Files: Tag: strided-io file.c fs.c init.c inode.c Log Message: Added --with-zero-sum-memory which causes _sysio_shutdown to have various global (variable sized) tables deallocated at shutdown time. This in order to make *all* memory dynamically allocated during the run is free'd. This is really a debugging only option. These tables, normally, need not be freed. Once that was accomplished valgrind was run. No errors/leaks are reported now. Index: file.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/file.c,v retrieving revision 1.6.6.1 retrieving revision 1.6.6.2 diff -u -w -b -B -p -r1.6.6.1 -r1.6.6.2 --- file.c 23 Jan 2004 15:21:26 -0000 1.6.6.1 +++ file.c 27 Jan 2004 21:33:44 -0000 1.6.6.2 @@ -148,6 +148,16 @@ fd_grow(size_t n) return 0; } +#if ZERO_SUM_MEMORY +void +_sysio_fd_shutdown() +{ + + free(_sysio_oftab); + _sysio_oftab_size = 0; +} +#endif + /* * Find a free slot in the open files table. */ Index: fs.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fs.c,v retrieving revision 1.8 retrieving revision 1.8.16.1 diff -u -w -b -B -p -r1.8 -r1.8.16.1 --- fs.c 24 Apr 2003 02:15:29 -0000 1.8 +++ fs.c 27 Jan 2004 21:33:44 -0000 1.8.16.1 @@ -105,6 +105,22 @@ _sysio_fssw_register(const char *name, s return 0; } +#if ZERO_SUM_MEMORY +/* + * Shutdown + */ +void +_sysio_fssw_shutdown() +{ + struct fsswent *fssw; + + while ((fssw = fsswitch.lh_first)) { + LIST_REMOVE(fssw, fssw_link); + free(fssw); + } +} +#endif + /* * Allocate and initialize a new file system record. */ Index: init.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/init.c,v retrieving revision 1.3.16.1 retrieving revision 1.3.16.2 diff -u -w -b -B -p -r1.3.16.1 -r1.3.16.2 --- init.c 26 Jan 2004 16:27:47 -0000 1.3.16.1 +++ init.c 27 Jan 2004 21:33:44 -0000 1.3.16.2 @@ -52,6 +52,10 @@ #include "file.h" #include "dev.h" +#if ZERO_SUM_MEMORY +#include "fs.h" +#endif + #ifdef STDFD_DEV #include "stdfd.h" #endif @@ -113,4 +117,10 @@ _sysio_shutdown() if (!(_sysio_fd_close_all() == 0 && _sysio_unmount_all() == 0)) abort(); + +#if ZERO_SUM_MEMORY + _sysio_fd_shutdown(); + _sysio_i_shutdown(); + _sysio_fssw_shutdown(); +#endif } Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.11.6.3 retrieving revision 1.11.6.4 diff -u -w -b -B -p -r1.11.6.3 -r1.11.6.4 --- inode.c 27 Jan 2004 19:42:00 -0000 1.11.6.3 +++ inode.c 27 Jan 2004 21:33:44 -0000 1.11.6.4 @@ -96,6 +96,24 @@ static size_t n_names = 0; static size_t max_names = (2 * NAMES_TABLE_LEN); /* + * Number of pnodes to grab per memory allocation when filling the + * free list. + */ +#define PNODES_PER_CHUNK ((8 * 1024) / sizeof(struct pnode) - 2) + +#if ZERO_SUM_MEMORY +/* + * Allocation information for pnodes bulk allocation. + */ +struct pnodes_block { + LIST_ENTRY(pnodes_block) pnblk_links; + struct pnode pnblk_nodes[PNODES_PER_CHUNK]; +}; + +static LIST_HEAD( ,pnodes_block) pnblocks; +#endif + +/* * List of all path-nodes (aliases) referenced by any tree. */ struct pnodes_head _sysio_pnodes; @@ -124,6 +142,9 @@ _sysio_i_init() for (i = 0; i < NAMES_TABLE_LEN; i++) LIST_INIT(&names[i]); +#if ZERO_SUM_MEMORY + LIST_INIT(&pnblocks); +#endif TAILQ_INIT(&_sysio_pnodes); LIST_INIT(&free_pnodes); @@ -439,19 +460,46 @@ static void more_pnodes() { size_t n; +#if ZERO_SUM_MEMORY + struct pnodes_block *pnblk; +#endif struct pnode *pno; - n = (8 * 1024) / sizeof(struct pnode); /* numbers! */ - assert(n); - pno = malloc(n * sizeof(struct pnode)); +#if ZERO_SUM_MEMORY + pnblk = malloc(sizeof(struct pnodes_block)); + pno = NULL; + if (pnblk) { + LIST_INSERT_HEAD(&pnblocks, pnblk, pnblk_links); + pno = pnblk->pnblk_nodes; + } +#else + pno = malloc(PNODES_PER_CHUNK * sizeof(struct pnode)); +#endif if (!pno) return; + n = PNODES_PER_CHUNK; do { LIST_INSERT_HEAD(&free_pnodes, pno, p_links); pno++; } while (--n); } +#if ZERO_SUM_MEMORY +/* + * Shutdown + */ +void +_sysio_i_shutdown() +{ + struct pnodes_block *pnblk; + + while ((pnblk = pnblocks.lh_first)) { + LIST_REMOVE(pnblk, pnblk_links); + free(pnblk); + } +} +#endif + /* * Allocate, initialize and establish appropriate links for new path (alias) * node. |
|
From: Lee W. <lw...@us...> - 2004-01-27 19:43:04
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3683/src Modified Files: Tag: strided-io inode.c ioctx.c mount.c Log Message: In mount.c, should not send the already filled in inode operations to I_INIT. It does a memcpy which fails on certain machines. Didn't want to use the, safer, memmove function. Just use a temporary on the stack and allow the copy to proceed normally. In ioctx.c, _sysio_ioctx_complete added a function ot enter a `fast' IO context to the asynch requests queue. Modified _sysio_ioctx_new and the code that reads the automount file in mount.c to use it. This fixed a bug where the automount code fast IO context was being removed from a list it was not on. Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.11.6.2 retrieving revision 1.11.6.3 diff -u -w -b -B -p -r1.11.6.2 -r1.11.6.3 --- inode.c 26 Jan 2004 16:27:47 -0000 1.11.6.2 +++ inode.c 27 Jan 2004 19:42:00 -0000 1.11.6.3 @@ -205,6 +205,7 @@ _sysio_i_new(struct filesys *fs, { struct inode *ino; struct itable_entry *head; + struct inode_ops operations; if (n_inodes > max_inodes) { /* @@ -217,6 +218,7 @@ _sysio_i_new(struct filesys *fs, if (!ino) return NULL; ino->i_ops = *ops; + operations = *ops; if (S_ISBLK(type) || S_ISCHR(type) || S_ISFIFO(type)) { struct inode_ops *o; @@ -225,15 +227,15 @@ _sysio_i_new(struct filesys *fs, * those from the device table. */ o = _sysio_dev_lookup(type, rdev); - ino->i_ops.inop_open = o->inop_open; - ino->i_ops.inop_close = o->inop_close; - ino->i_ops.inop_read = o->inop_read; - ino->i_ops.inop_write = o->inop_write; - ino->i_ops.inop_iodone = o->inop_iodone; - ino->i_ops.inop_datasync = o->inop_datasync; - ino->i_ops.inop_ioctl = o->inop_ioctl; + operations.inop_open = o->inop_open; + operations.inop_close = o->inop_close; + operations.inop_read = o->inop_read; + operations.inop_write = o->inop_write; + operations.inop_iodone = o->inop_iodone; + operations.inop_datasync = o->inop_datasync; + operations.inop_ioctl = o->inop_ioctl; } - I_INIT(ino, fs, type, rdev, &ino->i_ops, fid, immunity, private); + I_INIT(ino, fs, type, rdev, &operations, fid, immunity, private); ino->i_ref = 1; TAILQ_INSERT_TAIL(&_sysio_inodes, ino, i_nodes); head = &fs->fs_itbl[hash(fid) % FS_ITBLSIZ]; Index: ioctx.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctx.c,v retrieving revision 1.6.6.7 retrieving revision 1.6.6.8 diff -u -w -b -B -p -r1.6.6.7 -r1.6.6.8 --- ioctx.c 27 Jan 2004 15:29:05 -0000 1.6.6.7 +++ ioctx.c 27 Jan 2004 19:42:00 -0000 1.6.6.8 @@ -89,7 +89,17 @@ _sysio_ioctx_init() } /* - * Allocate and initialisze a new IO context. + * Enter an IO context onto the async IO events queue. + */ +void +_sysio_ioctx_enter(struct ioctx *ioctx) +{ + + LIST_INSERT_HEAD(&aioq, ioctx, ioctx_link); +} + +/* + * Allocate and initialize a new IO context. */ struct ioctx * _sysio_ioctx_new(struct inode *ino, @@ -116,7 +126,7 @@ _sysio_ioctx_new(struct inode *ino, /* * Link request onto the outstanding requests queue. */ - LIST_INSERT_HEAD(&aioq, ioctx, ioctx_link); + _sysio_ioctx_enter(ioctx); return ioctx; } Index: mount.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mount.c,v retrieving revision 1.9.6.2 retrieving revision 1.9.6.3 diff -u -w -b -B -p -r1.9.6.2 -r1.9.6.3 --- mount.c 26 Jan 2004 07:24:29 -0000 1.9.6.2 +++ mount.c 27 Jan 2004 19:42:00 -0000 1.9.6.3 @@ -606,6 +606,7 @@ _sysio_automount(struct pnode *mntpno) ino, &iovec, 1, &xtvec, 1); + _sysio_ioctx_enter(&iocontext); err = (*ino->i_ops.inop_read)(ino, &iocontext); if (err) { _sysio_ioctx_complete(&iocontext); |
|
From: Lee W. <lw...@us...> - 2004-01-27 19:43:04
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3683/include Modified Files: Tag: strided-io inode.h Log Message: In mount.c, should not send the already filled in inode operations to I_INIT. It does a memcpy which fails on certain machines. Didn't want to use the, safer, memmove function. Just use a temporary on the stack and allow the copy to proceed normally. In ioctx.c, _sysio_ioctx_complete added a function ot enter a `fast' IO context to the asynch requests queue. Modified _sysio_ioctx_new and the code that reads the automount file in mount.c to use it. This fixed a bug where the automount code fast IO context was being removed from a list it was not on. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.13.6.3 retrieving revision 1.13.6.4 diff -u -w -b -B -p -r1.13.6.3 -r1.13.6.4 --- inode.h 26 Jan 2004 07:24:29 -0000 1.13.6.3 +++ inode.h 27 Jan 2004 19:41:59 -0000 1.13.6.4 @@ -450,6 +450,7 @@ extern int _sysio_namei(struct pnode *pn struct pnode **pnop); extern int _sysio_p_chdir(struct pnode *pno); extern int _sysio_ioctx_init(void); +extern void _sysio_ioctx_enter(struct ioctx *ioctx); extern struct ioctx *_sysio_ioctx_new(struct inode *ino, const struct iovec *iov, size_t iovlen, |
|
From: Lee W. <lw...@us...> - 2004-01-27 15:30:11
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3566 Modified Files: Tag: strided-io ioctx.c Log Message: The IO complete routine would release the inode reference always. This is improper if the context was marked `fast'. Fixed. Index: ioctx.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctx.c,v retrieving revision 1.6.6.6 retrieving revision 1.6.6.7 diff -u -w -b -B -p -r1.6.6.6 -r1.6.6.7 --- ioctx.c 26 Jan 2004 07:10:57 -0000 1.6.6.6 +++ ioctx.c 27 Jan 2004 15:29:05 -0000 1.6.6.7 @@ -231,11 +231,12 @@ _sysio_ioctx_complete(struct ioctx *ioct */ LIST_REMOVE(ioctx, ioctx_link); - I_RELE(ioctx->ioctx_ino); if (ioctx->ioctx_fast) return; + I_RELE(ioctx->ioctx_ino); + free(ioctx); } |
|
From: Lee W. <lw...@us...> - 2004-01-27 04:06:08
|
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv684 Modified Files: Tag: strided-io Makefile.am Added Files: Tag: strided-io test_regions.c Log Message: Add regions test to check end-cases around seeks and transfers. --- NEW FILE --- /* * This Cplant(TM) source code is the property of Sandia National * Laboratories. * * This Cplant(TM) source code is regionsrighted by Sandia National * Laboratories. * * The redistribution of this Cplant(TM) source code is subject to the * terms of the GNU Lesser General Public License * (see cit/LGPL or http://www.gnu.org/licenses/lgpl.html) * * Cplant(TM) Copyright 1998-2004 Sandia Corporation. * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive * license for use of this work by or on behalf of the US Government. * Export of this program may require a license from the United States * Government. */ /* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a regions 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... */ #define _BSD_SOURCE #if (_LARGEFILE64_SOURCE && \ ((defined(__STDC_VERSION__) && __STDC_VERSION__ == 199901L))) #define GO64 #else #warning Cannot prompt the 64-bit interface #endif #if defined(GO64) && defined(__GLIBC__) #define _ISOC99_SOURCE 1 #endif #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #ifndef REDSTORM #include <getopt.h> #endif #include <limits.h> #include <errno.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <sys/queue.h> #include "sysio.h" #include "mount.h" #include "test.h" /* * Copy one file to another. * * Usage: test_regions [-a] [-r <source>] [-m <root-driver>] [-x] \ * {r,w} <off> <count> <path> * * Destination will not be overwritten if it already exist. */ #if (_LARGEFILE64_SOURCE && \ ((defined(__STDC_VERSION__) && __STDC_VERSION__ == 199901L) || \ (defined(_ISOC99_SOURCE) && _ISOC99_SOURCE))) #define GO64 #else #warning Cannot prompt the 64-bit interface #endif char *root_driver = DEFAULT_DRIVER; char *mntpath = "/"; unsigned mntflgs = 0; char which; #ifdef GO64 int use64 = 0; /* 64-bit interface? */ #endif void usage(void); int main(int argc, char * const argv[]) { int i; int err; long l; off_t off; #ifdef GO64 long long ll; off64_t off64; #endif char *cp; unsigned long nbytes; const char *path; char *buf; int flags; int fd; ssize_t cc; /* * Parse command-line args. */ while ((i = getopt(argc, argv, #ifdef __GLIBC__ "+" #endif #ifdef AUTOMOUNT_FILE_NAME "a" #endif #ifdef GO64 "x" #endif "r:m:")) != -1) switch (i) { #ifdef AUTOMOUNT_FILE_NAME case 'a': mntflgs |= MOUNT_F_AUTO; break; #endif case 'r': /* set working dir */ mntpath = optarg; break; case 'm': root_driver = optarg; break; #ifdef GO64 case 'x': use64 = 1; break; #endif default: usage(); } if (argc - optind != 4) usage(); which = *argv[optind]; if (strlen(argv[optind]) != 1 || !(which == 'r' || which == 'w')) { (void )fprintf(stderr, "Which op?\n"); exit(1); } optind++; off = l = #ifdef GO64 ll = strtoll(argv[optind++], &cp, 0); #else strtol(argv[optind++], &cp, 0); #endif #ifdef GO64 off64 = ll; #endif if (*cp != '\0' || #ifdef GO64 ((ll == LLONG_MIN || ll == LLONG_MAX) && errno == ERANGE) || off64 != ll || (!use64 && off != ll) #else ((l == LONG_MIN || l == LONG_MAX) && errno == ERANGE) || off != l #endif ) { (void )fprintf(stderr, "Offset out of range\n"); exit(1); } nbytes = strtoul(argv[optind++], &cp, 0); if (*cp != '\0' || (nbytes == ULONG_MAX && errno == ERANGE)) { (void )fprintf(stderr, "Transfer count out of range\n"); exit(1); } if (!(argc - optind)) usage(); path = argv[optind++]; #ifndef CPLANT_YOD if (_sysio_init() != 0) { perror("init sysio"); exit(1); } err = drv_init_all(); if (err) { perror("init drivers"); exit(1); } err = _sysio_mount_root(mntpath, root_driver, mntflgs, NULL); if (err) { errno = -err; perror(root_driver); exit(1); } #endif (void )umask(022); buf = malloc(nbytes); if (!buf) { perror("malloc"); exit(1); } err = 0; flags = which == 'r' ? O_RDONLY : (O_WRONLY|O_CREAT|O_EXCL); #ifdef GO64 if (use64) flags |= O_LARGEFILE; #endif fd = open(path, flags, 0666); if (fd < 0) { perror(path); err = 1; goto out; } #ifdef GO64 if (use64) off64 = lseek64(fd, off64, SEEK_SET); else off64 = #endif off = lseek(fd, off, SEEK_SET); #ifdef GO64 if ((use64 && off64 < 0) || (!use64 && off < 0)) { perror(use64 ? "lseek64" : "lseek"); exit(1); } #else if (off < 0) { perror("lseek"); exit(1); } #endif if (which == 'r') cc = read(fd, buf, nbytes); else cc = write(fd, buf, nbytes); if (cc < 0) { perror(path); err = 1; goto error; } #ifdef GO64 if (use64) { off64 = lseek64(fd, 0, SEEK_CUR); } else off64 = #endif off = lseek(fd, 0, SEEK_CUR); (void )printf(("%s%s@" #ifdef GO64 "%lld" #else "%ld" #endif ": %ld, off " #ifdef GO64 "%lld" #else "%ld" #endif "\n"), which == 'r' ? "read" : "write", #ifdef GO64 use64 ? "64" : "", ll, #else "", l, #endif (long )cc, #ifdef GO64 off64 #else off #endif ); error: if (close(fd) != 0) perror(path); out: #ifndef CPLANT_YOD _sysio_shutdown(); #endif return err; } void usage() { (void )fprintf(stderr, "Usage: test_regions " #ifdef AUTOMOUNT_FILE_NAME "[-a] " #endif #ifdef GO64 "[-x] " #endif "[-r <source>] [-m <fsname>]" " {r,w} <offset> <nbytes> <path>\n"); exit(1); } Index: Makefile.am =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/Makefile.am,v retrieving revision 1.16.6.1 retrieving revision 1.16.6.2 diff -u -w -b -B -p -r1.16.6.1 -r1.16.6.2 --- Makefile.am 23 Jan 2004 14:18:52 -0000 1.16.6.1 +++ Makefile.am 26 Jan 2004 07:09:05 -0000 1.16.6.2 @@ -7,7 +7,7 @@ endif noinst_PROGRAMS = test_copy test_stats test_path test_mounts test_list \ test_getcwd $(STDFD_DEV_TEST) test_link test_unlink test_rename \ - test_driver + test_regions test_driver CLEANFILES=drv_data.c @@ -112,6 +112,11 @@ test_rename_CFLAGS=$(CFL) test_rename_LDADD=$(LIBS) test_rename_DEPENDENCIES=$(LIBS) +test_regions_SOURCES=test_regions.c $(CMNSRC) +test_regions_CFLAGS=$(CFL) +test_regions_LDADD=$(LIBS) +test_regions_DEPENDENCIES=$(LIBS) + test_driver_SOURCES=test_driver.c sysio_tests.c sysio_stubs.c help.c $(CMNSRC) test_driver_CFLAGS=$(CFL) test_driver_LDADD=$(LIBS) |
|
From: Lee W. <lw...@us...> - 2004-01-27 02:28:57
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4182/drivers/native Modified Files: Tag: strided-io fs_native.c Log Message: Gratuitous name change (sorry) from inop_ip{read,write}v to inop_{read,write}. Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.25.6.2 retrieving revision 1.25.6.3 diff -u -w -b -B -p -r1.25.6.2 -r1.25.6.3 --- fs_native.c 26 Jan 2004 07:10:56 -0000 1.25.6.2 +++ fs_native.c 26 Jan 2004 07:24:29 -0000 1.25.6.3 @@ -224,10 +224,8 @@ static int native_inop_close(struct inod static int native_inop_link(struct pnode *old, struct pnode *new); static int native_inop_unlink(struct pnode *pno); static int native_inop_rename(struct pnode *old, struct pnode *new); -static int native_inop_ipreadv(struct inode *ino, - struct ioctx *ioctx); -static int native_inop_ipwritev(struct inode *ino, - struct ioctx *ioctx); +static int native_inop_read(struct inode *ino, struct ioctx *ioctx); +static int native_inop_write(struct inode *ino, struct ioctx *ioctx); 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,8 +255,8 @@ static struct inode_ops native_i_ops = { native_inop_link, native_inop_unlink, native_inop_rename, - native_inop_ipreadv, - native_inop_ipwritev, + native_inop_read, + native_inop_write, native_inop_iodone, native_inop_fcntl, native_inop_sync, @@ -1378,16 +1376,14 @@ doio(char op, struct ioctx *ioctx) } static int -native_inop_ipreadv(struct inode *ino __IS_UNUSED, - struct ioctx *ioctx) +native_inop_read(struct inode *ino __IS_UNUSED, struct ioctx *ioctx) { return doio('r', ioctx); } static int -native_inop_ipwritev(struct inode *ino __IS_UNUSED, - struct ioctx *ioctx) +native_inop_write(struct inode *ino __IS_UNUSED, struct ioctx *ioctx) { return doio('w', ioctx); |
|
From: Lee W. <lw...@us...> - 2004-01-27 00:21:53
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1014/drivers/native Modified Files: Tag: strided-io fs_native.c Log Message: Use O_LARGEFILE or we don't get 64-bit file address space. Fix lots of seek/position checks. Add artificial limit check to _sysio_validx and remove the test for overflow of INT_MAX there. Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.25.6.1 retrieving revision 1.25.6.2 diff -u -w -b -B -p -r1.25.6.1 -r1.25.6.2 --- fs_native.c 23 Jan 2004 15:19:37 -0000 1.25.6.1 +++ fs_native.c 26 Jan 2004 07:10:56 -0000 1.25.6.2 @@ -1014,6 +1014,9 @@ native_inop_open(struct pnode *pno, int flags &= ~O_WRONLY; flags |= O_RDWR; } +#ifdef O_LARGEFILE + flags |= O_LARGEFILE; +#endif fd = syscall(SYS_open, path, flags, mode); if (!pno->p_base->pb_ino && fd >= 0) { int err; |
|
From: Lee W. <lw...@us...> - 2004-01-26 21:41:20
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1014/include Modified Files: Tag: strided-io inode.h sysio.h Log Message: Use O_LARGEFILE or we don't get 64-bit file address space. Fix lots of seek/position checks. Add artificial limit check to _sysio_validx and remove the test for overflow of INT_MAX there. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.13.6.1 retrieving revision 1.13.6.2 diff -u -w -b -B -p -r1.13.6.1 -r1.13.6.2 --- inode.h 23 Jan 2004 15:20:10 -0000 1.13.6.1 +++ inode.h 26 Jan 2004 07:10:57 -0000 1.13.6.2 @@ -463,7 +463,8 @@ extern struct ioctx *_sysio_ioctx_find(i extern ssize_t _sysio_ioctx_wait(struct ioctx *ioctx); extern void _sysio_ioctx_complete(struct ioctx *ioctx); extern ssize_t _sysio_validx(const struct intnl_xtvec *xtv, size_t xtvlen, - const struct iovec *iov, size_t iovlen); + const struct iovec *iov, size_t iovlen, + _SYSIO_OFF_T limit); extern ssize_t _sysio_enumerate_extents(const struct intnl_xtvec *xtv, size_t xtvlen, const struct iovec *iov, Index: sysio.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio.h,v retrieving revision 1.14.6.1 retrieving revision 1.14.6.2 diff -u -w -b -B -p -r1.14.6.1 -r1.14.6.2 --- sysio.h 23 Jan 2004 15:20:37 -0000 1.14.6.1 +++ sysio.h 26 Jan 2004 07:10:57 -0000 1.14.6.2 @@ -45,6 +45,7 @@ * System IO common information. */ +#include <limits.h> #include <stdarg.h> #ifndef _IOID_T_DEFINED @@ -81,7 +82,7 @@ typedef void *ioid_t; #ifndef _LARGEFILE64_SOURCE /* - * Not glibc. Define this ourselves. + * Not glibc I guess. Define this ourselves. */ #define _LARGEFILE64_SOURCE 0 #endif @@ -91,10 +92,17 @@ typedef void *ioid_t; */ #if _LARGEFILE64_SOURCE #define _SYSIO_OFF_T off64_t -#define _SYSIO_OFF_T_MAX (9223372036854775807LL - 1) +#ifdef LLONG_MAX +#define _SYSIO_OFF_T_MAX (LLONG_MAX) +#else +/* + * Don't have LLONG_MAX before C99. We'll need to define it ourselves. + */ +#define _SYSIO_OFF_T_MAX (9223372036854775807LL) +#endif #else #define _SYSIO_OFF_T off_t -#define _SYSIO_OFF_T_MAX (2147483647L - 1) +#define _SYSIO_OFF_T_MAX LONG_MAX #endif /* |
|
From: Lee W. <lw...@us...> - 2004-01-26 21:23:50
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4182/include Modified Files: Tag: strided-io dev.h inode.h Log Message: Gratuitous name change (sorry) from inop_ip{read,write}v to inop_{read,write}. Index: dev.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/dev.h,v retrieving revision 1.5 retrieving revision 1.5.6.1 diff -u -w -b -B -p -r1.5 -r1.5.6.1 --- dev.h 13 Oct 2003 01:04:34 -0000 1.5 +++ dev.h 26 Jan 2004 07:24:29 -0000 1.5.6.1 @@ -109,10 +109,10 @@ extern const struct inode_ops _sysio_nod (int (*)(struct pnode *))_sysio_dev_illop #define _sysio_nodev_inop_rename \ (int (*)(struct pnode *, struct pnode *))_sysio_dev_illop -#define _sysio_nodev_inop_ipreadv \ +#define _sysio_nodev_inop_read \ (int (*)(struct inode *, \ struct ioctx *))_sysio_dev_illop -#define _sysio_nodev_inop_ipwritev \ +#define _sysio_nodev_inop_write \ (int (*)(struct inode *, \ struct ioctx *))_sysio_dev_illop #define _sysio_nodev_inop_iodone \ Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.13.6.2 retrieving revision 1.13.6.3 diff -u -w -b -B -p -r1.13.6.2 -r1.13.6.3 --- inode.h 26 Jan 2004 07:10:57 -0000 1.13.6.2 +++ inode.h 26 Jan 2004 07:24:29 -0000 1.13.6.3 @@ -99,8 +99,8 @@ struct inode_ops { int (*inop_link)(struct pnode *old, struct pnode *new); int (*inop_unlink)(struct pnode *pno); int (*inop_rename)(struct pnode *old, struct pnode *new); - int (*inop_ipreadv)(struct inode *ino, struct ioctx *ioctx); - int (*inop_ipwritev)(struct inode *ino, struct ioctx *ioctx); + int (*inop_read)(struct inode *ino, struct ioctx *ioctx); + int (*inop_write)(struct inode *ino, struct ioctx *ioctx); int (*inop_iodone)(struct ioctx *iocp); int (*inop_fcntl)(struct inode *ino, int cmd, va_list ap); int (*inop_sync)(struct inode *ino); |
|
From: Lee W. <lw...@us...> - 2004-01-26 21:23:48
|
Update of /cvsroot/libsysio/libsysio/dev/stdfd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4182/dev/stdfd Modified Files: Tag: strided-io stdfd.c Log Message: Gratuitous name change (sorry) from inop_ip{read,write}v to inop_{read,write}. Index: stdfd.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/dev/stdfd/stdfd.c,v retrieving revision 1.6.6.1 retrieving revision 1.6.6.2 diff -u -w -b -B -p -r1.6.6.1 -r1.6.6.2 --- stdfd.c 23 Jan 2004 15:18:38 -0000 1.6.6.1 +++ stdfd.c 26 Jan 2004 07:24:29 -0000 1.6.6.2 @@ -78,10 +78,8 @@ static int stdfd_open(struct pnode *pno, int flags, mode_t mode); static int stdfd_close(struct inode *ino); -static int stdfd_ipreadv(struct inode *ino, - struct ioctx *ioctx); -static int stdfd_ipwritev(struct inode *ino, - struct ioctx *ioctx); +static int stdfd_read(struct inode *ino, struct ioctx *ioctx); +static int stdfd_write(struct inode *ino, struct ioctx *ioctx); static int stdfd_iodone(struct ioctx *ioctx); static int stdfd_datasync(struct inode *ino); static int stdfd_ioctl(struct inode *ino, @@ -96,8 +94,8 @@ _sysio_stdfd_init() stdfd_operations = _sysio_nodev_ops; stdfd_operations.inop_open = stdfd_open; stdfd_operations.inop_close = stdfd_close; - stdfd_operations.inop_ipreadv = stdfd_ipreadv; - stdfd_operations.inop_ipwritev = stdfd_ipwritev; + stdfd_operations.inop_read = stdfd_read; + stdfd_operations.inop_write = stdfd_write; stdfd_operations.inop_iodone = stdfd_iodone; stdfd_operations.inop_datasync = stdfd_datasync; stdfd_operations.inop_ioctl = stdfd_ioctl; @@ -149,7 +147,7 @@ doio(ssize_t (*f)(void *, size_t, _SYSIO } static ssize_t -stdfd_read(void *buf, +stdfd_read_simple(void *buf, size_t nbytes, _SYSIO_OFF_T off __IS_UNUSED, struct inode *ino) @@ -161,15 +159,14 @@ stdfd_read(void *buf, } static int -stdfd_ipreadv(struct inode *ino, - struct ioctx *ioctx) +stdfd_read(struct inode *ino, struct ioctx *ioctx) { - return doio(stdfd_read, ino, ioctx); + return doio(stdfd_read_simple, ino, ioctx); } static ssize_t -stdfd_write(const void *buf, +stdfd_write_simple(const void *buf, size_t nbytes, _SYSIO_OFF_T off __IS_UNUSED, struct inode *ino) @@ -180,14 +177,13 @@ stdfd_write(const void *buf, } static int -stdfd_ipwritev(struct inode *ino, - struct ioctx *ioctx) +stdfd_write(struct inode *ino, struct ioctx *ioctx) { return doio((ssize_t (*)(void *, size_t, _SYSIO_OFF_T, - struct inode *))stdfd_write, + struct inode *))stdfd_write_simple, ino, ioctx); } |
|
From: Lee W. <lw...@us...> - 2004-01-26 21:23:46
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4182/src Modified Files: Tag: strided-io dev.c inode.c mount.c rw.c Log Message: Gratuitous name change (sorry) from inop_ip{read,write}v to inop_{read,write}. Index: dev.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/dev.c,v retrieving revision 1.4 retrieving revision 1.4.6.1 diff -u -w -b -B -p -r1.4 -r1.4.6.1 --- dev.c 10 Oct 2003 18:50:31 -0000 1.4 +++ dev.c 26 Jan 2004 07:24:29 -0000 1.4.6.1 @@ -66,8 +66,8 @@ const struct inode_ops _sysio_nodev_ops _sysio_nodev_inop_link, _sysio_nodev_inop_unlink, _sysio_nodev_inop_rename, - _sysio_nodev_inop_ipreadv, - _sysio_nodev_inop_ipwritev, + _sysio_nodev_inop_read, + _sysio_nodev_inop_write, _sysio_nodev_inop_iodone, _sysio_nodev_inop_fcntl, _sysio_nodev_inop_sync, Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.11 retrieving revision 1.11.6.1 diff -u -w -b -B -p -r1.11 -r1.11.6.1 --- inode.c 15 Oct 2003 18:00:57 -0000 1.11 +++ inode.c 26 Jan 2004 07:24:29 -0000 1.11.6.1 @@ -227,8 +227,8 @@ _sysio_i_new(struct filesys *fs, o = _sysio_dev_lookup(type, rdev); ino->i_ops.inop_open = o->inop_open; ino->i_ops.inop_close = o->inop_close; - ino->i_ops.inop_ipreadv = o->inop_ipreadv; - ino->i_ops.inop_ipwritev = o->inop_ipwritev; + ino->i_ops.inop_read = o->inop_read; + ino->i_ops.inop_write = o->inop_write; ino->i_ops.inop_iodone = o->inop_iodone; ino->i_ops.inop_datasync = o->inop_datasync; ino->i_ops.inop_ioctl = o->inop_ioctl; Index: mount.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mount.c,v retrieving revision 1.9.6.1 retrieving revision 1.9.6.2 diff -u -w -b -B -p -r1.9.6.1 -r1.9.6.2 --- mount.c 23 Jan 2004 15:23:02 -0000 1.9.6.1 +++ mount.c 26 Jan 2004 07:24:29 -0000 1.9.6.2 @@ -606,7 +606,7 @@ _sysio_automount(struct pnode *mntpno) ino, &iovec, 1, &xtvec, 1); - err = (*ino->i_ops.inop_ipreadv)(ino, &iocontext); + err = (*ino->i_ops.inop_read)(ino, &iocontext); if (err) { _sysio_ioctx_complete(&iocontext); (void )(*ino->i_ops.inop_close)(ino); Index: rw.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/Attic/rw.c,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -w -b -B -p -r1.1.2.2 -r1.1.2.3 --- rw.c 26 Jan 2004 07:10:57 -0000 1.1.2.2 +++ rw.c 26 Jan 2004 07:24:29 -0000 1.1.2.3 @@ -260,7 +260,7 @@ ireadv(int fd, const struct iovec *iov, if (!xtv) return IOID_FAIL; err = - _sysio_iiov(fil->f_ino->i_ops.inop_ipreadv, + _sysio_iiov(fil->f_ino->i_ops.inop_read, fil, iov, count, NULL, xtv, free_xtv, @@ -288,7 +288,7 @@ readv(int fd, const struct iovec *iov, i } err = - _sysio_iiov(fil->f_ino->i_ops.inop_ipreadv, + _sysio_iiov(fil->f_ino->i_ops.inop_read, fil, iov, count, NULL, &xtvector, NULL, @@ -343,7 +343,7 @@ iread(int fd, void *buf, size_t count) return IOID_FAIL; } err = - _sysio_iiov(fil->f_ino->i_ops.inop_ipreadv, + _sysio_iiov(fil->f_ino->i_ops.inop_read, fil, iov, count, free_iov, xtv, free_xtv, @@ -375,7 +375,7 @@ read(int fd, void *buf, size_t count) iovector.iov_base = buf; iovector.iov_len = count; err = - _sysio_iiov(fil->f_ino->i_ops.inop_ipreadv, + _sysio_iiov(fil->f_ino->i_ops.inop_read, fil, &iovector, 1, NULL, &xtvector, NULL, @@ -449,7 +449,7 @@ _ipreadv(int fd, const struct iovec *iov if (!xtv) return IOID_FAIL; err = - _sysio_ipiov(fil->f_ino->i_ops.inop_ipreadv, + _sysio_ipiov(fil->f_ino->i_ops.inop_read, fil, iov, count, NULL, offset, @@ -490,7 +490,7 @@ _preadv(int fd, const struct iovec *iov, } err = - _sysio_ipiov(fil->f_ino->i_ops.inop_ipreadv, + _sysio_ipiov(fil->f_ino->i_ops.inop_read, fil, iov, count, NULL, offset, @@ -540,7 +540,7 @@ _ipread(int fd, void *buf, size_t count, iov->iov_base = buf; xtv->xtv_len = iov->iov_len = count; err = - _sysio_ipiov(fil->f_ino->i_ops.inop_ipreadv, + _sysio_ipiov(fil->f_ino->i_ops.inop_read, fil, iov, 1, free_iov, offset, @@ -589,7 +589,7 @@ _pread(int fd, void *buf, size_t count, iovec.iov_base = buf; xtvec.xtv_len = iovec.iov_len = count; err = - _sysio_ipiov(fil->f_ino->i_ops.inop_ipreadv, + _sysio_ipiov(fil->f_ino->i_ops.inop_read, fil, &iovec, 1, NULL, offset, @@ -630,7 +630,7 @@ _ireadx(int fd, } err = - _sysio_iiox(fil->f_ino->i_ops.inop_ipreadv, + _sysio_iiox(fil->f_ino->i_ops.inop_read, fil, iov, iov_count, NULL, xtv, xtv_count, NULL, @@ -678,7 +678,7 @@ ireadx(int fd, } err = - _sysio_iiox(fil->f_ino->i_ops.inop_ipreadv, + _sysio_iiox(fil->f_ino->i_ops.inop_read, fil, iov, iov_count, NULL, ixtv, xtv_count, free_xtv, @@ -757,7 +757,7 @@ iwritev(int fd, const struct iovec *iov, if (!xtv) return IOID_FAIL; err = - _sysio_iiov(fil->f_ino->i_ops.inop_ipwritev, + _sysio_iiov(fil->f_ino->i_ops.inop_write, fil, iov, count, NULL, xtv, free_xtv, @@ -785,7 +785,7 @@ writev(int fd, const struct iovec *iov, } err = - _sysio_iiov(fil->f_ino->i_ops.inop_ipwritev, + _sysio_iiov(fil->f_ino->i_ops.inop_write, fil, iov, count, NULL, &xtvector, NULL, @@ -832,7 +832,7 @@ iwrite(int fd, const void *buf, size_t c return IOID_FAIL; } err = - _sysio_iiov(fil->f_ino->i_ops.inop_ipwritev, + _sysio_iiov(fil->f_ino->i_ops.inop_write, fil, iov, count, free_iov, xtv, free_xtv, @@ -864,7 +864,7 @@ write(int fd, const void *buf, size_t co iovector.iov_base = (void *)buf; iovector.iov_len = count; err = - _sysio_iiov(fil->f_ino->i_ops.inop_ipwritev, + _sysio_iiov(fil->f_ino->i_ops.inop_write, fil, &iovector, 1, NULL, &xtvector, NULL, @@ -904,7 +904,7 @@ _ipwritev(int fd, const struct iovec *io if (!xtv) return IOID_FAIL; err = - _sysio_ipiov(fil->f_ino->i_ops.inop_ipwritev, + _sysio_ipiov(fil->f_ino->i_ops.inop_write, fil, iov, count, NULL, offset, @@ -945,7 +945,7 @@ _pwritev(int fd, const struct iovec *iov } err = - _sysio_ipiov(fil->f_ino->i_ops.inop_ipwritev, + _sysio_ipiov(fil->f_ino->i_ops.inop_write, fil, iov, count, NULL, offset, @@ -995,7 +995,7 @@ _ipwrite(int fd, const void *buf, size_t iov->iov_base = (void *)buf; xtv->xtv_len = iov->iov_len = count; err = - _sysio_ipiov(fil->f_ino->i_ops.inop_ipwritev, + _sysio_ipiov(fil->f_ino->i_ops.inop_write, fil, iov, 1, free_iov, offset, @@ -1044,7 +1044,7 @@ _pwrite(int fd, const void *buf, size_t iovec.iov_base = (void *)buf; xtvec.xtv_len = iovec.iov_len = count; err = - _sysio_ipiov(fil->f_ino->i_ops.inop_ipwritev, + _sysio_ipiov(fil->f_ino->i_ops.inop_write, fil, &iovec, 1, NULL, offset, @@ -1085,7 +1085,7 @@ _iwritex(int fd, } err = - _sysio_iiox(fil->f_ino->i_ops.inop_ipwritev, + _sysio_iiox(fil->f_ino->i_ops.inop_write, fil, iov, iov_count, NULL, xtv, xtv_count, NULL, @@ -1133,7 +1133,7 @@ iwritex(int fd, } err = - _sysio_iiox(fil->f_ino->i_ops.inop_ipwritev, + _sysio_iiox(fil->f_ino->i_ops.inop_write, fil, iov, iov_count, NULL, ixtv, xtv_count, free_xtv, |
|
From: Lee W. <lw...@us...> - 2004-01-26 21:23:38
|
Update of /cvsroot/libsysio/libsysio/drivers/incore In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4182/drivers/incore Modified Files: Tag: strided-io fs_incore.c Log Message: Gratuitous name change (sorry) from inop_ip{read,write}v to inop_{read,write}. Index: fs_incore.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/incore/fs_incore.c,v retrieving revision 1.11.6.1 retrieving revision 1.11.6.2 diff -u -w -b -B -p -r1.11.6.1 -r1.11.6.2 --- fs_incore.c 23 Jan 2004 15:18:53 -0000 1.11.6.1 +++ fs_incore.c 26 Jan 2004 07:24:29 -0000 1.11.6.2 @@ -142,10 +142,8 @@ static int _sysio_incore_inop_close(stru static int _sysio_incore_dirop_link(struct pnode *old, struct pnode *new); static int _sysio_incore_dirop_unlink(struct pnode *pno); static int _sysio_incore_dirop_rename(struct pnode *old, struct pnode *new); -static int _sysio_incore_filop_ipreadv(struct inode *ino, - struct ioctx *ioctx); -static int _sysio_incore_filop_ipwritev(struct inode *ino, - struct ioctx *ioctx); +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 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); @@ -168,10 +166,10 @@ static void _sysio_incore_illop(void); (int (*)(struct pnode *, const char *))_sysio_incore_e_nosys #define _sysio_incore_dirop_readlink \ (int (*)(struct pnode *, char *, size_t))_sysio_incore_e_inval -#define _sysio_incore_dirop_ipreadv \ +#define _sysio_incore_dirop_read \ (int (*)(struct inode *, \ struct ioctx *))_sysio_incore_e_isdir -#define _sysio_incore_dirop_ipwritev \ +#define _sysio_incore_dirop_write \ (int (*)(struct inode *, \ struct ioctx *))_sysio_incore_e_isdir #define _sysio_incore_dirop_iodone \ @@ -197,8 +195,8 @@ static struct inode_ops _sysio_incore_di _sysio_incore_dirop_link, _sysio_incore_dirop_unlink, _sysio_incore_dirop_rename, - _sysio_incore_dirop_ipreadv, - _sysio_incore_dirop_ipwritev, + _sysio_incore_dirop_read, + _sysio_incore_dirop_write, _sysio_incore_dirop_iodone, _sysio_incore_dirop_fcntl, _sysio_incore_inop_sync, @@ -252,8 +250,8 @@ static struct inode_ops _sysio_incore_fi _sysio_incore_filop_link, _sysio_incore_filop_unlink, _sysio_incore_filop_rename, - _sysio_incore_filop_ipreadv, - _sysio_incore_filop_ipwritev, + _sysio_incore_filop_read, + _sysio_incore_filop_write, _sysio_incore_filop_iodone, _sysio_incore_filop_fcntl, _sysio_incore_inop_sync, @@ -280,8 +278,8 @@ static struct inode_ops _sysio_incore_de _sysio_incore_filop_link, _sysio_incore_filop_unlink, _sysio_incore_filop_rename, - _sysio_nodev_inop_ipreadv, - _sysio_nodev_inop_ipwritev, + _sysio_nodev_inop_read, + _sysio_nodev_inop_write, _sysio_nodev_inop_iodone, _sysio_incore_filop_fcntl, _sysio_incore_inop_sync, @@ -1517,8 +1515,7 @@ incore_read(void *buf, size_t nbytes, } static int -_sysio_incore_filop_ipreadv(struct inode *ino, - struct ioctx *ioctx) +_sysio_incore_filop_read(struct inode *ino, struct ioctx *ioctx) { @@ -1557,8 +1554,7 @@ incore_write(const void *buf, size_t nby } static int -_sysio_incore_filop_ipwritev(struct inode *ino, - struct ioctx *ioctx) +_sysio_incore_filop_write(struct inode *ino, struct ioctx *ioctx) { return doio((ssize_t (*)(void *, size_t, |
|
From: Lee W. <lw...@us...> - 2004-01-26 17:23:19
|
Update of /cvsroot/libsysio/libsysio/dev/stdfd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26398/dev/stdfd Modified Files: Tag: strided-io stdfd.c Log Message: Merged with head, again, after adding Kevin Pedretti's patches. This did not go cleanly. Some remedial testing indicates no problem but... Index: stdfd.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/dev/stdfd/stdfd.c,v retrieving revision 1.6.6.2 retrieving revision 1.6.6.3 diff -u -w -b -B -p -r1.6.6.2 -r1.6.6.3 --- stdfd.c 26 Jan 2004 07:24:29 -0000 1.6.6.2 +++ stdfd.c 26 Jan 2004 17:21:51 -0000 1.6.6.3 @@ -58,10 +58,6 @@ #include "stdfd.h" -#ifdef REDSTORM -#include <catamount/syscall.h> /* ! in sys include? */ -#endif - #ifdef CPLANT_YOD #include <sys/statfs.h> #include "cplant-yod.h" |
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26398/src Modified Files: Tag: strided-io access.c chdir.c chmod.c chown.c dup.c fcntl.c getdirentries.c ioctl.c link.c lseek.c mkdir.c mknod.c open.c rmdir.c stat.c statvfs.c statvfs64.c symlink.c unlink.c Log Message: Merged with head, again, after adding Kevin Pedretti's patches. This did not go cleanly. Some remedial testing indicates no problem but... Index: access.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/access.c,v retrieving revision 1.2 retrieving revision 1.2.12.1 diff -u -w -b -B -p -r1.2 -r1.2.12.1 --- access.c 6 Aug 2003 19:10:26 -0000 1.2 +++ access.c 26 Jan 2004 17:22:06 -0000 1.2.12.1 @@ -47,6 +47,8 @@ #include <sys/stat.h> #include <unistd.h> +#include "sysio-symbols.h" + int access(const char *path, int amode) { @@ -108,3 +110,8 @@ out: return err; } + +#ifdef REDSTORM +#undef __access +sysio_sym_weak_alias(access, __access) +#endif Index: chdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chdir.c,v retrieving revision 1.10.6.1 retrieving revision 1.10.6.2 diff -u -w -b -B -p -r1.10.6.1 -r1.10.6.2 --- chdir.c 26 Jan 2004 16:27:47 -0000 1.10.6.1 +++ chdir.c 26 Jan 2004 17:22:06 -0000 1.10.6.2 @@ -140,6 +139,11 @@ chdir(const char *path) * If the buf pointer is NULL, a buffer large enough to hold the path * is allocated from the heap. */ +#ifdef REDSTORM +#undef __chdir +sysio_sym_weak_alias(chdir, __chdir) +#endif + static int _sysio_p_path(struct pnode *pno, char **buf, size_t size) { @@ -240,7 +244,7 @@ getcwd(char *buf, size_t size) sysio_sym_weak_alias(getcwd, __getcwd) #endif -#ifdef PATH_MAX +#if defined(PATH_MAX) && !(defined(REDSTORM)) char * getwd(char *buf) { Index: chmod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chmod.c,v retrieving revision 1.4.6.1 retrieving revision 1.4.6.2 diff -u -w -b -B -p -r1.4.6.1 -r1.4.6.2 --- chmod.c 26 Jan 2004 16:27:47 -0000 1.4.6.1 +++ chmod.c 26 Jan 2004 17:22:06 -0000 1.4.6.2 @@ -52,6 +52,7 @@ #include "sysio.h" #include "inode.h" #include "file.h" +#include "sysio-symbols.h" static int do_chmod(struct pnode *pno, struct inode *ino, mode_t mode) @@ -88,6 +89,11 @@ out: return err; } +#ifdef REDSTORM +#undef __chmod +sysio_sym_weak_alias(chmod, __chmod) +#endif + int fchmod(int fd, mode_t mode) { @@ -109,3 +115,8 @@ out: } return err; } + +#ifdef REDSTORM +#undef __fchmod +sysio_sym_weak_alias(fchmod, __fchmod) +#endif Index: chown.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chown.c,v retrieving revision 1.4.6.1 retrieving revision 1.4.6.2 diff -u -w -b -B -p -r1.4.6.1 -r1.4.6.2 --- chown.c 26 Jan 2004 16:27:47 -0000 1.4.6.1 +++ chown.c 26 Jan 2004 17:22:06 -0000 1.4.6.2 @@ -52,6 +52,7 @@ #include "sysio.h" #include "inode.h" #include "file.h" +#include "sysio-symbols.h" static int _do_chown(struct pnode *pno, struct inode *ino, uid_t owner, gid_t group) @@ -94,6 +95,11 @@ out: } SYSIO_LEAVE; return err; +#ifdef REDSTORM +#undef __chown +sysio_sym_weak_alias(chown, __chown) +#endif + } int @@ -115,5 +121,10 @@ out: errno = -err; err = -1; } + +#ifdef REDSTORM +#undef __fchown +sysio_sym_weak_alias(fchown, __fchown) +#endif return err; } Index: dup.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/dup.c,v retrieving revision 1.2.6.1 retrieving revision 1.2.6.2 diff -u -w -b -B -p -r1.2.6.1 -r1.2.6.2 --- dup.c 26 Jan 2004 16:27:47 -0000 1.2.6.1 +++ dup.c 26 Jan 2004 17:22:06 -0000 1.2.6.2 @@ -48,6 +48,7 @@ #include "sysio.h" #include "file.h" +#include "sysio-symbols.h" #include "sysio-symbols.h" @@ -78,6 +78,11 @@ dup2(int oldfd, int newfd) return rc; } +#ifdef REDSTORM +#undef __dup2 +sysio_sym_weak_alias(dup2, __dup2) +#endif + int dup(int oldfd) { Index: fcntl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fcntl.c,v retrieving revision 1.6.6.1 retrieving revision 1.6.6.2 diff -u -w -b -B -p -r1.6.6.1 -r1.6.6.2 --- fcntl.c 26 Jan 2004 16:27:47 -0000 1.6.6.1 +++ fcntl.c 26 Jan 2004 17:22:06 -0000 1.6.6.2 @@ -109,7 +109,7 @@ out: sysio_sym_weak_alias(fcntl, __fcntl) #endif -#if defined(BSD) || defined(REDSTORM) +#ifdef BSD #undef _fcntl sysio_sym_weak_alias(fcntl, _fcntl) #endif Index: getdirentries.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/getdirentries.c,v retrieving revision 1.4.6.1 retrieving revision 1.4.6.2 diff -u -w -b -B -p -r1.4.6.1 -r1.4.6.2 --- getdirentries.c 26 Jan 2004 16:27:47 -0000 1.4.6.1 +++ getdirentries.c 26 Jan 2004 17:22:06 -0000 1.4.6.2 @@ -103,11 +103,15 @@ getdirentries(int fd, #define _dreclen(namlen) \ ((_dbaselen + (namlen) + __alignof__ (struct dirent)) & \ ~(__alignof__ (struct dirent) - 1)) -#define _fast_alloc(n) alloca(n) -#define _fast_free(p) #else /* !defined(__GLIBC__) */ #define _dreclen(namlen) \ _rndup(_dbaselen + (namlen) + 1, sizeof(int)) +#endif + +#if defined(__GLIBC__) && !(defined(REDSTORM)) +#define _fast_alloc(n) alloca(n) +#define _fast_free(p) +#else /* !defined(__GLIBC__) || defined(REDSTORM) */ #define _fast_alloc(n) malloc(n) #define _fast_free(p) free(p) #endif @@ -226,6 +230,10 @@ out: sysio_sym_strong_alias(_getdirentries64, getdirentries) #endif +#ifdef REDSTORM +#undef __getdirentries +sysio_sym_weak_alias(getdirentries, __getdirentries) +#endif #if defined(BSD) || defined(REDSTORM) #undef _getdirentries sysio_sym_weak_alias(getdirentries, _getdirentries) Index: ioctl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctl.c,v retrieving revision 1.4.6.1 retrieving revision 1.4.6.2 diff -u -w -b -B -p -r1.4.6.1 -r1.4.6.2 --- ioctl.c 26 Jan 2004 16:27:48 -0000 1.4.6.1 +++ ioctl.c 26 Jan 2004 17:22:06 -0000 1.4.6.2 @@ -86,7 +86,7 @@ out: sysio_sym_weak_alias(ioctl, __ioctl) #endif -#if defined(BSD) || defined(REDSTORM) +#ifdef BSD #undef _ioctl sysio_sym_weak_alias(ioctl, _ioctl) #endif Index: link.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/link.c,v retrieving revision 1.2 retrieving revision 1.2.8.1 diff -u -w -b -B -p -r1.2 -r1.2.8.1 --- link.c 20 Oct 2003 16:31:23 -0000 1.2 +++ link.c 26 Jan 2004 17:22:06 -0000 1.2.8.1 @@ -52,6 +52,7 @@ #include "sysio.h" #include "mount.h" #include "inode.h" +#include "sysio-symbols.h" int link(const char *oldpath, const char *newpath) @@ -100,3 +101,8 @@ error2: out: return err; } + +#ifdef REDSTORM +#undef __link +sysio_sym_weak_alias(link, __link) +#endif Index: lseek.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/lseek.c,v retrieving revision 1.9.6.3 retrieving revision 1.9.6.4 diff -u -w -b -B -p -r1.9.6.3 -r1.9.6.4 --- lseek.c 26 Jan 2004 16:27:48 -0000 1.9.6.3 +++ lseek.c 26 Jan 2004 17:22:06 -0000 1.9.6.4 @@ -110,6 +110,10 @@ sysio_sym_weak_alias(_sysio_lseek, lseek #undef __lseek64 sysio_sym_weak_alias(_sysio_lseek, __lseek64) #endif +#ifdef REDSTORM +#undef __libc_lseek64 +sysio_sym_weak_alias(_sysio_lseek, __libc_lseek64) +#endif #endif #undef lseek Index: mkdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mkdir.c,v retrieving revision 1.3.16.1 retrieving revision 1.3.16.2 diff -u -w -b -B -p -r1.3.16.1 -r1.3.16.2 --- mkdir.c 26 Jan 2004 16:27:48 -0000 1.3.16.1 +++ mkdir.c 26 Jan 2004 17:22:06 -0000 1.3.16.2 @@ -51,6 +51,7 @@ #include "inode.h" #include "fs.h" #include "mount.h" +#include "sysio-symbols.h" int mkdir(const char *path, mode_t mode) @@ -85,3 +86,8 @@ out: SYSIO_LEAVE; return err; } + +#ifdef REDSTORM +#undef __mkdir +sysio_sym_weak_alias(mkdir, __mkdir) +#endif Index: mknod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mknod.c,v retrieving revision 1.4.6.1 retrieving revision 1.4.6.2 diff -u -w -b -B -p -r1.4.6.1 -r1.4.6.2 --- mknod.c 26 Jan 2004 16:27:48 -0000 1.4.6.1 +++ mknod.c 26 Jan 2004 17:22:06 -0000 1.4.6.2 @@ -111,6 +111,11 @@ out: } return err; } +#ifdef REDSTORM +#undef _xmknod +sysio_sym_weak_alias(__xmknod, _xmknod) +#endif + static int __mknod(const char *path, mode_t mode, dev_t dev) Index: open.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/open.c,v retrieving revision 1.11.6.1 retrieving revision 1.11.6.2 diff -u -w -b -B -p -r1.11.6.1 -r1.11.6.2 --- open.c 26 Jan 2004 16:27:48 -0000 1.11.6.1 +++ open.c 26 Jan 2004 17:22:06 -0000 1.11.6.2 @@ -220,7 +220,12 @@ sysio_sym_weak_alias(open, open64) sysio_sym_weak_alias(open, __open64) #endif -#if defined(BSD) || defined(REDSTORM) +#ifdef REDSTORM +#undef __libc_open64 +sysio_sym_weak_alias(open, __libc_open64) +#endif + +#ifdef BSD #undef _open sysio_sym_weak_alias(open, _open) #endif @@ -243,7 +248,7 @@ close(int fd) sysio_sym_weak_alias(close, __close) #endif -#if defined(BSD) || defined(REDSTORM) +#ifdef BSD #undef _close sysio_sym_weak_alias(close, _close) #endif @@ -264,7 +269,12 @@ sysio_sym_weak_alias(creat, creat64) sysio_sym_weak_alias(creat, __creat64) #endif -#if defined(BSD) || defined(REDSTORM) +#ifdef REDSTORM +#undef __libc_creat +sysio_sym_weak_alias(creat, __libc_creat) +#endif + +#ifdef BSD #undef _creat sysio_sym_weak_alias(creat, _creat) #endif @@ -278,3 +288,8 @@ umask(mode_t mask) _sysio_umask = mask & 0777; return omask; } + +#ifdef REDSTORM +#undef __umask +sysio_sym_weak_alias(umask, __umask) +#endif Index: rmdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rmdir.c,v retrieving revision 1.4.6.1 retrieving revision 1.4.6.2 diff -u -w -b -B -p -r1.4.6.1 -r1.4.6.2 --- rmdir.c 26 Jan 2004 16:27:48 -0000 1.4.6.1 +++ rmdir.c 26 Jan 2004 17:22:06 -0000 1.4.6.2 @@ -51,6 +51,7 @@ #include "inode.h" #include "fs.h" #include "mount.h" +#include "sysio-symbols.h" int rmdir(const char *path) @@ -86,3 +88,8 @@ out: SYSIO_LEAVE; return err; } + +#ifdef REDSTORM +#undef __rmdir +sysio_sym_weak_alias(rmdir, __rmdir) +#endif Index: stat.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/stat.c,v retrieving revision 1.7.6.1 retrieving revision 1.7.6.2 diff -u -w -b -B -p -r1.7.6.1 -r1.7.6.2 --- stat.c 26 Jan 2004 16:27:48 -0000 1.7.6.1 +++ stat.c 26 Jan 2004 17:22:06 -0000 1.7.6.2 @@ -99,6 +99,11 @@ __fxstat(int __ver, int __fildes, struct if (__ver != _STAT_VER) { err = -ENOSYS; +#ifdef REDSTORM +#undef _fxstat +sysio_sym_weak_alias(__fxstat, _fxstat) +#endif + goto out; } @@ -140,7 +145,7 @@ __fstat(int fd, struct stat *buf) sysio_sym_weak_alias(__fstat, fstat) -#if defined(BSD) || defined(REDSTORM) +#ifdef BSD #undef _fstat sysio_sym_weak_alias(__fstat, _fstat) #endif @@ -176,6 +181,11 @@ __xstat(int __ver, const char *__filenam ino->i_ops.inop_getattr(pno, pno->p_base->pb_ino, buf); +#ifdef REDSTORM +#undef _xstat +sysio_sym_weak_alias(__xstat, _xstat) +#endif + P_RELE(pno); #if _LARGEFILE64_SOURCE convstat(buf, __stat_buf); @@ -202,7 +212,7 @@ __stat(const char *filename, struct stat sysio_sym_weak_alias(__stat, stat) -#if defined(BSD) || defined(REDSTORM) +#ifdef BSD #undef _stat sysio_sym_weak_alias(__stat, _stat) #endif @@ -238,6 +248,11 @@ __lxstat(int __ver, const char *__filena ino->i_ops.inop_getattr(pno, pno->p_base->pb_ino, buf); +#ifdef REDSTORM +#undef _lxstat +sysio_sym_weak_alias(__lxstat, _lxstat) +#endif + P_RELE(pno); #if _LARGEFILE64_SOURCE convstat(buf, __stat_buf); @@ -264,7 +279,7 @@ __lstat(const char *filename, struct sta sysio_sym_weak_alias(__lstat, lstat) -#if defined(BSD) || defined(REDSTORM) +#ifdef BSD #undef _lstat sysio_sym_weak_alias(__lstat, _lstat) #endif Index: statvfs.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/statvfs.c,v retrieving revision 1.4.6.1 retrieving revision 1.4.6.2 diff -u -w -b -B -p -r1.4.6.1 -r1.4.6.2 --- statvfs.c 26 Jan 2004 16:27:48 -0000 1.4.6.1 +++ statvfs.c 26 Jan 2004 17:22:06 -0000 1.4.6.2 @@ -43,7 +43,7 @@ #ifdef _HAVE_STATVFS -#if !(defined(BSD) || defined(REDSTORM)) +#ifndef BSD #include <unistd.h> #include <errno.h> @@ -55,6 +55,7 @@ #include "sysio.h" #include "inode.h" #include "file.h" +#include "sysio-symbols.h" #undef statvfs #undef fstatvfs @@ -108,6 +109,11 @@ err: out: SYSIO_LEAVE; return err; +#ifdef REDSTORM +#undef __statvfs +sysio_sym_weak_alias(statvfs, __statvfs) +#endif + } int @@ -144,5 +150,11 @@ out: SYSIO_LEAVE; return err; } -#endif /* if !(defined(BSD) || defined(REDSTORM)) */ + +#ifdef REDSTORM +#undef __fstatvfs +sysio_sym_weak_alias(fstatvfs, __fstatvfs) +#endif + +#endif /* ifndef BSD */ #endif /* defined(_HAVE_STATVFS) */ Index: statvfs64.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/statvfs64.c,v retrieving revision 1.5.6.1 retrieving revision 1.5.6.2 diff -u -w -b -B -p -r1.5.6.1 -r1.5.6.2 --- statvfs64.c 26 Jan 2004 16:27:48 -0000 1.5.6.1 +++ statvfs64.c 26 Jan 2004 17:22:06 -0000 1.5.6.2 @@ -43,7 +43,7 @@ #ifdef _HAVE_STATVFS -#if !(defined(BSD) || defined(REDSTORM)) +#ifndef BSD #include <unistd.h> #include <errno.h> #include <assert.h> @@ -54,6 +54,7 @@ #include "sysio.h" #include "inode.h" #include "file.h" +#include "sysio-symbols.h" int statvfs64(const char *path, struct statvfs64 *buf) @@ -78,6 +79,11 @@ out: return err; } +#ifdef REDSTORM +#undef __statvfs64 +sysio_sym_weak_alias(statvfs64, __statvfs64) +#endif + int fstatvfs64(int fd, struct statvfs64 *buf) { @@ -102,5 +108,11 @@ out: SYSIO_LEAVE; return err; } -#endif /* if !(defined(BSD) || defined(REDSTORM)) */ + +#ifdef REDSTORM +#undef __fstatvfs64 +sysio_sym_weak_alias(fstatvfs64, __fstatvfs64) +#endif + +#endif /* ifndef BSD */ #endif /* define(_HAVE_STATVFS) */ Index: symlink.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/symlink.c,v retrieving revision 1.3.16.1 retrieving revision 1.3.16.2 diff -u -w -b -B -p -r1.3.16.1 -r1.3.16.2 --- symlink.c 26 Jan 2004 16:27:48 -0000 1.3.16.1 +++ symlink.c 26 Jan 2004 17:22:06 -0000 1.3.16.2 @@ -51,6 +51,7 @@ #include "inode.h" #include "fs.h" #include "mount.h" +#include "sysio-symbols.h" int symlink(const char *oldpath, const char *newpath) @@ -85,3 +86,8 @@ out: SYSIO_LEAVE; return err; } + +#ifdef REDSTORM +#undef __symlink +sysio_sym_weak_alias(symlink, __symlink) +#endif Index: unlink.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/unlink.c,v retrieving revision 1.5.6.1 retrieving revision 1.5.6.2 diff -u -w -b -B -p -r1.5.6.1 -r1.5.6.2 --- unlink.c 26 Jan 2004 16:27:48 -0000 1.5.6.1 +++ unlink.c 26 Jan 2004 17:22:06 -0000 1.5.6.2 @@ -51,6 +51,7 @@ #include "inode.h" #include "fs.h" #include "mount.h" +#include "sysio-symbols.h" int unlink(const char *path) @@ -86,3 +87,8 @@ out: SYSIO_LEAVE; return err; } + +#ifdef REDSTORM +#undef __unlink +sysio_sym_weak_alias(unlink, __unlink) +#endif |