I'm trying to implement STRACE in c, I was able to print all the SYSCALLS with it's arguments but it doesn't look like the real STRACE ex : my strace
mmap(0x7f4a8f56a000,8192,3,2066,3,0x1c000)
Strace :
mmap(0x7fc66739a000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1c000)
I only get the flags in octal, how can I print them in a string like they do
same for structures ex : my strace
fstat(3,0x7fffd94a1ec0)
STRACE :
fstat(3, {st_mode=S_IFCHR|0660, st_rdev=makedev(0x4, 0x2), ...})
I only can print the struct address, how can I deference it correctly like they do ?.