#endif /* end THUMB */
-#define my_syscall0(num) \
+#define __nolibc_syscall0(num) \
({ \
register long _num __asm__(_NOLIBC_SYSCALL_REG) = (num); \
register long _arg1 __asm__ ("r0"); \
_arg1; \
})
-#define my_syscall1(num, arg1) \
+#define __nolibc_syscall1(num, arg1) \
({ \
register long _num __asm__(_NOLIBC_SYSCALL_REG) = (num); \
register long _arg1 __asm__ ("r0") = (long)(arg1); \
_arg1; \
})
-#define my_syscall2(num, arg1, arg2) \
+#define __nolibc_syscall2(num, arg1, arg2) \
({ \
register long _num __asm__(_NOLIBC_SYSCALL_REG) = (num); \
register long _arg1 __asm__ ("r0") = (long)(arg1); \
_arg1; \
})
-#define my_syscall3(num, arg1, arg2, arg3) \
+#define __nolibc_syscall3(num, arg1, arg2, arg3) \
({ \
register long _num __asm__(_NOLIBC_SYSCALL_REG) = (num); \
register long _arg1 __asm__ ("r0") = (long)(arg1); \
_arg1; \
})
-#define my_syscall4(num, arg1, arg2, arg3, arg4) \
+#define __nolibc_syscall4(num, arg1, arg2, arg3, arg4) \
({ \
register long _num __asm__(_NOLIBC_SYSCALL_REG) = (num); \
register long _arg1 __asm__ ("r0") = (long)(arg1); \
_arg1; \
})
-#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
+#define __nolibc_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
({ \
register long _num __asm__(_NOLIBC_SYSCALL_REG) = (num); \
register long _arg1 __asm__ ("r0") = (long)(arg1); \
_arg1; \
})
-#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
+#define __nolibc_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
({ \
register long _num __asm__(_NOLIBC_SYSCALL_REG) = (num); \
register long _arg1 __asm__ ("r0") = (long)(arg1); \
* don't have to experience issues with register constraints.
*/
-#define my_syscall0(num) \
+#define __nolibc_syscall0(num) \
({ \
register long _num __asm__ ("x8") = (num); \
register long _arg1 __asm__ ("x0"); \
_arg1; \
})
-#define my_syscall1(num, arg1) \
+#define __nolibc_syscall1(num, arg1) \
({ \
register long _num __asm__ ("x8") = (num); \
register long _arg1 __asm__ ("x0") = (long)(arg1); \
_arg1; \
})
-#define my_syscall2(num, arg1, arg2) \
+#define __nolibc_syscall2(num, arg1, arg2) \
({ \
register long _num __asm__ ("x8") = (num); \
register long _arg1 __asm__ ("x0") = (long)(arg1); \
_arg1; \
})
-#define my_syscall3(num, arg1, arg2, arg3) \
+#define __nolibc_syscall3(num, arg1, arg2, arg3) \
({ \
register long _num __asm__ ("x8") = (num); \
register long _arg1 __asm__ ("x0") = (long)(arg1); \
_arg1; \
})
-#define my_syscall4(num, arg1, arg2, arg3, arg4) \
+#define __nolibc_syscall4(num, arg1, arg2, arg3, arg4) \
({ \
register long _num __asm__ ("x8") = (num); \
register long _arg1 __asm__ ("x0") = (long)(arg1); \
_arg1; \
})
-#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
+#define __nolibc_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
({ \
register long _num __asm__ ("x8") = (num); \
register long _arg1 __asm__ ("x0") = (long)(arg1); \
_arg1; \
})
-#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
+#define __nolibc_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
({ \
register long _num __asm__ ("x8") = (num); \
register long _arg1 __asm__ ("x0") = (long)(arg1); \
#define _NOLIBC_SYSCALL_CLOBBERLIST \
"memory", "$t0", "$t1", "$t2", "$t3", "$t4", "$t5", "$t6", "$t7", "$t8"
-#define my_syscall0(num) \
+#define __nolibc_syscall0(num) \
({ \
register long _num __asm__ ("a7") = (num); \
register long _arg1 __asm__ ("a0"); \
_arg1; \
})
-#define my_syscall1(num, arg1) \
+#define __nolibc_syscall1(num, arg1) \
({ \
register long _num __asm__ ("a7") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \
_arg1; \
})
-#define my_syscall2(num, arg1, arg2) \
+#define __nolibc_syscall2(num, arg1, arg2) \
({ \
register long _num __asm__ ("a7") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \
_arg1; \
})
-#define my_syscall3(num, arg1, arg2, arg3) \
+#define __nolibc_syscall3(num, arg1, arg2, arg3) \
({ \
register long _num __asm__ ("a7") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \
_arg1; \
})
-#define my_syscall4(num, arg1, arg2, arg3, arg4) \
+#define __nolibc_syscall4(num, arg1, arg2, arg3, arg4) \
({ \
register long _num __asm__ ("a7") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \
_arg1; \
})
-#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
+#define __nolibc_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
({ \
register long _num __asm__ ("a7") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \
_arg1; \
})
-#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
+#define __nolibc_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
({ \
register long _num __asm__ ("a7") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \
#define _NOLIBC_SYSCALL_CLOBBERLIST "memory"
-#define my_syscall0(num) \
+#define __nolibc_syscall0(num) \
({ \
register long _num __asm__ ("d0") = (num); \
\
_num; \
})
-#define my_syscall1(num, arg1) \
+#define __nolibc_syscall1(num, arg1) \
({ \
register long _num __asm__ ("d0") = (num); \
register long _arg1 __asm__ ("d1") = (long)(arg1); \
_num; \
})
-#define my_syscall2(num, arg1, arg2) \
+#define __nolibc_syscall2(num, arg1, arg2) \
({ \
register long _num __asm__ ("d0") = (num); \
register long _arg1 __asm__ ("d1") = (long)(arg1); \
_num; \
})
-#define my_syscall3(num, arg1, arg2, arg3) \
+#define __nolibc_syscall3(num, arg1, arg2, arg3) \
({ \
register long _num __asm__ ("d0") = (num); \
register long _arg1 __asm__ ("d1") = (long)(arg1); \
_num; \
})
-#define my_syscall4(num, arg1, arg2, arg3, arg4) \
+#define __nolibc_syscall4(num, arg1, arg2, arg3, arg4) \
({ \
register long _num __asm__ ("d0") = (num); \
register long _arg1 __asm__ ("d1") = (long)(arg1); \
_num; \
})
-#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
+#define __nolibc_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
({ \
register long _num __asm__ ("d0") = (num); \
register long _arg1 __asm__ ("d1") = (long)(arg1); \
_num; \
})
-#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
+#define __nolibc_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
({ \
register long _num __asm__ ("d0") = (num); \
register long _arg1 __asm__ ("d1") = (long)(arg1); \
#endif /* _ABIO32 */
-#define my_syscall0(num) \
+#define __nolibc_syscall0(num) \
({ \
register long _num __asm__ ("v0") = (num); \
register long _arg4 __asm__ ("a3"); \
_arg4 ? -_num : _num; \
})
-#define my_syscall1(num, arg1) \
+#define __nolibc_syscall1(num, arg1) \
({ \
register long _num __asm__ ("v0") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \
_arg4 ? -_num : _num; \
})
-#define my_syscall2(num, arg1, arg2) \
+#define __nolibc_syscall2(num, arg1, arg2) \
({ \
register long _num __asm__ ("v0") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \
_arg4 ? -_num : _num; \
})
-#define my_syscall3(num, arg1, arg2, arg3) \
+#define __nolibc_syscall3(num, arg1, arg2, arg3) \
({ \
register long _num __asm__ ("v0") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \
_arg4 ? -_num : _num; \
})
-#define my_syscall4(num, arg1, arg2, arg3, arg4) \
+#define __nolibc_syscall4(num, arg1, arg2, arg3, arg4) \
({ \
register long _num __asm__ ("v0") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \
#if defined(_ABIO32)
-#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
+#define __nolibc_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
({ \
register long _num __asm__ ("v0") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \
_arg4 ? -_num : _num; \
})
-#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
+#define __nolibc_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
({ \
register long _num __asm__ ("v0") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \
#else /* _ABIN32 || _ABI64 */
-#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
+#define __nolibc_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
({ \
register long _num __asm__ ("v0") = (num); \
register long _arg1 __asm__ ("$4") = (long)(arg1); \
_arg4 ? -_num : _num; \
})
-#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
+#define __nolibc_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
({ \
register long _num __asm__ ("v0") = (num); \
register long _arg1 __asm__ ("$4") = (long)(arg1); \
#define _NOLIBC_SYSCALL_CLOBBERLIST \
"memory", "cr0", "r12", "r11", "r10", "r9"
-#define my_syscall0(num) \
+#define __nolibc_syscall0(num) \
({ \
register long _ret __asm__ ("r3"); \
register long _num __asm__ ("r0") = (num); \
_ret; \
})
-#define my_syscall1(num, arg1) \
+#define __nolibc_syscall1(num, arg1) \
({ \
register long _ret __asm__ ("r3"); \
register long _num __asm__ ("r0") = (num); \
})
-#define my_syscall2(num, arg1, arg2) \
+#define __nolibc_syscall2(num, arg1, arg2) \
({ \
register long _ret __asm__ ("r3"); \
register long _num __asm__ ("r0") = (num); \
})
-#define my_syscall3(num, arg1, arg2, arg3) \
+#define __nolibc_syscall3(num, arg1, arg2, arg3) \
({ \
register long _ret __asm__ ("r3"); \
register long _num __asm__ ("r0") = (num); \
})
-#define my_syscall4(num, arg1, arg2, arg3, arg4) \
+#define __nolibc_syscall4(num, arg1, arg2, arg3, arg4) \
({ \
register long _ret __asm__ ("r3"); \
register long _num __asm__ ("r0") = (num); \
})
-#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
+#define __nolibc_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
({ \
register long _ret __asm__ ("r3"); \
register long _num __asm__ ("r0") = (num); \
_ret; \
})
-#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
+#define __nolibc_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
({ \
register long _ret __asm__ ("r3"); \
register long _num __asm__ ("r0") = (num); \
* so that we don't have to experience issues with register constraints.
*/
-#define my_syscall0(num) \
+#define __nolibc_syscall0(num) \
({ \
register long _num __asm__ ("a7") = (num); \
register long _arg1 __asm__ ("a0"); \
_arg1; \
})
-#define my_syscall1(num, arg1) \
+#define __nolibc_syscall1(num, arg1) \
({ \
register long _num __asm__ ("a7") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \
_arg1; \
})
-#define my_syscall2(num, arg1, arg2) \
+#define __nolibc_syscall2(num, arg1, arg2) \
({ \
register long _num __asm__ ("a7") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \
_arg1; \
})
-#define my_syscall3(num, arg1, arg2, arg3) \
+#define __nolibc_syscall3(num, arg1, arg2, arg3) \
({ \
register long _num __asm__ ("a7") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \
_arg1; \
})
-#define my_syscall4(num, arg1, arg2, arg3, arg4) \
+#define __nolibc_syscall4(num, arg1, arg2, arg3, arg4) \
({ \
register long _num __asm__ ("a7") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \
_arg1; \
})
-#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
+#define __nolibc_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
({ \
register long _num __asm__ ("a7") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \
_arg1; \
})
-#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
+#define __nolibc_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
({ \
register long _num __asm__ ("a7") = (num); \
register long _arg1 __asm__ ("a0") = (long)(arg1); \
*
*/
-#define my_syscall0(num) \
+#define __nolibc_syscall0(num) \
({ \
register long _num __asm__ ("1") = (num); \
register long _rc __asm__ ("2"); \
_rc; \
})
-#define my_syscall1(num, arg1) \
+#define __nolibc_syscall1(num, arg1) \
({ \
register long _num __asm__ ("1") = (num); \
register long _arg1 __asm__ ("2") = (long)(arg1); \
_arg1; \
})
-#define my_syscall2(num, arg1, arg2) \
+#define __nolibc_syscall2(num, arg1, arg2) \
({ \
register long _num __asm__ ("1") = (num); \
register long _arg1 __asm__ ("2") = (long)(arg1); \
_arg1; \
})
-#define my_syscall3(num, arg1, arg2, arg3) \
+#define __nolibc_syscall3(num, arg1, arg2, arg3) \
({ \
register long _num __asm__ ("1") = (num); \
register long _arg1 __asm__ ("2") = (long)(arg1); \
_arg1; \
})
-#define my_syscall4(num, arg1, arg2, arg3, arg4) \
+#define __nolibc_syscall4(num, arg1, arg2, arg3, arg4) \
({ \
register long _num __asm__ ("1") = (num); \
register long _arg1 __asm__ ("2") = (long)(arg1); \
_arg1; \
})
-#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
+#define __nolibc_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
({ \
register long _num __asm__ ("1") = (num); \
register long _arg1 __asm__ ("2") = (long)(arg1); \
_arg1; \
})
-#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
+#define __nolibc_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
({ \
register long _num __asm__ ("1") = (num); \
register long _arg1 __asm__ ("2") = (long)(arg1); \
.offset = (unsigned long)offset
};
- return (void *)my_syscall1(__NR_mmap, &args);
+ return (void *)__nolibc_syscall1(__NR_mmap, &args);
}
#define sys_mmap sys_mmap
static __attribute__((unused))
pid_t sys_fork(void)
{
- return my_syscall5(__NR_clone, 0, SIGCHLD, 0, 0, 0);
+ return __nolibc_syscall5(__NR_clone, 0, SIGCHLD, 0, 0, 0);
}
#define sys_fork sys_fork
static __attribute__((unused))
pid_t sys_vfork(void)
{
- return my_syscall5(__NR_clone, 0, CLONE_VM | CLONE_VFORK | SIGCHLD, 0, 0, 0);
+ return __nolibc_syscall5(__NR_clone, 0, CLONE_VM | CLONE_VFORK | SIGCHLD, 0, 0, 0);
}
#define sys_vfork sys_vfork
* - syscall return value is in r0
*/
-#define my_syscall0(num) \
+#define __nolibc_syscall0(num) \
({ \
register long _num __asm__ ("r3") = (num); \
register long _ret __asm__ ("r0"); \
_ret; \
})
-#define my_syscall1(num, arg1) \
+#define __nolibc_syscall1(num, arg1) \
({ \
register long _num __asm__ ("r3") = (num); \
register long _ret __asm__ ("r0"); \
_ret; \
})
-#define my_syscall2(num, arg1, arg2) \
+#define __nolibc_syscall2(num, arg1, arg2) \
({ \
register long _num __asm__ ("r3") = (num); \
register long _ret __asm__ ("r0"); \
_ret; \
})
-#define my_syscall3(num, arg1, arg2, arg3) \
+#define __nolibc_syscall3(num, arg1, arg2, arg3) \
({ \
register long _num __asm__ ("r3") = (num); \
register long _ret __asm__ ("r0"); \
_ret; \
})
-#define my_syscall4(num, arg1, arg2, arg3, arg4) \
+#define __nolibc_syscall4(num, arg1, arg2, arg3, arg4) \
({ \
register long _num __asm__ ("r3") = (num); \
register long _ret __asm__ ("r0"); \
_ret; \
})
-#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
+#define __nolibc_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
({ \
register long _num __asm__ ("r3") = (num); \
register long _ret __asm__ ("r0"); \
_ret; \
})
-#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
+#define __nolibc_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
({ \
register long _num __asm__ ("r3") = (num); \
register long _ret __asm__ ("r0"); \
#endif /* __arch64__ */
-#define my_syscall0(num) \
+#define __nolibc_syscall0(num) \
({ \
register long _num __asm__ ("g1") = (num); \
register long _arg1 __asm__ ("o0"); \
_arg1; \
})
-#define my_syscall1(num, arg1) \
+#define __nolibc_syscall1(num, arg1) \
({ \
register long _num __asm__ ("g1") = (num); \
register long _arg1 __asm__ ("o0") = (long)(arg1); \
_arg1; \
})
-#define my_syscall2(num, arg1, arg2) \
+#define __nolibc_syscall2(num, arg1, arg2) \
({ \
register long _num __asm__ ("g1") = (num); \
register long _arg1 __asm__ ("o0") = (long)(arg1); \
_arg1; \
})
-#define my_syscall3(num, arg1, arg2, arg3) \
+#define __nolibc_syscall3(num, arg1, arg2, arg3) \
({ \
register long _num __asm__ ("g1") = (num); \
register long _arg1 __asm__ ("o0") = (long)(arg1); \
_arg1; \
})
-#define my_syscall4(num, arg1, arg2, arg3, arg4) \
+#define __nolibc_syscall4(num, arg1, arg2, arg3, arg4) \
({ \
register long _num __asm__ ("g1") = (num); \
register long _arg1 __asm__ ("o0") = (long)(arg1); \
_arg1; \
})
-#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
+#define __nolibc_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
({ \
register long _num __asm__ ("g1") = (num); \
register long _arg1 __asm__ ("o0") = (long)(arg1); \
_arg1; \
})
-#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
+#define __nolibc_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
({ \
register long _num __asm__ ("g1") = (num); \
register long _arg1 __asm__ ("o0") = (long)(arg1); \
pid_t parent, ret;
parent = getpid();
- ret = my_syscall0(__NR_fork);
+ ret = __nolibc_syscall0(__NR_fork);
/* The syscall returns the parent pid in the child instead of 0 */
if (ret == parent)
pid_t parent, ret;
parent = getpid();
- ret = my_syscall0(__NR_vfork);
+ ret = __nolibc_syscall0(__NR_vfork);
/* The syscall returns the parent pid in the child instead of 0 */
if (ret == parent)
*/
#define __ARCH_WANT_SYS_OLD_SELECT
-#define my_syscall0(num) \
+#define __nolibc_syscall0(num) \
({ \
long _ret; \
register long _num __asm__ ("eax") = (num); \
_ret; \
})
-#define my_syscall1(num, arg1) \
+#define __nolibc_syscall1(num, arg1) \
({ \
long _ret; \
register long _num __asm__ ("eax") = (num); \
_ret; \
})
-#define my_syscall2(num, arg1, arg2) \
+#define __nolibc_syscall2(num, arg1, arg2) \
({ \
long _ret; \
register long _num __asm__ ("eax") = (num); \
_ret; \
})
-#define my_syscall3(num, arg1, arg2, arg3) \
+#define __nolibc_syscall3(num, arg1, arg2, arg3) \
({ \
long _ret; \
register long _num __asm__ ("eax") = (num); \
_ret; \
})
-#define my_syscall4(num, arg1, arg2, arg3, arg4) \
+#define __nolibc_syscall4(num, arg1, arg2, arg3, arg4) \
({ \
long _ret; \
register long _num __asm__ ("eax") = (num); \
_ret; \
})
-#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
+#define __nolibc_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
({ \
long _ret; \
register long _num __asm__ ("eax") = (num); \
_ret; \
})
-#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
-({ \
- long _eax = (long)(num); \
- long _arg6 = (long)(arg6); /* Always in memory */ \
- __asm__ volatile ( \
- "pushl %[_arg6]\n\t" \
- "pushl %%ebp\n\t" \
- "movl 4(%%esp),%%ebp\n\t" \
- "int $0x80\n\t" \
- "popl %%ebp\n\t" \
- "addl $4,%%esp\n\t" \
- : "+a"(_eax) /* %eax */ \
- : "b"(arg1), /* %ebx */ \
- "c"(arg2), /* %ecx */ \
- "d"(arg3), /* %edx */ \
- "S"(arg4), /* %esi */ \
- "D"(arg5), /* %edi */ \
- [_arg6]"m"(_arg6) /* memory */ \
- : "memory", "cc" \
- ); \
- _eax; \
+#define __nolibc_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
+({ \
+ long _eax = (long)(num); \
+ long _arg6 = (long)(arg6); /* Always in memory */ \
+ __asm__ volatile ( \
+ "pushl %[_arg6]\n\t" \
+ "pushl %%ebp\n\t" \
+ "movl 4(%%esp),%%ebp\n\t" \
+ "int $0x80\n\t" \
+ "popl %%ebp\n\t" \
+ "addl $4,%%esp\n\t" \
+ : "+a"(_eax) /* %eax */ \
+ : "b"(arg1), /* %ebx */ \
+ "c"(arg2), /* %ecx */ \
+ "d"(arg3), /* %edx */ \
+ "S"(arg4), /* %esi */ \
+ "D"(arg5), /* %edi */ \
+ [_arg6]"m"(_arg6) /* memory */ \
+ : "memory", "cc" \
+ ); \
+ _eax; \
})
#ifndef NOLIBC_NO_RUNTIME
*
*/
-#define my_syscall0(num) \
+#define __nolibc_syscall0(num) \
({ \
long _ret; \
register long _num __asm__ ("rax") = (num); \
_ret; \
})
-#define my_syscall1(num, arg1) \
+#define __nolibc_syscall1(num, arg1) \
({ \
long _ret; \
register long _num __asm__ ("rax") = (num); \
_ret; \
})
-#define my_syscall2(num, arg1, arg2) \
+#define __nolibc_syscall2(num, arg1, arg2) \
({ \
long _ret; \
register long _num __asm__ ("rax") = (num); \
_ret; \
})
-#define my_syscall3(num, arg1, arg2, arg3) \
+#define __nolibc_syscall3(num, arg1, arg2, arg3) \
({ \
long _ret; \
register long _num __asm__ ("rax") = (num); \
_ret; \
})
-#define my_syscall4(num, arg1, arg2, arg3, arg4) \
+#define __nolibc_syscall4(num, arg1, arg2, arg3, arg4) \
({ \
long _ret; \
register long _num __asm__ ("rax") = (num); \
_ret; \
})
-#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
+#define __nolibc_syscall5(num, arg1, arg2, arg3, arg4, arg5) \
({ \
long _ret; \
register long _num __asm__ ("rax") = (num); \
_ret; \
})
-#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
+#define __nolibc_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \
({ \
long _ret; \
register long _num __asm__ ("rax") = (num); \
static __attribute__((unused))
int sys_openat(int dirfd, const char *path, int flags, mode_t mode)
{
- return my_syscall4(__NR_openat, dirfd, path, flags, mode);
+ return __nolibc_syscall4(__NR_openat, dirfd, path, flags, mode);
}
static __attribute__((unused))
static __attribute__((unused))
int sys_open(const char *path, int flags, mode_t mode)
{
- return my_syscall4(__NR_openat, AT_FDCWD, path, flags, mode);
+ return __nolibc_syscall4(__NR_openat, AT_FDCWD, path, flags, mode);
}
static __attribute__((unused))
*
* Syscalls are split into 3 levels:
* - The lower level is the arch-specific syscall() definition, consisting in
- * assembly code in compound expressions. These are called my_syscall0() to
- * my_syscall6() depending on the number of arguments. All input arguments
+ * assembly code in compound expressions. These are called __nolibc_syscall0() to
+ * __nolibc_syscall6() depending on the number of arguments. All input arguments
* are castto a long stored in a register. These expressions always return
* the syscall's return value as a signed long value which is often either
* a pointer or the negated errno value.
*
* - The second level is mostly architecture-independent. It is made of
- * static functions called sys_<name>() which rely on my_syscallN()
+ * static functions called sys_<name>() which rely on __nolibc_syscallN()
* depending on the syscall definition. These functions are responsible
* for exposing the appropriate types for the syscall arguments (int,
* pointers, etc) and for setting the appropriate return type (often int).
t.tv_sec = timeout / 1000;
t.tv_nsec = (timeout % 1000) * 1000000;
}
- return my_syscall5(__NR_ppoll_time64, fds, nfds, (timeout >= 0) ? &t : NULL, NULL, 0);
+ return __nolibc_syscall5(__NR_ppoll_time64, fds, nfds, (timeout >= 0) ? &t : NULL, NULL, 0);
#else
struct __kernel_old_timespec t;
t.tv_sec = timeout / 1000;
t.tv_nsec = (timeout % 1000) * 1000000;
}
- return my_syscall5(__NR_ppoll, fds, nfds, (timeout >= 0) ? &t : NULL, NULL, 0);
+ return __nolibc_syscall5(__NR_ppoll, fds, nfds, (timeout >= 0) ? &t : NULL, NULL, 0);
#endif
}
static __attribute__((unused))
int sys_setns(int fd, int nstype)
{
- return my_syscall2(__NR_setns, fd, nstype);
+ return __nolibc_syscall2(__NR_setns, fd, nstype);
}
static __attribute__((unused))
static __attribute__((unused))
int sys_unshare(int flags)
{
- return my_syscall1(__NR_unshare, flags);
+ return __nolibc_syscall1(__NR_unshare, flags);
}
static __attribute__((unused))
void __stack_chk_fail(void)
{
pid_t pid;
- my_syscall3(__NR_write, STDERR_FILENO, "!!Stack smashing detected!!\n", 28);
- pid = my_syscall0(__NR_getpid);
- my_syscall2(__NR_kill, pid, SIGABRT);
+ __nolibc_syscall3(__NR_write, STDERR_FILENO, "!!Stack smashing detected!!\n", 28);
+ pid = __nolibc_syscall0(__NR_getpid);
+ __nolibc_syscall2(__NR_kill, pid, SIGABRT);
for (;;);
}
static __no_stack_protector void __stack_chk_init(void)
{
- my_syscall3(__NR_getrandom, &__stack_chk_guard, sizeof(__stack_chk_guard), 0);
+ __nolibc_syscall3(__NR_getrandom, &__stack_chk_guard, sizeof(__stack_chk_guard), 0);
/* a bit more randomness in case getrandom() fails, ensure the guard is never 0 */
if (__stack_chk_guard != (uintptr_t) &__stack_chk_guard)
__stack_chk_guard ^= (uintptr_t) &__stack_chk_guard;
static __attribute__((unused))
void *sys_brk(void *addr)
{
- return (void *)my_syscall1(__NR_brk, addr);
+ return (void *)__nolibc_syscall1(__NR_brk, addr);
}
static __attribute__((unused))
static __attribute__((unused))
int sys_chdir(const char *path)
{
- return my_syscall1(__NR_chdir, path);
+ return __nolibc_syscall1(__NR_chdir, path);
}
static __attribute__((unused))
static __attribute__((unused))
int sys_fchdir(int fildes)
{
- return my_syscall1(__NR_fchdir, fildes);
+ return __nolibc_syscall1(__NR_fchdir, fildes);
}
static __attribute__((unused))
int sys_chmod(const char *path, mode_t mode)
{
#if defined(__NR_fchmodat)
- return my_syscall4(__NR_fchmodat, AT_FDCWD, path, mode, 0);
+ return __nolibc_syscall4(__NR_fchmodat, AT_FDCWD, path, mode, 0);
#else
- return my_syscall2(__NR_chmod, path, mode);
+ return __nolibc_syscall2(__NR_chmod, path, mode);
#endif
}
int sys_chown(const char *path, uid_t owner, gid_t group)
{
#if defined(__NR_fchownat)
- return my_syscall5(__NR_fchownat, AT_FDCWD, path, owner, group, 0);
+ return __nolibc_syscall5(__NR_fchownat, AT_FDCWD, path, owner, group, 0);
#else
- return my_syscall3(__NR_chown, path, owner, group);
+ return __nolibc_syscall3(__NR_chown, path, owner, group);
#endif
}
static __attribute__((unused))
int sys_chroot(const char *path)
{
- return my_syscall1(__NR_chroot, path);
+ return __nolibc_syscall1(__NR_chroot, path);
}
static __attribute__((unused))
static __attribute__((unused))
int sys_close(int fd)
{
- return my_syscall1(__NR_close, fd);
+ return __nolibc_syscall1(__NR_close, fd);
}
static __attribute__((unused))
static __attribute__((unused))
int sys_dup(int fd)
{
- return my_syscall1(__NR_dup, fd);
+ return __nolibc_syscall1(__NR_dup, fd);
}
static __attribute__((unused))
#endif
if (old == new) {
- ret = my_syscall2(nr_fcntl, old, F_GETFD);
+ ret = __nolibc_syscall2(nr_fcntl, old, F_GETFD);
return ret < 0 ? ret : old;
}
- return my_syscall3(__NR_dup3, old, new, 0);
+ return __nolibc_syscall3(__NR_dup3, old, new, 0);
#else
- return my_syscall2(__NR_dup2, old, new);
+ return __nolibc_syscall2(__NR_dup2, old, new);
#endif
}
static __attribute__((unused))
int sys_dup3(int old, int new, int flags)
{
- return my_syscall3(__NR_dup3, old, new, flags);
+ return __nolibc_syscall3(__NR_dup3, old, new, flags);
}
static __attribute__((unused))
static __attribute__((unused))
int sys_execve(const char *filename, char *const argv[], char *const envp[])
{
- return my_syscall3(__NR_execve, filename, argv, envp);
+ return __nolibc_syscall3(__NR_execve, filename, argv, envp);
}
static __attribute__((unused))
static __attribute__((noreturn,unused))
void sys_exit(int status)
{
- my_syscall1(__NR_exit, status & 255);
+ __nolibc_syscall1(__NR_exit, status & 255);
while(1); /* shut the "noreturn" warnings. */
}
* have a different API, but most archs have the flags on first arg and
* will not use the rest with no other flag.
*/
- return my_syscall5(__NR_clone, SIGCHLD, 0, 0, 0, 0);
+ return __nolibc_syscall5(__NR_clone, SIGCHLD, 0, 0, 0, 0);
#else
- return my_syscall0(__NR_fork);
+ return __nolibc_syscall0(__NR_fork);
#endif
}
#endif
{
#if defined(__NR_clone)
/* See the note in sys_fork(). */
- return my_syscall5(__NR_clone, CLONE_VM | CLONE_VFORK | SIGCHLD, 0, 0, 0, 0);
+ return __nolibc_syscall5(__NR_clone, CLONE_VM | CLONE_VFORK | SIGCHLD, 0, 0, 0, 0);
#elif defined(__NR_vfork)
- return my_syscall0(__NR_vfork);
+ return __nolibc_syscall0(__NR_vfork);
#endif
}
#endif
static __attribute__((unused))
int sys_fsync(int fd)
{
- return my_syscall1(__NR_fsync, fd);
+ return __nolibc_syscall1(__NR_fsync, fd);
}
static __attribute__((unused))
static __attribute__((unused))
int sys_getdents64(int fd, struct linux_dirent64 *dirp, int count)
{
- return my_syscall3(__NR_getdents64, fd, dirp, count);
+ return __nolibc_syscall3(__NR_getdents64, fd, dirp, count);
}
static __attribute__((unused))
uid_t sys_geteuid(void)
{
#if defined(__NR_geteuid32)
- return my_syscall0(__NR_geteuid32);
+ return __nolibc_syscall0(__NR_geteuid32);
#else
- return my_syscall0(__NR_geteuid);
+ return __nolibc_syscall0(__NR_geteuid);
#endif
}
static __attribute__((unused))
pid_t sys_getpgid(pid_t pid)
{
- return my_syscall1(__NR_getpgid, pid);
+ return __nolibc_syscall1(__NR_getpgid, pid);
}
static __attribute__((unused))
static __attribute__((unused))
pid_t sys_getpid(void)
{
- return my_syscall0(__NR_getpid);
+ return __nolibc_syscall0(__NR_getpid);
}
static __attribute__((unused))
static __attribute__((unused))
pid_t sys_getppid(void)
{
- return my_syscall0(__NR_getppid);
+ return __nolibc_syscall0(__NR_getppid);
}
static __attribute__((unused))
static __attribute__((unused))
pid_t sys_gettid(void)
{
- return my_syscall0(__NR_gettid);
+ return __nolibc_syscall0(__NR_gettid);
}
static __attribute__((unused))
uid_t sys_getuid(void)
{
#if defined(__NR_getuid32)
- return my_syscall0(__NR_getuid32);
+ return __nolibc_syscall0(__NR_getuid32);
#else
- return my_syscall0(__NR_getuid);
+ return __nolibc_syscall0(__NR_getuid);
#endif
}
static __attribute__((unused))
int sys_kill(pid_t pid, int signal)
{
- return my_syscall2(__NR_kill, pid, signal);
+ return __nolibc_syscall2(__NR_kill, pid, signal);
}
static __attribute__((unused))
int sys_link(const char *old, const char *new)
{
#if defined(__NR_linkat)
- return my_syscall5(__NR_linkat, AT_FDCWD, old, AT_FDCWD, new, 0);
+ return __nolibc_syscall5(__NR_linkat, AT_FDCWD, old, AT_FDCWD, new, 0);
#else
- return my_syscall2(__NR_link, old, new);
+ return __nolibc_syscall2(__NR_link, old, new);
#endif
}
off_t result;
int ret;
- ret = my_syscall5(__NR_llseek, fd, offset >> 32, (uint32_t)offset, &loff, whence);
+ ret = __nolibc_syscall5(__NR_llseek, fd, offset >> 32, (uint32_t)offset, &loff, whence);
if (ret < 0)
result = ret;
else
return result;
#else
- return my_syscall3(__NR_lseek, fd, offset, whence);
+ return __nolibc_syscall3(__NR_lseek, fd, offset, whence);
#endif
}
int sys_mkdir(const char *path, mode_t mode)
{
#if defined(__NR_mkdirat)
- return my_syscall3(__NR_mkdirat, AT_FDCWD, path, mode);
+ return __nolibc_syscall3(__NR_mkdirat, AT_FDCWD, path, mode);
#else
- return my_syscall2(__NR_mkdir, path, mode);
+ return __nolibc_syscall2(__NR_mkdir, path, mode);
#endif
}
int sys_rmdir(const char *path)
{
#if defined(__NR_rmdir)
- return my_syscall1(__NR_rmdir, path);
+ return __nolibc_syscall1(__NR_rmdir, path);
#else
- return my_syscall3(__NR_unlinkat, AT_FDCWD, path, AT_REMOVEDIR);
+ return __nolibc_syscall3(__NR_unlinkat, AT_FDCWD, path, AT_REMOVEDIR);
#endif
}
long sys_mknod(const char *path, mode_t mode, dev_t dev)
{
#if defined(__NR_mknodat)
- return my_syscall4(__NR_mknodat, AT_FDCWD, path, mode, dev);
+ return __nolibc_syscall4(__NR_mknodat, AT_FDCWD, path, mode, dev);
#else
- return my_syscall3(__NR_mknod, path, mode, dev);
+ return __nolibc_syscall3(__NR_mknod, path, mode, dev);
#endif
}
static __attribute__((unused))
int sys_pipe2(int pipefd[2], int flags)
{
- return my_syscall2(__NR_pipe2, pipefd, flags);
+ return __nolibc_syscall2(__NR_pipe2, pipefd, flags);
}
static __attribute__((unused))
static __attribute__((unused))
int sys_pivot_root(const char *new, const char *old)
{
- return my_syscall2(__NR_pivot_root, new, old);
+ return __nolibc_syscall2(__NR_pivot_root, new, old);
}
static __attribute__((unused))
static __attribute__((unused))
ssize_t sys_read(int fd, void *buf, size_t count)
{
- return my_syscall3(__NR_read, fd, buf, count);
+ return __nolibc_syscall3(__NR_read, fd, buf, count);
}
static __attribute__((unused))
static __attribute__((unused))
int sys_sched_yield(void)
{
- return my_syscall0(__NR_sched_yield);
+ return __nolibc_syscall0(__NR_sched_yield);
}
static __attribute__((unused))
static __attribute__((unused))
int sys_setpgid(pid_t pid, pid_t pgid)
{
- return my_syscall2(__NR_setpgid, pid, pgid);
+ return __nolibc_syscall2(__NR_setpgid, pid, pgid);
}
static __attribute__((unused))
static __attribute__((unused))
pid_t sys_setsid(void)
{
- return my_syscall0(__NR_setsid);
+ return __nolibc_syscall0(__NR_setsid);
}
static __attribute__((unused))
int sys_symlink(const char *old, const char *new)
{
#if defined(__NR_symlinkat)
- return my_syscall3(__NR_symlinkat, old, AT_FDCWD, new);
+ return __nolibc_syscall3(__NR_symlinkat, old, AT_FDCWD, new);
#else
- return my_syscall2(__NR_symlink, old, new);
+ return __nolibc_syscall2(__NR_symlink, old, new);
#endif
}
static __attribute__((unused))
mode_t sys_umask(mode_t mode)
{
- return my_syscall1(__NR_umask, mode);
+ return __nolibc_syscall1(__NR_umask, mode);
}
static __attribute__((unused))
static __attribute__((unused))
int sys_umount2(const char *path, int flags)
{
- return my_syscall2(__NR_umount2, path, flags);
+ return __nolibc_syscall2(__NR_umount2, path, flags);
}
static __attribute__((unused))
int sys_unlink(const char *path)
{
#if defined(__NR_unlinkat)
- return my_syscall3(__NR_unlinkat, AT_FDCWD, path, 0);
+ return __nolibc_syscall3(__NR_unlinkat, AT_FDCWD, path, 0);
#else
- return my_syscall1(__NR_unlink, path);
+ return __nolibc_syscall1(__NR_unlink, path);
#endif
}
static __attribute__((unused))
ssize_t sys_write(int fd, const void *buf, size_t count)
{
- return my_syscall3(__NR_write, fd, buf, count);
+ return __nolibc_syscall3(__NR_write, fd, buf, count);
}
static __attribute__((unused))
static __attribute__((unused))
int sys_memfd_create(const char *name, unsigned int flags)
{
- return my_syscall2(__NR_memfd_create, name, flags);
+ return __nolibc_syscall2(__NR_memfd_create, name, flags);
}
static __attribute__((unused))
static __attribute__((unused))
long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
{
- return my_syscall3(__NR_ioctl, fd, cmd, arg);
+ return __nolibc_syscall3(__NR_ioctl, fd, cmd, arg);
}
#define ioctl(fd, cmd, arg) __sysret(sys_ioctl(fd, cmd, (unsigned long)(arg)))
n = __NR_mmap;
#endif
- return (void *)my_syscall6(n, addr, length, prot, flags, fd, offset);
+ return (void *)__nolibc_syscall6(n, addr, length, prot, flags, fd, offset);
}
#endif
static __attribute__((unused))
void *sys_mremap(void *old_address, size_t old_size, size_t new_size, int flags, void *new_address)
{
- return (void *)my_syscall5(__NR_mremap, old_address, old_size,
- new_size, flags, new_address);
+ return (void *)__nolibc_syscall5(__NR_mremap, old_address, old_size,
+ new_size, flags, new_address);
}
static __attribute__((unused))
static __attribute__((unused))
int sys_munmap(void *addr, size_t length)
{
- return my_syscall2(__NR_munmap, addr, length);
+ return __nolibc_syscall2(__NR_munmap, addr, length);
}
static __attribute__((unused))
int sys_mount(const char *src, const char *tgt, const char *fst,
unsigned long flags, const void *data)
{
- return my_syscall5(__NR_mount, src, tgt, fst, flags, data);
+ return __nolibc_syscall5(__NR_mount, src, tgt, fst, flags, data);
}
static __attribute__((unused))
int sys_prctl(int option, unsigned long arg2, unsigned long arg3,
unsigned long arg4, unsigned long arg5)
{
- return my_syscall5(__NR_prctl, option, arg2, arg3, arg4, arg5);
+ return __nolibc_syscall5(__NR_prctl, option, arg2, arg3, arg4, arg5);
}
static __attribute__((unused))
static __attribute__((unused))
long sys_ptrace(int op, pid_t pid, void *addr, void *data)
{
- return my_syscall4(__NR_ptrace, op, pid, addr, data);
+ return __nolibc_syscall4(__NR_ptrace, op, pid, addr, data);
}
static __attribute__((unused))
static __attribute__((unused))
ssize_t sys_getrandom(void *buf, size_t buflen, unsigned int flags)
{
- return my_syscall3(__NR_getrandom, buf, buflen, flags);
+ return __nolibc_syscall3(__NR_getrandom, buf, buflen, flags);
}
static __attribute__((unused))
static __attribute__((unused))
ssize_t sys_reboot(int magic1, int magic2, int cmd, void *arg)
{
- return my_syscall4(__NR_reboot, magic1, magic2, cmd, arg);
+ return __nolibc_syscall4(__NR_reboot, magic1, magic2, cmd, arg);
}
static __attribute__((unused))
int sys_prlimit64(pid_t pid, int resource,
const struct rlimit64 *new_limit, struct rlimit64 *old_limit)
{
- return my_syscall4(__NR_prlimit64, pid, resource, new_limit, old_limit);
+ return __nolibc_syscall4(__NR_prlimit64, pid, resource, new_limit, old_limit);
}
static __attribute__((unused))
t.tv_sec = timeout->tv_sec;
t.tv_nsec = (uint32_t)timeout->tv_usec * 1000;
}
- return my_syscall6(__NR_pselect6_time64, nfds, rfds, wfds, efds, timeout ? &t : NULL, NULL);
+ return __nolibc_syscall6(__NR_pselect6_time64, nfds, rfds, wfds, efds,
+ timeout ? &t : NULL, NULL);
#else
struct __kernel_old_timespec t;
t.tv_sec = timeout->tv_sec;
t.tv_nsec = (uint32_t)timeout->tv_usec * 1000;
}
- return my_syscall6(__NR_pselect6, nfds, rfds, wfds, efds, timeout ? &t : NULL, NULL);
+ return __nolibc_syscall6(__NR_pselect6, nfds, rfds, wfds, efds,
+ timeout ? &t : NULL, NULL);
#endif
}
int sys_statx(int fd, const char *path, int flags, unsigned int mask, struct statx *buf)
{
#ifdef __NR_statx
- return my_syscall5(__NR_statx, fd, path, flags, mask, buf);
+ return __nolibc_syscall5(__NR_statx, fd, path, flags, mask, buf);
#else
return __nolibc_enosys(__func__, fd, path, flags, mask, buf);
#endif
#define __syscall_narg(_0, _1, _2, _3, _4, _5, _6, N, ...) N
#define _syscall_narg(...) __syscall_narg(__VA_ARGS__, 6, 5, 4, 3, 2, 1, 0)
-#define _syscall(N, ...) __sysret(my_syscall##N(__VA_ARGS__))
+#define _syscall(N, ...) __sysret(__nolibc_syscall##N(__VA_ARGS__))
#define _syscall_n(N, ...) _syscall(N, __VA_ARGS__)
#define syscall(...) _syscall_n(_syscall_narg(__VA_ARGS__), ##__VA_ARGS__)
static __attribute__((unused))
int sys_timerfd_create(int clockid, int flags)
{
- return my_syscall2(__NR_timerfd_create, clockid, flags);
+ return __nolibc_syscall2(__NR_timerfd_create, clockid, flags);
}
static __attribute__((unused))
{
#if defined(__NR_timerfd_gettime64)
__nolibc_assert_time64_type(curr_value->it_value.tv_sec);
- return my_syscall2(__NR_timerfd_gettime64, fd, curr_value);
+ return __nolibc_syscall2(__NR_timerfd_gettime64, fd, curr_value);
#else
__nolibc_assert_native_time64();
- return my_syscall2(__NR_timerfd_gettime, fd, curr_value);
+ return __nolibc_syscall2(__NR_timerfd_gettime, fd, curr_value);
#endif
}
{
#if defined(__NR_timerfd_settime64)
__nolibc_assert_time64_type(new_value->it_value.tv_sec);
- return my_syscall4(__NR_timerfd_settime64, fd, flags, new_value, old_value);
+ return __nolibc_syscall4(__NR_timerfd_settime64, fd, flags, new_value, old_value);
#else
__nolibc_assert_native_time64();
- return my_syscall4(__NR_timerfd_settime, fd, flags, new_value, old_value);
+ return __nolibc_syscall4(__NR_timerfd_settime, fd, flags, new_value, old_value);
#endif
}
static __attribute__((unused))
ssize_t sys_readv(int fd, const struct iovec *iovec, int count)
{
- return my_syscall3(__NR_readv, fd, iovec, count);
+ return __nolibc_syscall3(__NR_readv, fd, iovec, count);
}
static __attribute__((unused))
static __attribute__((unused))
ssize_t sys_writev(int fd, const struct iovec *iovec, int count)
{
- return my_syscall3(__NR_writev, fd, iovec, count);
+ return __nolibc_syscall3(__NR_writev, fd, iovec, count);
}
static __attribute__((unused))
static __attribute__((unused))
int sys_uname(struct utsname *buf)
{
- return my_syscall1(__NR_uname, buf);
+ return __nolibc_syscall1(__NR_uname, buf);
}
static __attribute__((unused))
static __attribute__((unused))
int sys_waitid(int which, pid_t pid, siginfo_t *infop, int options, struct rusage *rusage)
{
- return my_syscall5(__NR_waitid, which, pid, infop, options, rusage);
+ return __nolibc_syscall5(__NR_waitid, which, pid, infop, options, rusage);
}
static __attribute__((unused))
{
#if defined(__NR_clock_getres_time64)
__nolibc_assert_time64_type(res->tv_sec);
- return my_syscall2(__NR_clock_getres_time64, clockid, res);
+ return __nolibc_syscall2(__NR_clock_getres_time64, clockid, res);
#else
__nolibc_assert_native_time64();
- return my_syscall2(__NR_clock_getres, clockid, res);
+ return __nolibc_syscall2(__NR_clock_getres, clockid, res);
#endif
}
{
#if defined(__NR_clock_gettime64)
__nolibc_assert_time64_type(tp->tv_sec);
- return my_syscall2(__NR_clock_gettime64, clockid, tp);
+ return __nolibc_syscall2(__NR_clock_gettime64, clockid, tp);
#else
__nolibc_assert_native_time64();
- return my_syscall2(__NR_clock_gettime, clockid, tp);
+ return __nolibc_syscall2(__NR_clock_gettime, clockid, tp);
#endif
}
{
#if defined(__NR_clock_settime64)
__nolibc_assert_time64_type(tp->tv_sec);
- return my_syscall2(__NR_clock_settime64, clockid, tp);
+ return __nolibc_syscall2(__NR_clock_settime64, clockid, tp);
#else
__nolibc_assert_native_time64();
- return my_syscall2(__NR_clock_settime, clockid, tp);
+ return __nolibc_syscall2(__NR_clock_settime, clockid, tp);
#endif
}
{
#if defined(__NR_clock_nanosleep_time64)
__nolibc_assert_time64_type(rqtp->tv_sec);
- return my_syscall4(__NR_clock_nanosleep_time64, clockid, flags, rqtp, rmtp);
+ return __nolibc_syscall4(__NR_clock_nanosleep_time64, clockid, flags, rqtp, rmtp);
#else
__nolibc_assert_native_time64();
- return my_syscall4(__NR_clock_nanosleep, clockid, flags, rqtp, rmtp);
+ return __nolibc_syscall4(__NR_clock_nanosleep, clockid, flags, rqtp, rmtp);
#endif
}
static __attribute__((unused))
int sys_timer_create(clockid_t clockid, struct sigevent *evp, timer_t *timerid)
{
- return my_syscall3(__NR_timer_create, clockid, evp, timerid);
+ return __nolibc_syscall3(__NR_timer_create, clockid, evp, timerid);
}
static __attribute__((unused))
static __attribute__((unused))
int sys_timer_delete(timer_t timerid)
{
- return my_syscall1(__NR_timer_delete, timerid);
+ return __nolibc_syscall1(__NR_timer_delete, timerid);
}
static __attribute__((unused))
{
#if defined(__NR_timer_gettime64)
__nolibc_assert_time64_type(curr_value->it_value.tv_sec);
- return my_syscall2(__NR_timer_gettime64, timerid, curr_value);
+ return __nolibc_syscall2(__NR_timer_gettime64, timerid, curr_value);
#else
__nolibc_assert_native_time64();
- return my_syscall2(__NR_timer_gettime, timerid, curr_value);
+ return __nolibc_syscall2(__NR_timer_gettime, timerid, curr_value);
#endif
}
{
#if defined(__NR_timer_settime64)
__nolibc_assert_time64_type(new_value->it_value.tv_sec);
- return my_syscall4(__NR_timer_settime64, timerid, flags, new_value, old_value);
+ return __nolibc_syscall4(__NR_timer_settime64, timerid, flags, new_value, old_value);
#else
__nolibc_assert_native_time64();
- return my_syscall4(__NR_timer_settime, timerid, flags, new_value, old_value);
+ return __nolibc_syscall4(__NR_timer_settime, timerid, flags, new_value, old_value);
#endif
}
static __attribute__((unused))
int sys_faccessat(int fd, const char *path, int amode, int flag)
{
- return my_syscall4(__NR_faccessat, fd, path, amode, flag);
+ return __nolibc_syscall4(__NR_faccessat, fd, path, amode, flag);
}
static __attribute__((unused))