Converted mycat to system calls. Still have to change error message to system call