Skip to content

Tag: system-calls

assembly, how to use mprotect?

I am trying to make self modifying code in Linux. I thought it would works but didn’t. I used nasm on ubuntu 18.04. INT 0x80 return value is -22 0xffffffea I don’t know what is wrong. Answer Run your program under strace, like strace ./a.out to decode system call args and return values. Probably y…

More explanation on `statfs64`

According to documentation, the structure fields explanation follows: Does “total file nodes in file system” mean how much existing files we have? Does it include directories and links? What does mean “free file nodes in fs”? What is f_spare? In some Linux forks (for example, in Androi…

Understanding read syscall

I’m reading man read manual page and discovered that it was possible to read less then the desired number of bytes passed in as a parameter: It is not an error if this number is smaller than the number of bytes requested; this may happen for example because fewer bytes are actually available right now (…