]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/i386/linux/linux_dummy.c
Add a trivial linux(4) splice(2) implementation, which simply
[FreeBSD/FreeBSD.git] / sys / i386 / linux / linux_dummy.c
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3  *
4  * Copyright (c) 1994-1995 Søren Schmidt
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 <i386/linux/linux.h>
39 #include <i386/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(break);
48 UNIMPLEMENTED(create_module);   /* Added in Linux 1.0 removed in 2.6. */
49 UNIMPLEMENTED(ftime);
50 UNIMPLEMENTED(get_kernel_syms); /* Added in Linux 1.0 removed in 2.6. */
51 UNIMPLEMENTED(getpmsg);
52 UNIMPLEMENTED(gtty);
53 UNIMPLEMENTED(stty);
54 UNIMPLEMENTED(lock);
55 UNIMPLEMENTED(mpx);
56 UNIMPLEMENTED(nfsservctl);      /* Added in Linux 2.2 removed in 3.1. */
57 UNIMPLEMENTED(prof);
58 UNIMPLEMENTED(profil);
59 UNIMPLEMENTED(putpmsg);
60 UNIMPLEMENTED(query_module);    /* Added in Linux 2.2 removed in 2.6. */
61 UNIMPLEMENTED(ulimit);
62 UNIMPLEMENTED(vserver);
63
64 DUMMY(stime);
65 DUMMY(fstat);
66 DUMMY(olduname);
67 DUMMY(uname);
68 DUMMY(vhangup);
69 DUMMY(vm86old);
70 DUMMY(swapoff);
71 DUMMY(adjtimex);
72 DUMMY(init_module);
73 DUMMY(delete_module);
74 DUMMY(quotactl);
75 DUMMY(bdflush);
76 DUMMY(sysfs);
77 DUMMY(vm86);
78 DUMMY(setfsuid);
79 DUMMY(setfsgid);
80 DUMMY(pivot_root);
81 DUMMY(lookup_dcookie);
82 DUMMY(remap_file_pages);
83 DUMMY(mbind);
84 DUMMY(get_mempolicy);
85 DUMMY(set_mempolicy);
86 DUMMY(kexec_load);
87 /* Linux 2.6.11: */
88 DUMMY(add_key);
89 DUMMY(request_key);
90 DUMMY(keyctl);
91 /* Linux 2.6.13: */
92 DUMMY(ioprio_set);
93 DUMMY(ioprio_get);
94 DUMMY(inotify_init);
95 DUMMY(inotify_add_watch);
96 DUMMY(inotify_rm_watch);
97 /* Linux 2.6.16: */
98 DUMMY(migrate_pages);
99 DUMMY(unshare);
100 /* Linux 2.6.17: */
101 DUMMY(tee);
102 DUMMY(vmsplice);
103 /* Linux 2.6.18: */
104 DUMMY(move_pages);
105 /* Linux 2.6.22: */
106 DUMMY(signalfd);
107 /* Linux 2.6.27: */
108 DUMMY(signalfd4);
109 DUMMY(inotify_init1);
110 /* Linux 2.6.31: */
111 DUMMY(perf_event_open);
112 /* Linux 2.6.36: */
113 DUMMY(fanotify_init);
114 DUMMY(fanotify_mark);
115 /* Linux 2.6.39: */
116 DUMMY(name_to_handle_at);
117 DUMMY(open_by_handle_at);
118 DUMMY(clock_adjtime);
119 /* Linux 3.0: */
120 DUMMY(setns);
121 /* Linux 3.2: */
122 DUMMY(process_vm_readv);
123 DUMMY(process_vm_writev);
124 /* Linux 3.5: */
125 DUMMY(kcmp);
126 /* Linux 3.8: */
127 DUMMY(finit_module);
128 DUMMY(sched_setattr);
129 DUMMY(sched_getattr);
130 /* Linux 3.17: */
131 DUMMY(seccomp);
132 /* Linux 3.18: */
133 DUMMY(bpf);
134 /* Linux 3.19: */
135 DUMMY(execveat);
136 /* Linux 4.2: */
137 DUMMY(userfaultfd);
138 /* Linux 4.3: */
139 DUMMY(membarrier);
140 /* Linux 4.4: */
141 DUMMY(mlock2);
142 /* Linux 4.6: */
143 DUMMY(preadv2);
144 DUMMY(pwritev2);
145 /* Linux 4.8: */
146 DUMMY(pkey_mprotect);
147 DUMMY(pkey_alloc);
148 DUMMY(pkey_free);
149 /* Linux 4.11: */
150 DUMMY(statx);
151 DUMMY(arch_prctl);
152 /* Linux 4.18: */
153 DUMMY(io_pgetevents);
154 DUMMY(rseq);
155 /* Linux 5.0: */
156 DUMMY(clock_gettime64);
157 DUMMY(clock_settime64);
158 DUMMY(clock_adjtime64);
159 DUMMY(clock_getres_time64);
160 DUMMY(clock_nanosleep_time64);
161 DUMMY(timer_gettime64);
162 DUMMY(timer_settime64);
163 DUMMY(timerfd_gettime64);
164 DUMMY(timerfd_settime64);
165 DUMMY(utimensat_time64);
166 DUMMY(pselect6_time64);
167 DUMMY(ppoll_time64);
168 DUMMY(io_pgetevents_time64);
169 DUMMY(recvmmsg_time64);
170 DUMMY(mq_timedsend_time64);
171 DUMMY(mq_timedreceive_time64);
172 DUMMY(semtimedop_time64);
173 DUMMY(rt_sigtimedwait_time64);
174 DUMMY(futex_time64);
175 DUMMY(sched_rr_get_interval_time64);
176 DUMMY(pidfd_send_signal);
177 DUMMY(io_uring_setup);
178 DUMMY(io_uring_enter);
179 DUMMY(io_uring_register);
180
181 #define DUMMY_XATTR(s)                                          \
182 int                                                             \
183 linux_ ## s ## xattr(                                           \
184     struct thread *td, struct linux_ ## s ## xattr_args *arg)   \
185 {                                                               \
186                                                                 \
187         return (EOPNOTSUPP);                                    \
188 }
189 DUMMY_XATTR(set);
190 DUMMY_XATTR(lset);
191 DUMMY_XATTR(fset);
192 DUMMY_XATTR(get);
193 DUMMY_XATTR(lget);
194 DUMMY_XATTR(fget);
195 DUMMY_XATTR(list);
196 DUMMY_XATTR(llist);
197 DUMMY_XATTR(flist);
198 DUMMY_XATTR(remove);
199 DUMMY_XATTR(lremove);
200 DUMMY_XATTR(fremove);