dius 0.1.0
Loading...
Searching...
No Matches
dius::system Namespace Reference

Namespaces

namespace  detail
 

Classes

class  Process
 
class  ProcessHandle
 
class  ProcessResult
 

Typedefs

using SystemCallArg = unsigned long
 
using SystemCallResult = long
 

Enumerations

enum class  Number : int {
  io_uring_enter = __NR_io_uring_enter , io_uring_setup = __NR_io_uring_setup , io_uring_register = __NR_io_uring_register , pread = __NR_pread64 ,
  pwrite = __NR_pwrite64 , read = __NR_read , write = __NR_write , close = __NR_close ,
  openat = __NR_openat , mmap = __NR_mmap , munmap = __NR_munmap , getdents64 = __NR_getdents64 ,
  fstatat64 = __NR_newfstatat , ftruncate = __NR_ftruncate , arch_prctl = __NR_arch_prctl , brk = __NR_brk ,
  exit_group = __NR_exit_group , clone3 = __NR_clone3 , execve = __NR_execve , wait4 = __NR_wait4 ,
  exit = __NR_exit , futex = __NR_futex , lseek = __NR_lseek , mknodat = __NR_mknodat ,
  mkdirat = __NR_mkdirat , bind = __NR_bind , listen = __NR_listen , ioctl = __NR_ioctl ,
  rt_sigprocmask = __NR_rt_sigprocmask , rt_sigtimedwait = __NR_rt_sigtimedwait , kill = __NR_kill , getpid = __NR_getpid ,
  clock_nanosleep = __NR_clock_nanosleep , clock_gettime = __NR_clock_gettime , setsid = __NR_setsid , dup2 = __NR_dup2
}
 

Functions

void install_dummy_signal_handler (Signal signal)
 
auto mask_signal (Signal signal) -> di::Result< void >
 
auto wait_for_signal (Signal signal) -> di::Result< Signal >
 
void exit_thread ()
 Exit the currently executing thread.
 
void exit_process (int status_code)
 
template<detail::SystemCallResult R>
auto system_call (Number number) -> di::Expected< R, di::BasicError >
 
template<detail::SystemCallResult R, detail::SystemCallArgument T1>
auto system_call (Number number, T1 &&a1) -> di::Expected< R, di::BasicError >
 
template<detail::SystemCallResult R, detail::SystemCallArgument T1, detail::SystemCallArgument T2>
auto system_call (Number number, T1 &&a1, T2 &&a2) -> di::Expected< R, di::BasicError >
 
template<detail::SystemCallResult R, detail::SystemCallArgument T1, detail::SystemCallArgument T2, detail::SystemCallArgument T3>
auto system_call (Number number, T1 &&a1, T2 &&a2, T3 &&a3) -> di::Expected< R, di::BasicError >
 
template<detail::SystemCallResult R, detail::SystemCallArgument T1, detail::SystemCallArgument T2, detail::SystemCallArgument T3, detail::SystemCallArgument T4>
auto system_call (Number number, T1 &&a1, T2 &&a2, T3 &&a3, T4 &&a4) -> di::Expected< R, di::BasicError >
 
template<detail::SystemCallResult R, detail::SystemCallArgument T1, detail::SystemCallArgument T2, detail::SystemCallArgument T3, detail::SystemCallArgument T4, detail::SystemCallArgument T5>
auto system_call (Number number, T1 &&a1, T2 &&a2, T3 &&a3, T4 &&a4, T5 &&a5) -> di::Expected< R, di::BasicError >
 
template<detail::SystemCallResult R, detail::SystemCallArgument T1, detail::SystemCallArgument T2, detail::SystemCallArgument T3, detail::SystemCallArgument T4, detail::SystemCallArgument T5, detail::SystemCallArgument T6>
auto system_call (Number number, T1 &&a1, T2 &&a2, T3 &&a3, T4 &&a4, T5 &&a5, T6 &&a6) -> di::Expected< R, di::BasicError >
 

Typedef Documentation

◆ SystemCallArg

using dius::system::SystemCallArg = unsigned long

◆ SystemCallResult

Enumeration Type Documentation

◆ Number

enum class dius::system::Number : int
strong
Enumerator
io_uring_enter 
io_uring_setup 
io_uring_register 
pread 
pwrite 
read 
write 
close 
openat 
mmap 
munmap 
getdents64 
fstatat64 
ftruncate 
arch_prctl 
brk 
exit_group 
clone3 
execve 
wait4 
exit 
futex 
lseek 
mknodat 
mkdirat 
bind 
listen 
ioctl 
rt_sigprocmask 
rt_sigtimedwait 
kill 
getpid 
clock_nanosleep 
clock_gettime 
setsid 
dup2 

Function Documentation

◆ exit_process()

void dius::system::exit_process ( int status_code)

◆ exit_thread()

void dius::system::exit_thread ( )

Exit the currently executing thread.

Warning
It is undefined behavior to call this function when there exists RAII stack-allocated variables

◆ install_dummy_signal_handler()

void dius::system::install_dummy_signal_handler ( Signal signal)

◆ mask_signal()

auto dius::system::mask_signal ( Signal signal) -> di::Result< void >

◆ system_call() [1/7]

template<detail::SystemCallResult R>
auto dius::system::system_call ( Number number) -> di::Expected<R, di::BasicError>

◆ system_call() [2/7]

template<detail::SystemCallResult R, detail::SystemCallArgument T1>
auto dius::system::system_call ( Number number,
T1 && a1 ) -> di::Expected<R, di::BasicError>

◆ system_call() [3/7]

template<detail::SystemCallResult R, detail::SystemCallArgument T1, detail::SystemCallArgument T2>
auto dius::system::system_call ( Number number,
T1 && a1,
T2 && a2 ) -> di::Expected<R, di::BasicError>

◆ system_call() [4/7]

template<detail::SystemCallResult R, detail::SystemCallArgument T1, detail::SystemCallArgument T2, detail::SystemCallArgument T3>
auto dius::system::system_call ( Number number,
T1 && a1,
T2 && a2,
T3 && a3 ) -> di::Expected<R, di::BasicError>

◆ system_call() [5/7]

template<detail::SystemCallResult R, detail::SystemCallArgument T1, detail::SystemCallArgument T2, detail::SystemCallArgument T3, detail::SystemCallArgument T4>
auto dius::system::system_call ( Number number,
T1 && a1,
T2 && a2,
T3 && a3,
T4 && a4 ) -> di::Expected<R, di::BasicError>

◆ system_call() [6/7]

template<detail::SystemCallResult R, detail::SystemCallArgument T1, detail::SystemCallArgument T2, detail::SystemCallArgument T3, detail::SystemCallArgument T4, detail::SystemCallArgument T5>
auto dius::system::system_call ( Number number,
T1 && a1,
T2 && a2,
T3 && a3,
T4 && a4,
T5 && a5 ) -> di::Expected<R, di::BasicError>

◆ system_call() [7/7]

template<detail::SystemCallResult R, detail::SystemCallArgument T1, detail::SystemCallArgument T2, detail::SystemCallArgument T3, detail::SystemCallArgument T4, detail::SystemCallArgument T5, detail::SystemCallArgument T6>
auto dius::system::system_call ( Number number,
T1 && a1,
T2 && a2,
T3 && a3,
T4 && a4,
T5 && a5,
T6 && a6 ) -> di::Expected<R, di::BasicError>

◆ wait_for_signal()

auto dius::system::wait_for_signal ( Signal signal) -> di::Result< Signal >