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