Refactored to use a macro to define the syscalls.