Support fstat on pipes #3319
Labels
Status: Help Wanted
Well suited for community contributions
Type: Enhancement
New functionality or improved design
Milestone
Shadow's
fstat
syscall handler is in C, which only supportsRegularFile
s. This means thatfstat
in shadow currently returnsEBADF
for pipes. Shadow should properly handle pipe fds in thefstat
syscall handler. This is used by Python when the subprocess module executes programs.strace python3 -c 'import subprocess; subprocess.run(["ls", "-l", "/dev/null"], capture_output=True)'
To implement:
SyscallHandler::fstat
insrc/main/host/syscall/handler/file.rs
.struct stat
equivalent is in the linux kernel, and create bindings for it in linux-api library.struct stat
.fstat
syscall tests with pipes.Note: The
SYS_fstat
syscall calls the kernel'ssys_newfstat
on x86-64, notsys_fstat
:arch/x86/entry/syscalls/syscall_64.tbl#L16
, which should befs/stat.c#L475
.The text was updated successfully, but these errors were encountered: