shadow_rs/host/syscall/handler/
fileat.rs
1use linux_api::posix_types::kernel_mode_t;
2use shadow_shim_helper_rs::syscall_types::ForeignPtr;
3
4use crate::cshadow;
5use crate::host::syscall::handler::{SyscallContext, SyscallHandler};
6use crate::host::syscall::type_formatting::SyscallStringArg;
7use crate::host::syscall::types::SyscallResult;
8
9impl SyscallHandler {
10 log_syscall!(
11 openat,
12 std::ffi::c_int,
13 std::ffi::c_int,
14 SyscallStringArg,
15 linux_api::fcntl::OFlag,
16 nix::sys::stat::Mode,
17 );
18 pub fn openat(
19 ctx: &mut SyscallContext,
20 _dir_fd: std::ffi::c_int,
21 _path: ForeignPtr<()>,
22 _flags: std::ffi::c_int,
23 _mode: kernel_mode_t,
24 ) -> SyscallResult {
25 Self::legacy_syscall(cshadow::syscallhandler_openat, ctx)
26 }
27
28 log_syscall!(faccessat, std::ffi::c_int);
29 pub fn faccessat(ctx: &mut SyscallContext) -> SyscallResult {
30 Self::legacy_syscall(cshadow::syscallhandler_faccessat, ctx)
31 }
32
33 log_syscall!(fchmodat, std::ffi::c_int);
34 pub fn fchmodat(ctx: &mut SyscallContext) -> SyscallResult {
35 Self::legacy_syscall(cshadow::syscallhandler_fchmodat, ctx)
36 }
37
38 log_syscall!(fchmodat2, std::ffi::c_int);
39 pub fn fchmodat2(ctx: &mut SyscallContext) -> SyscallResult {
40 Self::legacy_syscall(cshadow::syscallhandler_fchmodat2, ctx)
41 }
42
43 log_syscall!(fchownat, std::ffi::c_int);
44 pub fn fchownat(ctx: &mut SyscallContext) -> SyscallResult {
45 Self::legacy_syscall(cshadow::syscallhandler_fchownat, ctx)
46 }
47
48 log_syscall!(futimesat, std::ffi::c_int);
49 pub fn futimesat(ctx: &mut SyscallContext) -> SyscallResult {
50 Self::legacy_syscall(cshadow::syscallhandler_futimesat, ctx)
51 }
52
53 log_syscall!(linkat, std::ffi::c_int);
54 pub fn linkat(ctx: &mut SyscallContext) -> SyscallResult {
55 Self::legacy_syscall(cshadow::syscallhandler_linkat, ctx)
56 }
57
58 log_syscall!(mkdirat, std::ffi::c_int);
59 pub fn mkdirat(ctx: &mut SyscallContext) -> SyscallResult {
60 Self::legacy_syscall(cshadow::syscallhandler_mkdirat, ctx)
61 }
62
63 log_syscall!(mknodat, std::ffi::c_int);
64 pub fn mknodat(ctx: &mut SyscallContext) -> SyscallResult {
65 Self::legacy_syscall(cshadow::syscallhandler_mknodat, ctx)
66 }
67
68 log_syscall!(readlinkat, std::ffi::c_int);
69 pub fn readlinkat(ctx: &mut SyscallContext) -> SyscallResult {
70 Self::legacy_syscall(cshadow::syscallhandler_readlinkat, ctx)
71 }
72
73 log_syscall!(renameat, std::ffi::c_int);
74 pub fn renameat(ctx: &mut SyscallContext) -> SyscallResult {
75 Self::legacy_syscall(cshadow::syscallhandler_renameat, ctx)
76 }
77
78 log_syscall!(renameat2, std::ffi::c_int);
79 pub fn renameat2(ctx: &mut SyscallContext) -> SyscallResult {
80 Self::legacy_syscall(cshadow::syscallhandler_renameat2, ctx)
81 }
82
83 log_syscall!(symlinkat, std::ffi::c_int);
84 pub fn symlinkat(ctx: &mut SyscallContext) -> SyscallResult {
85 Self::legacy_syscall(cshadow::syscallhandler_symlinkat, ctx)
86 }
87
88 log_syscall!(unlinkat, std::ffi::c_int);
89 pub fn unlinkat(ctx: &mut SyscallContext) -> SyscallResult {
90 Self::legacy_syscall(cshadow::syscallhandler_unlinkat, ctx)
91 }
92
93 log_syscall!(utimensat, std::ffi::c_int);
94 pub fn utimensat(ctx: &mut SyscallContext) -> SyscallResult {
95 Self::legacy_syscall(cshadow::syscallhandler_utimensat, ctx)
96 }
97}