4#include "di/util/prelude.h"
6#include "dius/c_definitions.h"
57 concept SystemCallResult = di::concepts::ConstructibleFrom<T, dius::system::SystemCallResult>;
60template<detail::SystemCallResult R>
68 return di::Unexpected(di::BasicError(-res));
73template<detail::SystemCallResult R, detail::SystemCallArgument T1>
83 return di::Unexpected(di::BasicError(-res));
88template<detail::SystemCallResult R, detail::SystemCallArgument T1, detail::SystemCallArgument T2>
100 return di::Unexpected(di::BasicError(-res));
105template<detail::SystemCallResult R, detail::SystemCallArgument T1, detail::SystemCallArgument T2,
106 detail::SystemCallArgument T3>
120 return di::Unexpected(di::BasicError(-res));
125template<detail::SystemCallResult R, detail::SystemCallArgument T1, detail::SystemCallArgument T2,
126 detail::SystemCallArgument T3, detail::SystemCallArgument T4>
127auto system_call(
Number number, T1&& a1, T2&& a2, T3&& a3, T4&& a4) -> di::Expected<R, di::BasicError> {
142 return di::Unexpected(di::BasicError(-res));
147template<detail::SystemCallResult R, detail::SystemCallArgument T1, detail::SystemCallArgument T2,
148 detail::SystemCallArgument T3, detail::SystemCallArgument T4, detail::SystemCallArgument T5>
149auto system_call(
Number number, T1&& a1, T2&& a2, T3&& a3, T4&& a4, T5&& a5) -> di::Expected<R, di::BasicError> {
166 return di::Unexpected(di::BasicError(-res));
171template<detail::SystemCallResult R, detail::SystemCallArgument T1, detail::SystemCallArgument T2,
172 detail::SystemCallArgument T3, detail::SystemCallArgument T4, detail::SystemCallArgument T5,
173 detail::SystemCallArgument T6>
175 -> di::Expected<R, di::BasicError> {
194 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:54
Definition system_call.h:57
Definition system_call.h:52
long SystemCallResult
Definition system_call.h:50
unsigned long SystemCallArg
Definition system_call.h:49
Number
Definition system_call.h:10
@ bind
Definition system_call.h:36
@ 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
@ 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
@ close
Definition system_call.h:18
@ setsid
Definition system_call.h:45
@ listen
Definition system_call.h:37
@ execve
Definition system_call.h:29
@ brk
Definition system_call.h:26
@ 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:61