xref: /freebsd/sys/compat/linux/linux_dummy.c (revision 3cbb4cc200f8a0ad7ed08233425ea54524a21f1c)
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3  *
4  * Copyright (c) 2013 Dmitry Chagin
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  *
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26  * SUCH DAMAGE.
27  */
28 
29 #include <sys/cdefs.h>
30 __FBSDID("$FreeBSD$");
31 
32 #include <sys/param.h>
33 #include <sys/kernel.h>
34 #include <sys/sdt.h>
35 #include <sys/systm.h>
36 #include <sys/proc.h>
37 
38 /*
39  * Including linux vs linux32 here is arbitrary -- the syscall args structures
40  * (proto.h) are not dereferenced by the DUMMY stub implementations, and
41  * suitable for use by both native and compat32 entrypoints.
42  */
43 #include <machine/../linux/linux.h>
44 #include <machine/../linux/linux_proto.h>
45 
46 #include <compat/linux/linux_dtrace.h>
47 #include <compat/linux/linux_util.h>
48 
49 /* DTrace init */
50 LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE);
51 
52 UNIMPLEMENTED(afs_syscall);
53 UNIMPLEMENTED(create_module);	/* Added in Linux 1.0 removed in 2.6. */
54 UNIMPLEMENTED(epoll_ctl_old);
55 UNIMPLEMENTED(epoll_wait_old);
56 UNIMPLEMENTED(get_kernel_syms);	/* Added in Linux 1.0 removed in 2.6. */
57 UNIMPLEMENTED(getpmsg);
58 UNIMPLEMENTED(nfsservctl);	/* Added in Linux 2.2 removed in 3.1. */
59 UNIMPLEMENTED(putpmsg);
60 UNIMPLEMENTED(query_module);	/* Added in Linux 2.2 removed in 2.6. */
61 UNIMPLEMENTED(security);
62 UNIMPLEMENTED(vserver);
63 
64 DUMMY(setfsuid);
65 DUMMY(setfsgid);
66 DUMMY(vhangup);
67 DUMMY(pivot_root);
68 DUMMY(adjtimex);
69 DUMMY(swapoff);
70 DUMMY(init_module);
71 DUMMY(delete_module);
72 DUMMY(lookup_dcookie);
73 DUMMY(remap_file_pages);
74 DUMMY(mbind);
75 DUMMY(get_mempolicy);
76 DUMMY(set_mempolicy);
77 DUMMY(kexec_load);
78 /* Linux 2.6.11: */
79 DUMMY(add_key);
80 DUMMY(request_key);
81 DUMMY(keyctl);
82 /* Linux 2.6.13: */
83 DUMMY(ioprio_set);
84 DUMMY(ioprio_get);
85 DUMMY(inotify_add_watch);
86 DUMMY(inotify_rm_watch);
87 /* Linux 2.6.16: */
88 DUMMY(migrate_pages);
89 DUMMY(unshare);
90 /* Linux 2.6.17: */
91 DUMMY(tee);
92 DUMMY(vmsplice);
93 /* Linux 2.6.18: */
94 DUMMY(move_pages);
95 /* Linux 2.6.27: */
96 DUMMY(signalfd4);
97 DUMMY(inotify_init1);
98 /* Linux 2.6.31: */
99 DUMMY(perf_event_open);
100 /* Linux 2.6.36: */
101 DUMMY(fanotify_init);
102 DUMMY(fanotify_mark);
103 /* Linux 2.6.39: */
104 DUMMY(name_to_handle_at);
105 DUMMY(open_by_handle_at);
106 DUMMY(clock_adjtime);
107 /* Linux 3.0: */
108 DUMMY(setns);
109 /* Linux 3.2: */
110 DUMMY(process_vm_readv);
111 DUMMY(process_vm_writev);
112 /* Linux 3.5: */
113 DUMMY(kcmp);
114 /* Linux 3.8: */
115 DUMMY(finit_module);
116 DUMMY(sched_setattr);
117 DUMMY(sched_getattr);
118 /* Linux 3.17: */
119 DUMMY(seccomp);
120 /* Linux 3.18: */
121 DUMMY(bpf);
122 /* Linux 3.19: */
123 DUMMY(execveat);
124 /* Linux 4.2: */
125 DUMMY(userfaultfd);
126 /* Linux 4.3: */
127 DUMMY(membarrier);
128 /* Linux 4.4: */
129 DUMMY(mlock2);
130 /* Linux 4.6: */
131 DUMMY(preadv2);
132 DUMMY(pwritev2);
133 /* Linux 4.8: */
134 DUMMY(pkey_mprotect);
135 DUMMY(pkey_alloc);
136 DUMMY(pkey_free);
137 
138 #define DUMMY_XATTR(s)						\
139 int								\
140 linux_ ## s ## xattr(						\
141     struct thread *td, struct linux_ ## s ## xattr_args *arg)	\
142 {								\
143 								\
144 	return (EOPNOTSUPP);					\
145 }
146 DUMMY_XATTR(set);
147 DUMMY_XATTR(lset);
148 DUMMY_XATTR(fset);
149 DUMMY_XATTR(get);
150 DUMMY_XATTR(lget);
151 DUMMY_XATTR(fget);
152 DUMMY_XATTR(list);
153 DUMMY_XATTR(llist);
154 DUMMY_XATTR(flist);
155 DUMMY_XATTR(remove);
156 DUMMY_XATTR(lremove);
157 DUMMY_XATTR(fremove);
158