I was given a assignment to run strace command on by hello world program and see the output, and I don't understand one thing in fstat system call.
I got to know that fstat system call should have stat buff as second argument, but here we are passing mode and size as arguments, how can this happen? and how did fstat got to know file stze?
fstat(3, {st_mode=S_IFREG|0755, st_size=2066504, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)