xref: /freebsd-13-stable/sys/compat/linux/linux_dummy.c (revision 3bc80996974a61a4223eae4c1ccd47b6ee32a48a)
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause
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 #include <sys/param.h>
30 #include <sys/systm.h>
31 #include <sys/sdt.h>
32 #include <sys/proc.h>
33 
34 /*
35  * Including linux vs linux32 here is arbitrary -- the syscall args structures
36  * (proto.h) are not dereferenced by the DUMMY stub implementations, and
37  * suitable for use by both native and compat32 entrypoints.
38  */
39 #include <machine/../linux/linux.h>
40 #include <machine/../linux/linux_proto.h>
41 
42 #include <compat/linux/linux_dtrace.h>
43 #include <compat/linux/linux_util.h>
44 
45 /* DTrace init */
46 LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE);
47 
48 UNIMPLEMENTED(afs_syscall);
49 UNIMPLEMENTED(create_module);	/* Added in Linux 1.0 removed in 2.6. */
50 UNIMPLEMENTED(epoll_ctl_old);
51 UNIMPLEMENTED(epoll_wait_old);
52 UNIMPLEMENTED(get_kernel_syms);	/* Added in Linux 1.0 removed in 2.6. */
53 UNIMPLEMENTED(getpmsg);
54 UNIMPLEMENTED(nfsservctl);	/* Added in Linux 2.2 removed in 3.1. */
55 UNIMPLEMENTED(putpmsg);
56 UNIMPLEMENTED(query_module);	/* Added in Linux 2.2 removed in 2.6. */
57 UNIMPLEMENTED(security);
58 UNIMPLEMENTED(vserver);
59 
60 DUMMY(setfsuid);
61 DUMMY(setfsgid);
62 DUMMY(vhangup);
63 DUMMY(pivot_root);
64 DUMMY(adjtimex);
65 DUMMY(swapoff);
66 DUMMY(init_module);
67 DUMMY(delete_module);
68 DUMMY(lookup_dcookie);
69 DUMMY(remap_file_pages);
70 DUMMY(mbind);
71 DUMMY(get_mempolicy);
72 DUMMY(set_mempolicy);
73 DUMMY(kexec_load);
74 /* Linux 2.6.11: */
75 DUMMY(add_key);
76 DUMMY(request_key);
77 DUMMY(keyctl);
78 /* Linux 2.6.13: */
79 DUMMY(ioprio_set);
80 DUMMY(ioprio_get);
81 DUMMY(inotify_add_watch);
82 DUMMY(inotify_rm_watch);
83 /* Linux 2.6.16: */
84 DUMMY(migrate_pages);
85 DUMMY(unshare);
86 /* Linux 2.6.17: */
87 DUMMY(tee);
88 DUMMY(vmsplice);
89 /* Linux 2.6.18: */
90 DUMMY(move_pages);
91 /* Linux 2.6.27: */
92 DUMMY(signalfd4);
93 DUMMY(inotify_init1);
94 /* Linux 2.6.31: */
95 DUMMY(perf_event_open);
96 /* Linux 2.6.36: */
97 DUMMY(fanotify_init);
98 DUMMY(fanotify_mark);
99 /* Linux 2.6.39: */
100 DUMMY(clock_adjtime);
101 /* Linux 3.0: */
102 DUMMY(setns);
103 /* Linux 3.2: */
104 DUMMY(process_vm_readv);
105 DUMMY(process_vm_writev);
106 /* Linux 3.5: */
107 DUMMY(kcmp);
108 /* Linux 3.8: */
109 DUMMY(finit_module);
110 DUMMY(sched_setattr);
111 DUMMY(sched_getattr);
112 /* Linux 3.18: */
113 DUMMY(bpf);
114 /* Linux 3.19: */
115 DUMMY(execveat);
116 /* Linux 4.2: */
117 DUMMY(userfaultfd);
118 /* Linux 4.3: */
119 DUMMY(membarrier);
120 /* Linux 4.4: */
121 DUMMY(mlock2);
122 /* Linux 4.6: */
123 DUMMY(preadv2);
124 DUMMY(pwritev2);
125 /* Linux 4.8: */
126 DUMMY(pkey_mprotect);
127 DUMMY(pkey_alloc);
128 DUMMY(pkey_free);
129 DUMMY(open_tree);
130 DUMMY(move_mount);
131 DUMMY(fsopen);
132 DUMMY(fsconfig);
133 DUMMY(fsmount);
134 DUMMY(fspick);
135 DUMMY(pidfd_open);
136 DUMMY(openat2);
137 DUMMY(pidfd_getfd);
138 DUMMY(process_madvise);
139 DUMMY(mount_setattr);
140 /* Linux 4.18: */
141 DUMMY(io_pgetevents);
142 /* Linux 5.0: */
143 DUMMY(pidfd_send_signal);
144 DUMMY(io_uring_setup);
145 DUMMY(io_uring_enter);
146 DUMMY(io_uring_register);
147 
148 #define DUMMY_XATTR(s)						\
149 int								\
150 linux_ ## s ## xattr(						\
151     struct thread *td, struct linux_ ## s ## xattr_args *arg)	\
152 {								\
153 								\
154 	return (EOPNOTSUPP);					\
155 }
156 DUMMY_XATTR(set);
157 DUMMY_XATTR(lset);
158 DUMMY_XATTR(fset);
159 DUMMY_XATTR(get);
160 DUMMY_XATTR(lget);
161 DUMMY_XATTR(fget);
162 DUMMY_XATTR(list);
163 DUMMY_XATTR(llist);
164 DUMMY_XATTR(flist);
165 DUMMY_XATTR(remove);
166 DUMMY_XATTR(lremove);
167 DUMMY_XATTR(fremove);
168