def sys_write(self, fd, buf, count):
data: bytes = bytes()<EOL>cpu = self.current<EOL>if count != <NUM_LIT:0>:<EOL><INDENT>try:<EOL><INDENT>write_fd = self._get_fd(fd)<EOL><DEDENT>except FdError as e:<EOL><INDENT>logger.error(f"<STR_LIT>")<EOL>return -e.err<EOL><DEDENT>if buf not in cpu.memory or buf + count not in cpu.memory:<EOL><INDENT>logger.debug("<STR_LIT>")<EOL>return -errno.EFAULT<EOL><DEDENT>if fd > <NUM_LIT:2> and write_fd.is_full():<EOL><INDENT>cpu.PC -= cpu.instruction.size<EOL>self.wait([], [fd], None)<EOL>raise RestartSyscall()<EOL><DEDENT>data: MixedSymbolicBuffer = cpu.read_bytes(buf, count)<EOL>data: bytes = self._transform_write_data(data)<EOL>write_fd.write(data)<EOL>for line in data.split(b'<STR_LIT:\n>'):<EOL><INDENT>line = line.decode('<STR_LIT>')  <EOL>logger.debug(f"<STR_LIT>")<EOL><DEDENT>self.syscall_trace.append(("<STR_LIT>", fd, data))<EOL>self.signal_transmit(fd)<EOL><DEDENT>return len(data)<EOL>
write - send bytes through a file descriptor
          The write system call writes up to count bytes from the buffer pointed
          to by buf to the file descriptor fd. If count is zero, write returns 0
          and optionally sets *tx_bytes to zero.

          :param fd            a valid file descriptor
          :param buf           a memory buffer
          :param count         number of bytes to send
          :return: 0          Success
                    EBADF      fd is not a valid file descriptor or is not open.
                    EFAULT     buf or tx_bytes points to an invalid address.