replace the system calls with macro