linux_dummy.c revision 342999
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: stable/11/sys/amd64/linux/linux_dummy.c 342999 2019-01-13 12:13:08Z fsu $"); 31 32#include "opt_compat.h" 33 34#include <sys/param.h> 35#include <sys/kernel.h> 36#include <sys/sdt.h> 37#include <sys/systm.h> 38#include <sys/proc.h> 39 40#include <amd64/linux/linux.h> 41#include <amd64/linux/linux_proto.h> 42#include <compat/linux/linux_dtrace.h> 43#include <compat/linux/linux_util.h> 44 45/* DTrace init */ 46LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); 47 48UNIMPLEMENTED(afs_syscall); 49UNIMPLEMENTED(create_module); /* added in linux 1.0 removed in 2.6 */ 50UNIMPLEMENTED(epoll_ctl_old); 51UNIMPLEMENTED(epoll_wait_old); 52UNIMPLEMENTED(get_kernel_syms); /* added in linux 1.0 removed in 2.6 */ 53UNIMPLEMENTED(get_thread_area); 54UNIMPLEMENTED(getpmsg); 55UNIMPLEMENTED(nfsservctl); /* added in linux 2.2 removed in 3.1 */ 56UNIMPLEMENTED(putpmsg); 57UNIMPLEMENTED(query_module); /* added in linux 2.2 removed in 2.6 */ 58UNIMPLEMENTED(security); 59UNIMPLEMENTED(set_thread_area); 60UNIMPLEMENTED(tuxcall); 61UNIMPLEMENTED(uselib); 62UNIMPLEMENTED(vserver); 63 64DUMMY(sendfile); 65DUMMY(syslog); 66DUMMY(setfsuid); 67DUMMY(setfsgid); 68DUMMY(sysfs); 69DUMMY(vhangup); 70DUMMY(pivot_root); 71DUMMY(adjtimex); 72DUMMY(swapoff); 73DUMMY(init_module); 74DUMMY(delete_module); 75DUMMY(quotactl); 76DUMMY(lookup_dcookie); 77DUMMY(remap_file_pages); 78DUMMY(semtimedop); 79DUMMY(mbind); 80DUMMY(get_mempolicy); 81DUMMY(set_mempolicy); 82DUMMY(mq_open); 83DUMMY(mq_unlink); 84DUMMY(mq_timedsend); 85DUMMY(mq_timedreceive); 86DUMMY(mq_notify); 87DUMMY(mq_getsetattr); 88DUMMY(kexec_load); 89/* linux 2.6.11: */ 90DUMMY(add_key); 91DUMMY(request_key); 92DUMMY(keyctl); 93/* linux 2.6.13: */ 94DUMMY(ioprio_set); 95DUMMY(ioprio_get); 96DUMMY(inotify_init); 97DUMMY(inotify_add_watch); 98DUMMY(inotify_rm_watch); 99/* linux 2.6.16: */ 100DUMMY(migrate_pages); 101DUMMY(unshare); 102/* linux 2.6.17: */ 103DUMMY(splice); 104DUMMY(tee); 105DUMMY(sync_file_range); 106DUMMY(vmsplice); 107/* linux 2.6.18: */ 108DUMMY(move_pages); 109/* linux 2.6.22: */ 110DUMMY(signalfd); 111/* linux 2.6.27: */ 112DUMMY(signalfd4); 113DUMMY(inotify_init1); 114/* linux 2.6.31: */ 115DUMMY(perf_event_open); 116/* linux 2.6.38: */ 117DUMMY(fanotify_init); 118DUMMY(fanotify_mark); 119/* linux 2.6.39: */ 120DUMMY(name_to_handle_at); 121DUMMY(open_by_handle_at); 122DUMMY(clock_adjtime); 123/* linux 3.0: */ 124DUMMY(setns); 125DUMMY(getcpu); 126/* linux 3.2: */ 127DUMMY(process_vm_readv); 128DUMMY(process_vm_writev); 129/* linux 3.5: */ 130DUMMY(kcmp); 131/* linux 3.8: */ 132DUMMY(finit_module); 133DUMMY(sched_setattr); 134DUMMY(sched_getattr); 135/* linux 3.14: */ 136DUMMY(renameat2); 137/* linux 3.15: */ 138DUMMY(seccomp); 139DUMMY(memfd_create); 140DUMMY(kexec_file_load); 141/* linux 3.18: */ 142DUMMY(bpf); 143/* linux 3.19: */ 144DUMMY(execveat); 145/* linux 4.2: */ 146DUMMY(userfaultfd); 147/* linux 4.3: */ 148DUMMY(membarrier); 149/* linux 4.4: */ 150DUMMY(mlock2); 151/* linux 4.5: */ 152DUMMY(copy_file_range); 153/* linux 4.6: */ 154DUMMY(preadv2); 155DUMMY(pwritev2); 156/* linux 4.8: */ 157DUMMY(pkey_mprotect); 158DUMMY(pkey_alloc); 159DUMMY(pkey_free); 160 161#define DUMMY_XATTR(s) \ 162int \ 163linux_ ## s ## xattr( \ 164 struct thread *td, struct linux_ ## s ## xattr_args *arg) \ 165{ \ 166 \ 167 return (EOPNOTSUPP); \ 168} 169DUMMY_XATTR(set); 170DUMMY_XATTR(lset); 171DUMMY_XATTR(fset); 172DUMMY_XATTR(get); 173DUMMY_XATTR(lget); 174DUMMY_XATTR(fget); 175DUMMY_XATTR(list); 176DUMMY_XATTR(llist); 177DUMMY_XATTR(flist); 178DUMMY_XATTR(remove); 179DUMMY_XATTR(lremove); 180DUMMY_XATTR(fremove); 181