Skip to content
Linux
Learn
Tasks
Race
Forensics
Audit
Playground
Progress
Run it
glibc
musl
aarch64
x86_64
Nothing here is graded or recorded.
Program
The program to run
#include <fcntl.h> #include <unistd.h> #include <sys/wait.h> int main(void) { int fd = open("/work/data", O_RDONLY); char buf[4]; pid_t pid = fork(); if (pid == 0) { read(fd, buf, 4); _exit(0); } int status; waitpid(pid, &status, 0); /* The parent never read a byte. Where is its cursor? */ return lseek(fd, 0, SEEK_CUR); }
Trace
Trace
Processes
Descriptors
/proc
Signals
Output
Press Run it.