Gcc 4.2.4 breaks on the syscall declared inside the function, move it outside and declare it static inline.