xref: /netbsd-src/sys/compat/freebsd/freebsd_misc.c (revision 76dfffe33547c37f8bdd446e3e4ab0f3c16cea4b)
1 /*	$NetBSD: freebsd_misc.c,v 1.2 1996/05/03 17:03:10 christos Exp $	*/
2 
3 /*
4  * Copyright (c) 1995 Frank van der Linden
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  * 3. All advertising materials mentioning features or use of this software
16  *    must display the following acknowledgement:
17  *      This product includes software developed for the NetBSD Project
18  *      by Frank van der Linden
19  * 4. The name of the author may not be used to endorse or promote products
20  *    derived from this software without specific prior written permission
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33 
34 /*
35  * FreeBSD compatibility module. Try to deal with various FreeBSD system calls.
36  */
37 
38 #include <sys/param.h>
39 #include <sys/systm.h>
40 #include <sys/proc.h>
41 #include <sys/mount.h>
42 
43 #include <sys/syscallargs.h>
44 
45 #include <compat/freebsd/freebsd_syscallargs.h>
46 #include <compat/freebsd/freebsd_util.h>
47 #include <compat/freebsd/freebsd_rtprio.h>
48 #include <compat/freebsd/freebsd_timex.h>
49 
50 int
51 freebsd_sys_msync(p, v, retval)
52 	struct proc *p;
53 	void *v;
54 	register_t *retval;
55 {
56 	struct freebsd_sys_msync_args /* {
57 		syscallarg(caddr_t) addr;
58 		syscallarg(size_t) len;
59 		syscallarg(int) flags;
60 	} */ *uap = v;
61 	struct sys_msync_args bma;
62 
63 	/*
64 	 * FreeBSD-2.0-RELEASE's msync(2) is compatible with NetBSD's.
65 	 * FreeBSD-2.0.5-RELEASE's msync(2) has addtional argument `flags',
66 	 * but syscall number is not changed. :-<
67 	 */
68 	SCARG(&bma, addr) = SCARG(uap, addr);
69 	SCARG(&bma, len) = SCARG(uap, len);
70 	return sys_msync(p, &bma, retval); /* XXX - simply ignores `flags' */
71 }
72 
73 /* just a place holder */
74 
75 int
76 freebsd_sys_rtprio(p, v, retval)
77 	struct proc *p;
78 	void *v;
79 	register_t *retval;
80 {
81 #ifdef notyet
82 	struct freebsd_sys_rtprio_args /* {
83 		syscallarg(int) function;
84 		syscallarg(pid_t) pid;
85 		syscallarg(struct freebsd_rtprio *) rtp;
86 	} */ *uap = v;
87 #endif
88 
89 	return ENOSYS;	/* XXX */
90 }
91 
92 int
93 freebsd_ntp_adjtime(p, v, retval)
94 	struct proc *p;
95 	void *v;
96 	register_t *retval;
97 {
98 #ifdef notyet
99 	struct freebsd_ntp_adjtime_args /* {
100 		syscallarg(struct freebsd_timex *) tp;
101 	} */ *uap = v;
102 #endif
103 
104 	return ENOSYS;	/* XXX */
105 }
106