11.2Smatt/* $NetBSD: compat_msync.c,v 1.2 2012/03/20 17:06:00 matt Exp $ */ 21.1Schristos 31.1Schristos/* 41.1Schristos * Copyright (c) 1997 Frank van der Linden 51.1Schristos * All rights reserved. 61.1Schristos * 71.1Schristos * Redistribution and use in source and binary forms, with or without 81.1Schristos * modification, are permitted provided that the following conditions 91.1Schristos * are met: 101.1Schristos * 1. Redistributions of source code must retain the above copyright 111.1Schristos * notice, this list of conditions and the following disclaimer. 121.1Schristos * 2. Redistributions in binary form must reproduce the above copyright 131.1Schristos * notice, this list of conditions and the following disclaimer in the 141.1Schristos * documentation and/or other materials provided with the distribution. 151.1Schristos * 3. All advertising materials mentioning features or use of this software 161.1Schristos * must display the following acknowledgement: 171.1Schristos * This product includes software developed for the NetBSD Project 181.1Schristos * by Frank van der Linden 191.1Schristos * 4. The name of the author may not be used to endorse or promote products 201.1Schristos * derived from this software without specific prior written permission 211.1Schristos * 221.1Schristos * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 231.1Schristos * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 241.1Schristos * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 251.1Schristos * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 261.1Schristos * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 271.1Schristos * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 281.1Schristos * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 291.1Schristos * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 301.1Schristos * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 311.1Schristos * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 321.1Schristos */ 331.1Schristos 341.1Schristos#include <sys/cdefs.h> 351.1Schristos#if defined(LIBC_SCCS) && !defined(lint) 361.2Smatt__RCSID("$NetBSD: compat_msync.c,v 1.2 2012/03/20 17:06:00 matt Exp $"); 371.1Schristos#endif /* LIBC_SCCS and not lint */ 381.1Schristos 391.1Schristos#define __LIBC12_SOURCE__ 401.1Schristos 411.1Schristos#include <sys/types.h> 421.1Schristos#include <sys/mman.h> 431.1Schristos#include <compat/sys/mman.h> 441.1Schristos 451.1Schristos__warn_references(msync, 461.1Schristos "warning: reference to compatibility msync(); include <sys/mman.h> for correct reference") 471.1Schristos 481.1Schristosint 491.2Smattmsync(void *addr, size_t size) 501.1Schristos{ 511.1Schristos return __msync13(addr, size, MS_SYNC|MS_INVALIDATE); 521.1Schristos} 53