write system call