2 * system call not available stub
4 * Copyright (C) 2009 Analog Devices Inc.
6 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
9 /* Please keep the list sorted alphabetically, in ascending order
10 * of the stub name! */
13 #include <bits/wordsize.h>
14 #include <sys/syscall.h>
16 #ifdef __UCLIBC_HAS_STUBS__
18 __attribute_used__ static int enosys_stub(void)
24 __attribute_used__ static int ret_enosys_stub(void)
29 #define make_stub(stub) \
30 link_warning(stub, #stub ": this function is not implemented") \
31 strong_alias(enosys_stub, stub)
33 #define make_ret_stub(stub) \
34 link_warning(stub, #stub ": this function is not implemented") \
35 strong_alias(ret_enosys_stub, stub)
37 #ifndef __ARCH_USE_MMU__
42 # define __NR_fadvise64_64 __NR_arm_fadvise64_64
43 # define __NR_fadvise64 __NR_arm_fadvise64_64
44 /* ARM always provides funcs w/out syscalls; disable the stubs */
45 # define __NR_ioperm 0
50 # define __NR_fadvise64_64 __NR_fadvise64
54 # define __NR_fadvise64 __NR_fadvise64_64
57 #if !defined __NR_accept && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
61 #if !defined __NR_accept4 && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__ && defined __UCLIBC_LINUX_SPECIFIC__
65 #if !defined __NR_arch_prctl && defined __UCLIBC_LINUX_SPECIFIC__
69 #if !defined __NR_bdflush && defined __UCLIBC_LINUX_SPECIFIC__
73 #if !defined __NR_bind && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
77 #if !defined __NR_capget && defined __UCLIBC_LINUX_SPECIFIC__
81 #if !defined __NR_capset && defined __UCLIBC_LINUX_SPECIFIC__
85 #if !defined __NR_connect && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
89 #if !defined __NR_create_module && defined __UCLIBC_LINUX_MODULE_24__
90 make_stub(create_module)
93 #if !defined __NR_delete_module && defined __UCLIBC_LINUX_MODULE_26__
94 make_stub(delete_module)
97 #if !defined __NR_epoll_create && defined __UCLIBC_HAS_EPOLL__ \
98 && !defined __NR_epoll_create1
99 make_stub(epoll_create)
102 #if !defined __NR_epoll_ctl && defined __UCLIBC_HAS_EPOLL__
106 #if !defined __NR_epoll_pwait && defined __UCLIBC_HAS_EPOLL__
107 make_stub(epoll_pwait)
110 #if !defined __NR_epoll_wait && defined __UCLIBC_HAS_EPOLL__ \
111 && !defined __NR_epoll_pwait
112 make_stub(epoll_wait)
115 #if !defined __NR_eventfd && !defined __NR_eventfd2 && defined __UCLIBC_LINUX_SPECIFIC__
119 #if !defined __NR_fdatasync && !defined __NR_osf_fdatasync
123 #ifndef __NR_fgetxattr
127 #ifndef __NR_flistxattr
128 make_stub(flistxattr)
131 #if !defined __NR_fork && !defined __NR_clone
135 #ifndef __NR_fremovexattr
136 make_stub(fremovexattr)
139 #ifndef __NR_fsetxattr
143 #if !defined __NR_fstatfs && !defined __NR_fstatfs64 \
144 && defined __UCLIBC_LINUX_SPECIFIC__
148 #ifndef __NR_get_kernel_syms
149 make_stub(get_kernel_syms)
152 #if !defined __NR_getpeername && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
153 make_stub(getpeername)
156 #if !defined __NR_getpgrp && !defined __NR_getpgid
160 #if !defined __NR_getsockname && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
161 make_stub(getsockname)
164 #if !defined __NR_getsockopt && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
165 make_stub(getsockopt)
168 #ifndef __NR_getxattr
172 #if !defined __NR_init_module && defined __UCLIBC_LINUX_MODULE_26__
173 make_stub(init_module)
176 #if !defined __NR_inotify_add_watch && defined __UCLIBC_LINUX_SPECIFIC__
177 make_stub(inotify_add_watch)
180 #if !defined __NR_inotify_init && defined __UCLIBC_LINUX_SPECIFIC__ \
181 && !defined __NR_inotify_init1
182 make_stub(inotify_init)
185 #if !defined __NR_inotify_init1 && defined __UCLIBC_LINUX_SPECIFIC__
186 make_stub(inotify_init1)
189 #if !defined __NR_inotify_rm_watch && defined __UCLIBC_LINUX_SPECIFIC__
190 make_stub(inotify_rm_watch)
193 #if !defined __NR_ioperm && defined __UCLIBC_LINUX_SPECIFIC__
197 #if !defined __NR_iopl && defined __UCLIBC_LINUX_SPECIFIC__
201 #ifndef __NR_lgetxattr
205 #if !defined __NR_listen && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
209 #ifndef __NR_listxattr
213 #ifndef __NR_llistxattr
214 make_stub(llistxattr)
217 #ifndef __NR_lremovexattr
218 make_stub(lremovexattr)
221 #ifndef __NR_lsetxattr
225 #if !defined __NR_madvise && defined __UCLIBC_LINUX_SPECIFIC__
229 #if !defined __NR_modify_ldt && defined __UCLIBC_LINUX_SPECIFIC__
230 make_stub(modify_ldt)
235 # ifdef __UCLIBC_HAS_LFS__
240 #if !defined __NR_personality && defined __UCLIBC_LINUX_SPECIFIC__
241 make_stub(personality)
244 #if !defined __NR_pipe2 && defined __UCLIBC_LINUX_SPECIFIC__
248 #if !defined __NR_pivot_root && defined __UCLIBC_LINUX_SPECIFIC__
249 make_stub(pivot_root)
252 #if !defined __NR_fadvise64 && defined __UCLIBC_HAS_LFS__
253 make_ret_stub(posix_fadvise)
256 #if !defined __NR_fadvise64_64 && defined __UCLIBC_HAS_LFS__ && __WORDSIZE == 32
257 make_ret_stub(posix_fadvise64)
261 make_ret_stub(posix_madvise)
264 #if !defined __NR_ppoll && defined __UCLIBC_LINUX_SPECIFIC__
268 #if !defined __NR_prctl && defined __UCLIBC_LINUX_SPECIFIC__
272 #if !defined __NR_query_module && defined __UCLIBC_LINUX_MODULE_24__
273 make_stub(query_module)
276 #if !defined __NR_readahead && defined __UCLIBC_LINUX_SPECIFIC__
280 #if !defined __NR_reboot && defined __UCLIBC_LINUX_SPECIFIC__
284 #if !defined __NR_recv && !defined __NR_socketcall && !defined __NR_recvfrom && defined __UCLIBC_HAS_SOCKET__
288 #if !defined __NR_recvfrom && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
292 #if !defined __NR_recvmsg && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
296 #if !defined __NR_remap_file_pages && defined __UCLIBC_LINUX_SPECIFIC__
297 make_stub(remap_file_pages)
300 #ifndef __NR_removexattr
301 make_stub(removexattr)
304 #ifndef __NR_renameat
308 #if !defined __NR_sched_getaffinity && defined __UCLIBC_LINUX_SPECIFIC__
309 make_stub(sched_getaffinity)
312 #if !defined __NR_getcpu && defined __UCLIBC_LINUX_SPECIFIC__ && ((defined __x86_64__ && !defined __UCLIBC_HAS_TLS__) || !defined __x86_64__)
313 make_stub(sched_getcpu)
316 #if !defined __NR_sched_setaffinity && defined __UCLIBC_LINUX_SPECIFIC__
317 make_stub(sched_setaffinity)
320 #if !defined __NR_send && !defined __NR_socketcall && !defined __NR_sendto && defined __UCLIBC_HAS_SOCKET__
324 #if !defined __NR_sendfile && !defined __NR_sendfile64 \
325 && defined __UCLIBC_LINUX_SPECIFIC__
329 #if !defined __NR_sendfile64 && !defined __NR_sendfile && defined __UCLIBC_LINUX_SPECIFIC__ && defined __UCLIBC_HAS_LFS__
330 make_stub(sendfile64)
333 #if !defined __NR_sendmsg && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
337 #if !defined __NR_sendto && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
341 #if ((__WORDSIZE == 32 && (!defined __NR_setfsgid32 && !defined __NR_setfsgid)) || (__WORDSIZE == 64 && !defined __NR_setfsgid)) && defined __UCLIBC_LINUX_SPECIFIC__
345 #if ((__WORDSIZE == 32 && (!defined __NR_setfsuid32 && !defined __NR_setfsuid)) || (__WORDSIZE == 64 && !defined __NR_setfsuid)) && defined __UCLIBC_LINUX_SPECIFIC__
349 #if !defined __NR_setns && defined __UCLIBC_LINUX_SPECIFIC__
353 #if !defined __NR_setresgid32 && !defined __NR_setresgid && defined __UCLIBC_LINUX_SPECIFIC__
357 #if !defined __NR_setresuid32 && !defined __NR_setresuid && defined __UCLIBC_LINUX_SPECIFIC__
361 #if !defined __NR_setsockopt && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
362 make_stub(setsockopt)
365 #ifndef __NR_setxattr
369 #if !defined __NR_shutdown && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
373 #if !defined __NR_signalfd4 && !defined __NR_signalfd && defined __UCLIBC_LINUX_SPECIFIC__
377 #ifndef __NR_rt_sigtimedwait
378 make_stub(sigtimedwait)
379 make_stub(sigwaitinfo)
382 #ifndef __NR_rt_sigqueueinfo
386 #if !defined __NR_socket && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
390 #if !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
391 make_stub(socketcall)
394 #if !defined __NR_socketpair && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
395 make_stub(socketpair)
398 #if !defined __NR_stime && !defined __NR_settimeofday
400 make_stub(settimeofday)
403 #if !defined __NR_splice && defined __UCLIBC_LINUX_SPECIFIC__
407 #if !defined __NR_swapoff && defined __UCLIBC_LINUX_SPECIFIC__
411 #if !defined __NR_swapon && defined __UCLIBC_LINUX_SPECIFIC__
415 #if !defined __NR_symlink && !defined __NR_symlinkat
419 #if !defined __NR_sync_file_range && defined __UCLIBC_LINUX_SPECIFIC__
420 make_stub(sync_file_range)
423 #if !defined __NR__sysctl && defined __UCLIBC_LINUX_SPECIFIC__
427 #if !defined __NR_sysinfo && defined __UCLIBC_LINUX_SPECIFIC__
431 #if !defined __NR_tee && defined __UCLIBC_LINUX_SPECIFIC__
435 #if !defined __NR_timerfd_create && defined __UCLIBC_LINUX_SPECIFIC__
436 make_stub(timerfd_create)
439 #if !defined __NR_timerfd_settime && defined __UCLIBC_LINUX_SPECIFIC__
440 make_stub(timerfd_settime)
443 #if !defined __NR_timerfd_gettime && defined __UCLIBC_LINUX_SPECIFIC__
444 make_stub(timerfd_gettime)
447 #ifndef __NR_utimensat
450 # ifndef __NR_lutimes
455 #ifndef __NR_utimensat
456 #if !defined __NR_utime && !defined __NR_utimes
457 /*make_stub(utime) obsoleted */
462 #if !defined __NR_umount && !defined __NR_umount2 && defined __UCLIBC_LINUX_SPECIFIC__
466 #if !defined __NR_umount2 && defined __UCLIBC_LINUX_SPECIFIC__
470 #if !defined __NR_unshare && defined __UCLIBC_LINUX_SPECIFIC__
474 #if defined __UCLIBC_SV4_DEPRECATED__ && !defined __NR_ustat
478 #if !defined __NR_vhangup && defined __UCLIBC_LINUX_SPECIFIC__
482 #if !defined __NR_vmsplice && defined __UCLIBC_LINUX_SPECIFIC__