[Libsysio-commit] gmdev: libsysio/src mmap.c dev.c inode.c ioctl.c module.mk
Brought to you by:
lward
|
From: Ruth K. <rk...@us...> - 2004-03-04 18:29:29
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3889/src Modified Files: Tag: gmdev dev.c inode.c ioctl.c module.mk Added Files: Tag: gmdev mmap.c Log Message: The gmdev branch records what is currently sitting in the Cplant repository. Changes to fs_yod.c also make it compatible with the strided-io mods. --- NEW FILE --- /* * This Cplant(TM) source code is the property of Sandia National * Laboratories. * * This Cplant(TM) source code is copyrighted by Sandia National * Laboratories. * * The redistribution of this Cplant(TM) source code is subject to the * terms of the GNU Lesser General Public License * (see cit/LGPL or http://www.gnu.org/licenses/lgpl.html) * * Cplant(TM) Copyright 1998-2003 Sandia Corporation. * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive * license for use of this work by or on behalf of the US Government. * Export of this program may require a license from the United States * Government. */ /* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Questions or comments about this library should be sent to: * * Lee Ward * Sandia National Laboratories, New Mexico * P.O. Box 5800 * Albuquerque, NM 87185-1110 * * le...@sa... */ #include <unistd.h> #include <errno.h> #include <sys/types.h> #include <fcntl.h> #include <sys/queue.h> #include "sysio.h" #include "inode.h" #include "file.h" #include "sysio-symbols.h" void * mmap(void *start, size_t length, int prot, int flags, int fd, _SYSIO_OFF_T offset) { void *loc; struct file *fil; SYSIO_ENTER; fil = _sysio_fd_find(fd); if (!fil) { errno = EBADF; SYSIO_LEAVE; return (void *)-1; } loc = fil->f_ino->i_ops.inop_mmap(fil->f_ino, start, length, prot, flags, offset); SYSIO_LEAVE; return loc; } #if 0 #ifdef __GLIBC__ #undef __mmap sysio_sym_weak_alias(mmap, __mmap) #endif #ifdef BSD #undef _mmap sysio_sym_weak_alias(mmap, _mmap) #endif #endif Index: dev.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/dev.c,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -w -b -B -p -r1.6 -r1.6.2.1 --- dev.c 6 Feb 2004 20:07:30 -0000 1.6 +++ dev.c 4 Mar 2004 18:08:07 -0000 1.6.2.1 @@ -74,6 +74,7 @@ const struct inode_ops _sysio_nodev_ops _sysio_nodev_inop_datasync, _sysio_nodev_inop_ioctl, _sysio_nodev_inop_mknod, + _sysio_nodev_inop_mmap, #ifdef _HAVE_STATVFS _sysio_nodev_inop_statvfs, #endif Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.14 retrieving revision 1.14.2.1 diff -u -w -b -B -p -r1.14 -r1.14.2.1 --- inode.c 24 Feb 2004 14:58:26 -0000 1.14 +++ inode.c 4 Mar 2004 18:08:07 -0000 1.14.2.1 @@ -255,6 +255,7 @@ _sysio_i_new(struct filesys *fs, operations.inop_iodone = o->inop_iodone; operations.inop_datasync = o->inop_datasync; operations.inop_ioctl = o->inop_ioctl; + operations.inop_mmap = o->inop_mmap; } I_INIT(ino, fs, type, rdev, &operations, fid, immunity, private); ino->i_ref = 1; Index: ioctl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctl.c,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -w -b -B -p -r1.6 -r1.6.2.1 --- ioctl.c 26 Jan 2004 16:34:54 -0000 1.6 +++ ioctl.c 4 Mar 2004 18:08:07 -0000 1.6.2.1 @@ -72,7 +72,7 @@ ioctl(int fd, unsigned long request, ... va_end(ap); out: - if (err) { + if (err < 0) { errno = -err; err = -1; } Index: module.mk =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/module.mk,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -w -b -B -p -r1.3 -r1.3.2.1 --- module.mk 24 Feb 2004 14:58:26 -0000 1.3 +++ module.mk 4 Mar 2004 18:08:07 -0000 1.3.2.1 @@ -8,7 +8,7 @@ SRCDIR_SRCS = src/access.c src/chdir.c s src/getdirentries.c src/init.c src/inode.c \ src/ioctl.c src/ioctx.c src/iowait.c \ src/link.c src/lseek.c src/mkdir.c \ - src/mknod.c src/mount.c src/namei.c \ + src/mknod.c src/mount.c src/mmap.c src/namei.c \ src/open.c src/rw.c src/rename.c \ src/rmdir.c src/stat64.c src/stat.c \ src/symlink.c \ |