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