/* $NetBSD: map.c,v 1.1.1.2 2003/06/30 17:52:07 wiz Exp $ */ /* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) This file is part of groff. groff is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. groff 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 General Public License for more details. You should have received a copy of the GNU General Public License along with groff; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #ifdef HAVE_CONFIG_H #include #endif #ifdef HAVE_MMAP #include #include /* The Net-2 man pages says that a MAP_FILE flag is required. */ #ifndef MAP_FILE #define MAP_FILE 0 #endif char *mapread(fd, nbytes) int fd; int nbytes; { char *p = (char *)mmap((caddr_t)0, (size_t)nbytes, PROT_READ, MAP_FILE|MAP_PRIVATE, fd, (off_t)0); if (p == (char *)-1) return 0; /* mmap() shouldn't return 0 since MAP_FIXED wasn't specified. */ if (p == 0) abort(); return p; } int unmap(p, len) char *p; int len; { return munmap((caddr_t)p, len); } #else /* not HAVE_MMAP */ #include char *mapread(fd, nbytes) int fd; int nbytes; { errno = ENODEV; return 0; } int unmap(p, len) char *p; int len; { errno = EINVAL; return -1; } #endif /* not HAVE_MMAP */ ' name='id' value='bb269a48a309936c70c6ae3cda17034d0ecbef46'/>
AgeCommit message (Expand)Author
2013-09-15Remove unused variablesmartin
2009-05-12struct device * -> device_t, no functional changes intended.cegger
2009-05-12struct cfdata * -> cfdata_t, no functional changes intended.cegger
2008-04-21Fix minor device_t split fallout.martin
2008-03-29Split softc and device_t for zsc(4) and its children.tsutsui
2007-07-09Merge some of the less invasive changes from the vmlocking branch:ad
2007-03-04Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.christos
2007-01-29Remove more duplicate headers.hubertf
2006-03-30Use device_private().thorpej
2006-03-29Use device_cfdata().thorpej
2006-03-28Use device_unit().thorpej
2005-12-11merge ktrace-lwp.christos
2005-11-27Overhaul how TTY line disciplines are handled:thorpej
2005-02-27nuke trailing whitespaceperry
2005-02-21GC SUNKBDDISC & SUNMSDISC line discipline slot definitions. Both are alreadyheas
2003-08-07Move UCB-licensed code from 4-clause to 3-clause licence.agc
2003-06-29Back out the lwp/ktrace changes. They contained a lot of colateral damage,fvdl
2003-06-29struct proc * -> struct lwp *martin
2003-05-30wsmouse for ms@tty.petrov
2003-01-19Merge the nathanw_sa branch.thorpej
2002-10-03Refactor kbd and mouse drivers so that they can use different middleuwe
2002-10-02Add trailing ; to CFATTACH_DECL.thorpej
2002-10-01Use CFATTACH_DECL().thorpej
2002-09-27Declare all cfattach structures const.thorpej
2002-09-06Merge the gehenna-devsw branch into the trunk.gehenna
2001-12-11Name changes: {KBD,MS}_BPS => {KBD,MS}_DEFAULT_BPSpk
2001-11-27When opening the mouse port, be sure to open it for 8 data bits.fredette
2001-11-13add RCSIDslukem
2001-05-17give sunkbd and sunms a "poll" routine.chs