4#include "di/util/prelude.h"
6#include "dius/c_definitions.h"
63 concept SystemCallResult = di::concepts::ConstructibleFrom<T, dius::system::SystemCallResult>;
66template<detail::SystemCallResult R>
74 return di::Unexpected(di::BasicError(-res));
79template<detail::SystemCallResult R, detail::SystemCallArgument T1>
89 return di::Unexpected(di::BasicError(-res));
94template<detail::SystemCallResult R, detail::SystemCallArgument T1, detail::SystemCallArgument T2>
106 return di::Unexpected(di::BasicError(-res));
111template<detail::SystemCallResult R, detail::SystemCallArgument T1, detail::SystemCallArgument T2,
112 detail::SystemCallArgument T3>
126 return di::Unexpected(di::BasicError(-res));
131template<detail::SystemCallResult R, detail::SystemCallArgument T1, detail::SystemCallArgument T2,
132 detail::SystemCallArgument T3, detail::SystemCallArgument T4>
133auto system_call(
Number number, T1&& a1, T2&& a2, T3&& a3, T4&& a4) -> di::Expected<R, di::BasicError> {
148 return di::Unexpected(di::BasicError(-res));
153template<detail::SystemCallResult R, detail::SystemCallArgument T1, detail::SystemCallArgument T2,
154 detail::SystemCallArgument T3, detail::SystemCallArgument T4, detail::SystemCallArgument T5>
155auto system_call(
Number number, T1&& a1, T2&& a2, T3&& a3, T4&& a4, T5&& a5) -> di::Expected<R, di::BasicError> {
172 return di::Unexpected(di::BasicError(-res));
177template<detail::SystemCallResult R, detail::SystemCallArgument T1, detail::SystemCallArgument T2,
178 detail::SystemCallArgument T3, detail::SystemCallArgument T4, detail::SystemCallArgument T5,
179 detail::SystemCallArgument T6>
181 -> di::Expected<R, di::BasicError> {
200 return di::Unexpected(di::BasicError(-res));
#define DIUS_SYSTEM_CALL_ASM_ARG5
Definition arch_system_call.h:12
#define DIUS_SYSTEM_CALL_CLOBBER
Definition arch_system_call.h:15
#define DIUS_SYSTEM_CALL_ASM_ARG2
Definition arch_system_call.h:9
#define DIUS_SYSTEM_CALL_ASM_ARG1
Definition arch_system_call.h:8
#define DIUS_SYSTEM_CALL_ASM_RESULT
Definition arch_system_call.h:5
#define DIUS_SYSTEM_CALL_ASM_NUMBER
Definition arch_system_call.h:6
#define DIUS_SYSTEM_CALL_INSTRUCTION
Definition arch_system_call.h:3
#define DIUS_SYSTEM_CALL_ASM_ARG4
Definition arch_system_call.h:11
#define DIUS_SYSTEM_CALL_ASM_ARG3
Definition arch_system_call.h:10
#define DIUS_SYSTEM_CALL_ASM_ARG6
Definition arch_system_call.h:13
Definition system_call.h:60
Definition system_call.h:63
Definition system_call.h:58
long SystemCallResult
Definition system_call.h:56
unsigned long SystemCallArg
Definition system_call.h:55
Number
Definition system_call.h:10
@ pipe2
Definition system_call.h:47
@ bind
Definition system_call.h:36
@ rmdir
Definition system_call.h:50
@ rt_sigprocmask
Definition system_call.h:39
@ clone3
Definition system_call.h:28
@ pwrite
Definition system_call.h:15
@ clock_nanosleep
Definition system_call.h:43
@ mknodat
Definition system_call.h:34
@ exit_group
Definition system_call.h:27
@ uname
Definition system_call.h:52
@ pread
Definition system_call.h:14
@ wait4
Definition system_call.h:30
@ clock_gettime
Definition system_call.h:44
@ mkdirat
Definition system_call.h:35
@ io_uring_setup
Definition system_call.h:12
@ dup2
Definition system_call.h:46
@ kill
Definition system_call.h:41
@ io_uring_enter
Definition system_call.h:11
@ futex
Definition system_call.h:32
@ arch_prctl
Definition system_call.h:25
@ unlink
Definition system_call.h:51
@ close
Definition system_call.h:18
@ setsid
Definition system_call.h:45
@ listen
Definition system_call.h:37
@ execve
Definition system_call.h:29
@ chdir
Definition system_call.h:48
@ brk
Definition system_call.h:26
@ fchdir
Definition system_call.h:49
@ ioctl
Definition system_call.h:38
@ mmap
Definition system_call.h:20
@ fstatat64
Definition system_call.h:23
@ rt_sigtimedwait
Definition system_call.h:40
@ lseek
Definition system_call.h:33
@ getpid
Definition system_call.h:42
@ openat
Definition system_call.h:19
@ read
Definition system_call.h:16
@ io_uring_register
Definition system_call.h:13
@ write
Definition system_call.h:17
@ exit
Definition system_call.h:31
@ ftruncate
Definition system_call.h:24
@ getdents64
Definition system_call.h:22
@ munmap
Definition system_call.h:21
auto system_call(Number number) -> di::Expected< R, di::BasicError >
Definition system_call.h:67