sizeof is a tricky thing
source code for advanced linux programming - chapter 6 and 7