xref: /minix3/lib/libc/compat/sys/compat_msync.c (revision f14fb602092e015ff630df58e17c2a9cd57d29b3)
1*f14fb602SLionel Sambuc /*	$NetBSD: compat_msync.c,v 1.2 2012/03/20 17:06:00 matt Exp $	*/
22fe8fb19SBen Gras 
32fe8fb19SBen Gras /*
42fe8fb19SBen Gras  * Copyright (c) 1997 Frank van der Linden
52fe8fb19SBen Gras  * All rights reserved.
62fe8fb19SBen Gras  *
72fe8fb19SBen Gras  * Redistribution and use in source and binary forms, with or without
82fe8fb19SBen Gras  * modification, are permitted provided that the following conditions
92fe8fb19SBen Gras  * are met:
102fe8fb19SBen Gras  * 1. Redistributions of source code must retain the above copyright
112fe8fb19SBen Gras  *    notice, this list of conditions and the following disclaimer.
122fe8fb19SBen Gras  * 2. Redistributions in binary form must reproduce the above copyright
132fe8fb19SBen Gras  *    notice, this list of conditions and the following disclaimer in the
142fe8fb19SBen Gras  *    documentation and/or other materials provided with the distribution.
152fe8fb19SBen Gras  * 3. All advertising materials mentioning features or use of this software
162fe8fb19SBen Gras  *    must display the following acknowledgement:
172fe8fb19SBen Gras  *      This product includes software developed for the NetBSD Project
182fe8fb19SBen Gras  *      by Frank van der Linden
192fe8fb19SBen Gras  * 4. The name of the author may not be used to endorse or promote products
202fe8fb19SBen Gras  *    derived from this software without specific prior written permission
212fe8fb19SBen Gras  *
222fe8fb19SBen Gras  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
232fe8fb19SBen Gras  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
242fe8fb19SBen Gras  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
252fe8fb19SBen Gras  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
262fe8fb19SBen Gras  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
272fe8fb19SBen Gras  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
282fe8fb19SBen Gras  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
292fe8fb19SBen Gras  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
302fe8fb19SBen Gras  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
312fe8fb19SBen Gras  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
322fe8fb19SBen Gras  */
332fe8fb19SBen Gras 
342fe8fb19SBen Gras #include <sys/cdefs.h>
352fe8fb19SBen Gras #if defined(LIBC_SCCS) && !defined(lint)
36*f14fb602SLionel Sambuc __RCSID("$NetBSD: compat_msync.c,v 1.2 2012/03/20 17:06:00 matt Exp $");
372fe8fb19SBen Gras #endif /* LIBC_SCCS and not lint */
382fe8fb19SBen Gras 
392fe8fb19SBen Gras #define __LIBC12_SOURCE__
402fe8fb19SBen Gras 
412fe8fb19SBen Gras #include <sys/types.h>
422fe8fb19SBen Gras #include <sys/mman.h>
432fe8fb19SBen Gras #include <compat/sys/mman.h>
442fe8fb19SBen Gras 
452fe8fb19SBen Gras __warn_references(msync,
462fe8fb19SBen Gras     "warning: reference to compatibility msync(); include <sys/mman.h> for correct reference")
472fe8fb19SBen Gras 
482fe8fb19SBen Gras int
msync(void * addr,size_t size)49*f14fb602SLionel Sambuc msync(void *addr, size_t size)
502fe8fb19SBen Gras {
512fe8fb19SBen Gras 	return __msync13(addr, size, MS_SYNC|MS_INVALIDATE);
522fe8fb19SBen Gras }
53