OSDN Git Service

Merge remote-tracking branch 'origin/master' into prelink
[uclinux-h8/uClibc.git] / libc / sysdeps / linux / common / stubs.c
1 /*
2  * system call not available stub
3  *
4  * Copyright (C) 2009 Analog Devices Inc.
5  *
6  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
7  */
8
9 #include <errno.h>
10 #include <sys/syscall.h>
11
12 #ifdef __UCLIBC_HAS_STUBS__
13
14 static int enosys_stub(void)
15 {
16         __set_errno(ENOSYS);
17         return -1;
18 }
19
20 #define make_stub(stub) \
21         link_warning(stub, #stub ": this function is not implemented") \
22         strong_alias(enosys_stub, stub)
23
24 #ifndef __ARCH_USE_MMU__
25 # undef __NR_fork
26 #endif
27
28 #ifndef __UCLIBC_HAS_LFS__
29 # undef __NR_fadvise64
30 # undef __NR_fadvise64_64
31 # undef __NR_sync_file_range
32 #endif
33
34 #ifndef __NR_bdflush
35 make_stub(bdflush)
36 #endif
37
38 #ifndef __NR_capget
39 make_stub(capget)
40 #endif
41
42 #ifndef __NR_capset
43 make_stub(capset)
44 #endif
45
46 #ifndef __NR_create_module
47 make_stub(create_module)
48 #endif
49
50 #ifndef __NR_delete_module
51 make_stub(delete_module)
52 #endif
53
54 #ifndef __NR_epoll_create
55 make_stub(epoll_create)
56 #endif
57
58 #ifndef __NR_epoll_ctl
59 make_stub(epoll_ctl)
60 #endif
61
62 #ifndef __NR_epoll_wait
63 make_stub(epoll_wait)
64 #endif
65
66 #ifndef __NR_fdatasync
67 make_stub(fdatasync)
68 #endif
69
70 #ifndef __NR_flistxattr
71 make_stub(flistxattr)
72 #endif
73
74 #ifndef __NR_fork
75 make_stub(fork)
76 #endif
77
78 #ifndef __NR_fgetxattr
79 make_stub(fgetxattr)
80 #endif
81
82 #ifndef __NR_fremovexattr
83 make_stub(fremovexattr)
84 #endif
85
86 #ifndef __NR_fsetxattr
87 make_stub(fsetxattr)
88 #endif
89
90 #ifndef __NR_get_kernel_syms
91 make_stub(get_kernel_syms)
92 #endif
93
94 #if !defined(__NR_getpgrp) && (defined(__NR_getpgid) && (defined(__NR_getpid) || defined(__NR_getxpid)))
95 make_stub(getpgrp)
96 #endif
97
98 #ifndef __NR_getxattr
99 make_stub(getxattr)
100 #endif
101
102 #ifndef __NR_init_module
103 make_stub(init_module)
104 #endif
105
106 #ifndef __NR_lgetxattr
107 make_stub(lgetxattr)
108 #endif
109
110 #ifndef __NR_listxattr
111 make_stub(listxattr)
112 #endif
113
114 #ifndef __NR_llistxattr
115 make_stub(llistxattr)
116 #endif
117
118 #ifndef __NR_lremovexattr
119 make_stub(lremovexattr)
120 #endif
121
122 #ifndef __NR_lsetxattr
123 make_stub(lsetxattr)
124 #endif
125
126 #ifndef __NR_pivot_root
127 make_stub(pivot_root)
128 #endif
129
130 #ifndef __NR_query_module
131 make_stub(query_module)
132 #endif
133
134 #ifndef __NR_removexattr
135 make_stub(removexattr)
136 #endif
137
138 #ifndef __NR_sched_getaffinity
139 make_stub(sched_getaffinity)
140 #endif
141
142 #ifndef __NR_sched_setaffinity
143 make_stub(sched_setaffinity)
144 #endif
145
146 #ifndef __NR_setxattr
147 make_stub(setxattr)
148 #endif
149
150 #if !defined(__NR_signalfd4) && !defined(__NR_signalfd)
151 make_stub(signalfd)
152 #endif
153
154 #ifndef __NR_rt_sigtimedwait
155 make_stub(sigtimedwait)
156 make_stub(sigwaitinfo)
157 #endif
158
159 #ifndef __NR_splice
160 make_stub(splice)
161 #endif
162
163 #ifndef __NR_sync_file_range
164 make_stub(sync_file_range)
165 #endif
166
167 #if !defined(__NR_umount) && !defined(__NR_umount2)
168 make_stub(umount)
169 #endif
170
171 #ifndef __NR_umount2
172 make_stub(umount2)
173 #endif
174
175 #ifndef __NR_utimensat
176 make_stub(futimens)
177 make_stub(utimensat)
178 # ifndef __NR_lutimes
179 make_stub(lutimes)
180 # endif
181 #endif
182
183 #ifndef __NR_vmsplice
184 make_stub(vmsplice)
185 #endif
186
187 #endif