diff --git a/lib/librumpuser/rumpuser.c b/lib/librumpuser/rumpuser.c index 96cc91803701..06387ffbe7f1 100644 --- a/lib/librumpuser/rumpuser.c +++ b/lib/librumpuser/rumpuser.c @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser.c,v 1.38 2013/04/29 12:56:04 pooka Exp $ */ +/* $NetBSD: rumpuser.c,v 1.39 2013/04/29 13:19:11 pooka Exp $ */ /* * Copyright (c) 2007-2010 Antti Kantee. All Rights Reserved. @@ -28,7 +28,7 @@ #include "rumpuser_port.h" #if !defined(lint) -__RCSID("$NetBSD: rumpuser.c,v 1.38 2013/04/29 12:56:04 pooka Exp $"); +__RCSID("$NetBSD: rumpuser.c,v 1.39 2013/04/29 13:19:11 pooka Exp $"); #endif /* !lint */ #include @@ -282,53 +282,6 @@ rumpuser_unmap(void *addr, size_t len) assert(rv == 0); } -void * -rumpuser_filemmap(int fd, off_t offset, size_t len, int flags, int *error) -{ - void *rv; - int mmflags, prot; - - if (flags & RUMPUSER_FILEMMAP_TRUNCATE) { - if (ftruncate(fd, offset + len) == -1) { - seterror(errno); - return NULL; - } - } - -/* it's implicit */ -#if defined(__sun__) && !defined(MAP_FILE) -#define MAP_FILE 0 -#endif - - mmflags = MAP_FILE; - if (flags & RUMPUSER_FILEMMAP_SHARED) - mmflags |= MAP_SHARED; - else - mmflags |= MAP_PRIVATE; - - prot = 0; - if (flags & RUMPUSER_FILEMMAP_READ) - prot |= PROT_READ; - if (flags & RUMPUSER_FILEMMAP_WRITE) - prot |= PROT_WRITE; - - rv = mmap(NULL, len, PROT_READ|PROT_WRITE, mmflags, fd, offset); - if (rv == MAP_FAILED) { - seterror(errno); - return NULL; - } - - seterror(0); - return rv; -} - -int -rumpuser_memsync(void *addr, size_t len, int *error) -{ - - DOCALL_KLOCK(int, (msync(addr, len, MS_SYNC))); -} - int rumpuser_open(const char *path, int ruflags, int *error) { diff --git a/sys/rump/include/rump/rumpuser.h b/sys/rump/include/rump/rumpuser.h index c9c6a2c723c1..f9c6d7e51f0a 100644 --- a/sys/rump/include/rump/rumpuser.h +++ b/sys/rump/include/rump/rumpuser.h @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser.h,v 1.89 2013/04/29 12:56:03 pooka Exp $ */ +/* $NetBSD: rumpuser.h,v 1.90 2013/04/29 13:19:11 pooka Exp $ */ /* * Copyright (c) 2007-2013 Antti Kantee. All Rights Reserved. @@ -57,13 +57,7 @@ void *rumpuser_malloc(size_t, int); void rumpuser_free(void *, size_t); void *rumpuser_anonmmap(void *, size_t, int, int, int *); -#define RUMPUSER_FILEMMAP_READ 0x01 -#define RUMPUSER_FILEMMAP_WRITE 0x02 -#define RUMPUSER_FILEMMAP_TRUNCATE 0x04 -#define RUMPUSER_FILEMMAP_SHARED 0x08 -void *rumpuser_filemmap(int fd, off_t, size_t, int, int *); void rumpuser_unmap(void *, size_t); -int rumpuser_memsync(void *, size_t, int *); #define RUMPUSER_OPEN_RDONLY 0x0000 #define RUMPUSER_OPEN_WRONLY 0x0001