]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/amd64/linux/linux_dummy.c
Add a trivial linux(4) splice(2) implementation, which simply
[FreeBSD/FreeBSD.git] / sys / amd64 / linux / linux_dummy.c
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 #include <amd64/linux/linux.h>
39 #include <amd64/linux/linux_proto.h>
40 #include <compat/linux/linux_dtrace.h>
41 #include <compat/linux/linux_util.h>
42
43 /* DTrace init */
44 LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE);
45
46 UNIMPLEMENTED(afs_syscall);
47 UNIMPLEMENTED(create_module);   /* Added in Linux 1.0 removed in 2.6. */
48 UNIMPLEMENTED(epoll_ctl_old);
49 UNIMPLEMENTED(epoll_wait_old);
50 UNIMPLEMENTED(get_kernel_syms); /* Added in Linux 1.0 removed in 2.6. */
51 UNIMPLEMENTED(get_thread_area);
52 UNIMPLEMENTED(getpmsg);
53 UNIMPLEMENTED(nfsservctl);      /* Added in Linux 2.2 removed in 3.1. */
54 UNIMPLEMENTED(putpmsg);
55 UNIMPLEMENTED(query_module);    /* Added in Linux 2.2 removed in 2.6. */
56 UNIMPLEMENTED(tuxcall);
57 UNIMPLEMENTED(security);
58 UNIMPLEMENTED(set_thread_area);
59 UNIMPLEMENTED(uselib);
60 UNIMPLEMENTED(vserver);
61
62 DUMMY(setfsuid);
63 DUMMY(setfsgid);
64 DUMMY(sysfs);
65 DUMMY(vhangup);
66 DUMMY(modify_ldt);
67 DUMMY(pivot_root);
68 DUMMY(adjtimex);
69 DUMMY(swapoff);
70 DUMMY(init_module);
71 DUMMY(ioperm);
72 DUMMY(delete_module);
73 DUMMY(quotactl);
74 DUMMY(readahead);
75 DUMMY(io_setup);
76 DUMMY(io_destroy);
77 DUMMY(io_getevents);
78 DUMMY(io_submit);
79 DUMMY(io_cancel);
80 DUMMY(lookup_dcookie);
81 DUMMY(remap_file_pages);
82 DUMMY(restart_syscall);
83 DUMMY(semtimedop);
84 DUMMY(mbind);
85 DUMMY(get_mempolicy);
86 DUMMY(set_mempolicy);
87 DUMMY(mq_open);
88 DUMMY(mq_unlink);
89 DUMMY(mq_timedsend);
90 DUMMY(mq_timedreceive);
91 DUMMY(mq_notify);
92 DUMMY(mq_getsetattr);
93 DUMMY(kexec_load);
94 /* Linux 2.6.11: */
95 DUMMY(add_key);
96 DUMMY(request_key);
97 DUMMY(keyctl);
98 /* Linux 2.6.13: */
99 DUMMY(ioprio_set);
100 DUMMY(ioprio_get);
101 DUMMY(inotify_init);
102 DUMMY(inotify_add_watch);
103 DUMMY(inotify_rm_watch);
104 /* Linux 2.6.16: */
105 DUMMY(migrate_pages);
106 DUMMY(unshare);
107 /* Linux 2.6.17: */
108 DUMMY(tee);
109 DUMMY(vmsplice);
110 /* Linux 2.6.18: */
111 DUMMY(move_pages);
112 /* Linux 2.6.22: */
113 DUMMY(signalfd);
114 /* Linux 2.6.27: */
115 DUMMY(signalfd4);
116 DUMMY(inotify_init1);
117 /* Linux 2.6.31: */
118 DUMMY(perf_event_open);
119 /* Linux 2.6.36: */
120 DUMMY(fanotify_init);
121 DUMMY(fanotify_mark);
122 /* Linux 2.6.39: */
123 DUMMY(name_to_handle_at);
124 DUMMY(open_by_handle_at);
125 DUMMY(clock_adjtime);
126 /* Linux 3.0: */
127 DUMMY(setns);
128 /* Linux 3.2: */
129 DUMMY(process_vm_readv);
130 DUMMY(process_vm_writev);
131 /* Linux 3.5: */
132 DUMMY(kcmp);
133 /* Linux 3.8: */
134 DUMMY(finit_module);
135 DUMMY(sched_setattr);
136 DUMMY(sched_getattr);
137 /* Linux 3.15: */
138 DUMMY(kexec_file_load);
139 /* Linux 3.17: */
140 DUMMY(seccomp);
141 /* Linux 3.18: */
142 DUMMY(bpf);
143 /* Linux 3.19: */
144 DUMMY(execveat);
145 /* Linux 4.2: */
146 DUMMY(userfaultfd);
147 /* Linux 4.3: */
148 DUMMY(membarrier);
149 /* Linux 4.4: */
150 DUMMY(mlock2);
151 /* Linux 4.6: */
152 DUMMY(preadv2);
153 DUMMY(pwritev2);
154 /* Linux 4.8: */
155 DUMMY(pkey_mprotect);
156 DUMMY(pkey_alloc);
157 DUMMY(pkey_free);
158 /* Linux 4.11: */
159 DUMMY(statx);
160 /* Linux 4.18: */
161 DUMMY(io_pgetevents);
162 DUMMY(rseq);
163 /* Linux 5.0: */
164 DUMMY(pidfd_send_signal);
165 DUMMY(io_uring_setup);
166 DUMMY(io_uring_enter);
167 DUMMY(io_uring_register);
168
169 #define DUMMY_XATTR(s)                                          \
170 int                                                             \
171 linux_ ## s ## xattr(                                           \
172     struct thread *td, struct linux_ ## s ## xattr_args *arg)   \
173 {                                                               \
174                                                                 \
175         return (EOPNOTSUPP);                                    \
176 }
177 DUMMY_XATTR(set);
178 DUMMY_XATTR(lset);
179 DUMMY_XATTR(fset);
180 DUMMY_XATTR(get);
181 DUMMY_XATTR(lget);
182 DUMMY_XATTR(fget);
183 DUMMY_XATTR(list);
184 DUMMY_XATTR(llist);
185 DUMMY_XATTR(flist);
186 DUMMY_XATTR(remove);
187 DUMMY_XATTR(lremove);
188 DUMMY_XATTR(fremove);