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 make_stub(epoll_create)
101 #if !defined __NR_epoll_ctl && defined __UCLIBC_HAS_EPOLL__
105 #if !defined __NR_epoll_pwait && defined __UCLIBC_HAS_EPOLL__
106 make_stub(epoll_pwait)
109 #if !defined __NR_epoll_wait && defined __UCLIBC_HAS_EPOLL__
110 make_stub(epoll_wait)
113 #if !defined __NR_eventfd && !defined __NR_eventfd2 && defined __UCLIBC_LINUX_SPECIFIC__
117 #if !defined __NR_fdatasync && !defined __NR_osf_fdatasync
121 #ifndef __NR_fgetxattr
125 #ifndef __NR_flistxattr
126 make_stub(flistxattr)
133 #ifndef __NR_fremovexattr
134 make_stub(fremovexattr)
137 #ifndef __NR_fsetxattr
141 #if !defined __NR_fstatfs && defined __UCLIBC_LINUX_SPECIFIC__
145 #ifndef __NR_get_kernel_syms
146 make_stub(get_kernel_syms)
149 #if !defined __NR_getpeername && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
150 make_stub(getpeername)
153 #if !defined __NR_getpgrp && !defined __NR_getpgid
157 #if !defined __NR_getsockname && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
158 make_stub(getsockname)
161 #if !defined __NR_getsockopt && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
162 make_stub(getsockopt)
165 #ifndef __NR_getxattr
169 #if !defined __NR_init_module && defined __UCLIBC_LINUX_MODULE_26__
170 make_stub(init_module)
173 #if !defined __NR_inotify_add_watch && defined __UCLIBC_LINUX_SPECIFIC__
174 make_stub(inotify_add_watch)
177 #if !defined __NR_inotify_init && defined __UCLIBC_LINUX_SPECIFIC__
178 make_stub(inotify_init)
181 #if !defined __NR_inotify_init1 && defined __UCLIBC_LINUX_SPECIFIC__
182 make_stub(inotify_init1)
185 #if !defined __NR_inotify_rm_watch && defined __UCLIBC_LINUX_SPECIFIC__
186 make_stub(inotify_rm_watch)
189 #if !defined __NR_ioperm && defined __UCLIBC_LINUX_SPECIFIC__
193 #if !defined __NR_iopl && defined __UCLIBC_LINUX_SPECIFIC__
197 #ifndef __NR_lgetxattr
201 #if !defined __NR_listen && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
205 #ifndef __NR_listxattr
209 #ifndef __NR_llistxattr
210 make_stub(llistxattr)
213 #ifndef __NR_lremovexattr
214 make_stub(lremovexattr)
217 #ifndef __NR_lsetxattr
221 #if !defined __NR_madvise && defined __UCLIBC_LINUX_SPECIFIC__
225 #if !defined __NR_modify_ldt && defined __UCLIBC_LINUX_SPECIFIC__
226 make_stub(modify_ldt)
231 # ifdef __UCLIBC_HAS_LFS__
236 #if !defined __NR_personality && defined __UCLIBC_LINUX_SPECIFIC__
237 make_stub(personality)
240 #if !defined __NR_pipe2 && defined __UCLIBC_LINUX_SPECIFIC__
244 #if !defined __NR_pivot_root && defined __UCLIBC_LINUX_SPECIFIC__
245 make_stub(pivot_root)
248 #if !defined __NR_fadvise64 && defined __UCLIBC_HAS_LFS__
249 make_ret_stub(posix_fadvise)
252 #if !defined __NR_fadvise64_64 && defined __UCLIBC_HAS_LFS__ && __WORDSIZE == 32
253 make_ret_stub(posix_fadvise64)
257 make_ret_stub(posix_madvise)
260 #if !defined __NR_ppoll && defined __UCLIBC_LINUX_SPECIFIC__
264 #if !defined __NR_prctl && defined __UCLIBC_LINUX_SPECIFIC__
268 #if !defined __NR_query_module && defined __UCLIBC_LINUX_MODULE_24__
269 make_stub(query_module)
272 #if !defined __NR_readahead && defined __UCLIBC_LINUX_SPECIFIC__
276 #if !defined __NR_reboot && defined __UCLIBC_LINUX_SPECIFIC__
280 #if !defined __NR_recv && !defined __NR_socketcall && !defined __NR_recvfrom && defined __UCLIBC_HAS_SOCKET__
284 #if !defined __NR_recvfrom && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
288 #if !defined __NR_recvmsg && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
292 #if !defined __NR_remap_file_pages && defined __UCLIBC_LINUX_SPECIFIC__
293 make_stub(remap_file_pages)
296 #ifndef __NR_removexattr
297 make_stub(removexattr)
300 #ifndef __NR_renameat
304 #if !defined __NR_sched_getaffinity && defined __UCLIBC_LINUX_SPECIFIC__
305 make_stub(sched_getaffinity)
308 #if !defined __NR_getcpu && defined __UCLIBC_LINUX_SPECIFIC__ && ((defined __x86_64__ && !defined __UCLIBC_HAS_TLS__) || !defined __x86_64__)
309 make_stub(sched_getcpu)
312 #if !defined __NR_sched_setaffinity && defined __UCLIBC_LINUX_SPECIFIC__
313 make_stub(sched_setaffinity)
316 #if !defined __NR_send && !defined __NR_socketcall && !defined __NR_sendto && defined __UCLIBC_HAS_SOCKET__
320 #if !defined __NR_sendfile && defined __UCLIBC_LINUX_SPECIFIC__
324 #if !defined __NR_sendfile64 && !defined __NR_sendfile && defined __UCLIBC_LINUX_SPECIFIC__ && defined __UCLIBC_HAS_LFS__
325 make_stub(sendfile64)
328 #if !defined __NR_sendmsg && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
332 #if !defined __NR_sendto && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
336 #if ((__WORDSIZE == 32 && (!defined __NR_setfsgid32 && !defined __NR_setfsgid)) || (__WORDSIZE == 64 && !defined __NR_setfsgid)) && defined __UCLIBC_LINUX_SPECIFIC__
340 #if ((__WORDSIZE == 32 && (!defined __NR_setfsuid32 && !defined __NR_setfsuid)) || (__WORDSIZE == 64 && !defined __NR_setfsuid)) && defined __UCLIBC_LINUX_SPECIFIC__
344 #if !defined __NR_setresgid32 && !defined __NR_setresgid && defined __UCLIBC_LINUX_SPECIFIC__
348 #if !defined __NR_setresuid32 && !defined __NR_setresuid && defined __UCLIBC_LINUX_SPECIFIC__
352 #if !defined __NR_setsockopt && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
353 make_stub(setsockopt)
356 #ifndef __NR_setxattr
360 #if !defined __NR_shutdown && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
364 #if !defined __NR_signalfd4 && !defined __NR_signalfd && defined __UCLIBC_LINUX_SPECIFIC__
368 #ifndef __NR_rt_sigtimedwait
369 make_stub(sigtimedwait)
370 make_stub(sigwaitinfo)
373 #ifndef __NR_rt_sigqueueinfo
377 #if !defined __NR_socket && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
381 #if !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
382 make_stub(socketcall)
385 #if !defined __NR_socketpair && !defined __NR_socketcall && defined __UCLIBC_HAS_SOCKET__
386 make_stub(socketpair)
389 #if !defined __NR_stime && !defined __NR_settimeofday
391 make_stub(settimeofday)
394 #if !defined __NR_splice && defined __UCLIBC_LINUX_SPECIFIC__
398 #if !defined __NR_swapoff && defined __UCLIBC_LINUX_SPECIFIC__
402 #if !defined __NR_swapon && defined __UCLIBC_LINUX_SPECIFIC__
410 #if !defined __NR_sync_file_range && defined __UCLIBC_LINUX_SPECIFIC__
411 make_stub(sync_file_range)
414 #if !defined __NR__sysctl && defined __UCLIBC_LINUX_SPECIFIC__
418 #if !defined __NR_sysinfo && defined __UCLIBC_LINUX_SPECIFIC__
422 #if !defined __NR_tee && defined __UCLIBC_LINUX_SPECIFIC__
426 #if !defined __NR_timerfd_create && defined __UCLIBC_LINUX_SPECIFIC__
427 make_stub(timerfd_create)
430 #if !defined __NR_timerfd_settime && defined __UCLIBC_LINUX_SPECIFIC__
431 make_stub(timerfd_settime)
434 #if !defined __NR_timerfd_gettime && defined __UCLIBC_LINUX_SPECIFIC__
435 make_stub(timerfd_gettime)
438 #ifndef __NR_utimensat
441 # ifndef __NR_lutimes
446 #if !defined __NR_utime && !defined __NR_utimes
447 /*make_stub(utime) obsoleted */
451 #if !defined __NR_umount && !defined __NR_umount2 && defined __UCLIBC_LINUX_SPECIFIC__
455 #if !defined __NR_umount2 && defined __UCLIBC_LINUX_SPECIFIC__
459 #if !defined __NR_unshare && defined __UCLIBC_LINUX_SPECIFIC__
463 #if !defined __NR_vhangup && defined __UCLIBC_LINUX_SPECIFIC__
467 #if !defined __NR_vmsplice && defined __UCLIBC_LINUX_SPECIFIC__