"Art of Exploitation" disassembly example isn't the same (C code)
It doesn't have to be the OS difference, it's enough if you use different version of GCC to produce different machine code / assembly code.
Regarding puts
/ printf
- the compiler uses whatever it decides better (in terms of efficiency, security etc.) when you call printf
with no format, there is no need for it, so he uses puts
which is faster.