linux_dummy.c revision 293588
1/*-
2 * Copyright (c) 2013 Dmitry Chagin
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 *    notice, this list of conditions and the following disclaimer
10 *    in this position and unchanged.
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 ``AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: stable/10/sys/amd64/linux/linux_dummy.c 293588 2016-01-09 17:50:13Z dchagin $");
29
30#include "opt_compat.h"
31#include "opt_kdtrace.h"
32
33#include <sys/param.h>
34#include <sys/kernel.h>
35#include <sys/sdt.h>
36#include <sys/systm.h>
37#include <sys/proc.h>
38
39#include <amd64/linux/linux.h>
40#include <amd64/linux/linux_proto.h>
41#include <compat/linux/linux_dtrace.h>
42#include <compat/linux/linux_util.h>
43
44/* DTrace init */
45LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE);
46
47DUMMY(mincore);
48DUMMY(sendfile);
49DUMMY(ptrace);
50DUMMY(syslog);
51DUMMY(setfsuid);
52DUMMY(setfsgid);
53DUMMY(sysfs);
54DUMMY(vhangup);
55DUMMY(pivot_root);
56DUMMY(adjtimex);
57DUMMY(swapoff);
58DUMMY(create_module);
59DUMMY(init_module);
60DUMMY(delete_module);
61DUMMY(get_kernel_syms);
62DUMMY(query_module);
63DUMMY(quotactl);
64DUMMY(nfsservctl);
65DUMMY(getpmsg);
66DUMMY(putpmsg);
67DUMMY(afs_syscall);
68DUMMY(tuxcall);
69DUMMY(security);
70DUMMY(set_thread_area);
71DUMMY(lookup_dcookie);
72DUMMY(epoll_ctl_old);
73DUMMY(epoll_wait_old);
74DUMMY(remap_file_pages);
75DUMMY(semtimedop);
76DUMMY(mbind);
77DUMMY(get_mempolicy);
78DUMMY(set_mempolicy);
79DUMMY(mq_open);
80DUMMY(mq_unlink);
81DUMMY(mq_timedsend);
82DUMMY(mq_timedreceive);
83DUMMY(mq_notify);
84DUMMY(mq_getsetattr);
85DUMMY(kexec_load);
86DUMMY(add_key);
87DUMMY(request_key);
88DUMMY(keyctl);
89DUMMY(ioprio_set);
90DUMMY(ioprio_get);
91DUMMY(inotify_init);
92DUMMY(inotify_add_watch);
93DUMMY(inotify_rm_watch);
94DUMMY(migrate_pages);
95DUMMY(unshare);
96DUMMY(splice);
97DUMMY(tee);
98DUMMY(sync_file_range);
99DUMMY(vmsplice);
100DUMMY(move_pages);
101DUMMY(signalfd);
102DUMMY(timerfd);
103DUMMY(timerfd_settime);
104DUMMY(timerfd_gettime);
105DUMMY(signalfd4);
106DUMMY(inotify_init1);
107DUMMY(preadv);
108DUMMY(pwritev);
109DUMMY(rt_tsigqueueinfo);
110DUMMY(perf_event_open);
111DUMMY(fanotify_init);
112DUMMY(fanotify_mark);
113DUMMY(name_to_handle_at);
114DUMMY(open_by_handle_at);
115DUMMY(clock_adjtime);
116DUMMY(syncfs);
117DUMMY(setns);
118DUMMY(process_vm_readv);
119DUMMY(process_vm_writev);
120DUMMY(kcmp);
121DUMMY(finit_module);
122
123#define DUMMY_XATTR(s)						\
124int								\
125linux_ ## s ## xattr(						\
126    struct thread *td, struct linux_ ## s ## xattr_args *arg)	\
127{								\
128								\
129	return (ENOATTR);					\
130}
131DUMMY_XATTR(set);
132DUMMY_XATTR(lset);
133DUMMY_XATTR(fset);
134DUMMY_XATTR(get);
135DUMMY_XATTR(lget);
136DUMMY_XATTR(fget);
137DUMMY_XATTR(list);
138DUMMY_XATTR(llist);
139DUMMY_XATTR(flist);
140DUMMY_XATTR(remove);
141DUMMY_XATTR(lremove);
142DUMMY_XATTR(fremove);
143