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