@PcodeUserop
	@EmuSyscall("write")
	public T unix_write(@OpState PcodeExecutorState<T> state, T fd, T bufPtr, T count) {
		PcodeArithmetic<T> arithmetic = machine.getArithmetic();
		int ifd = (int) arithmetic.toLong(fd, Purpose.OTHER);
		EmuUnixFileDescriptor<T> desc = findFd(ifd);
		AddressSpace space = machine.getLanguage().getAddressFactory().getDefaultAddressSpace();
		// TODO: Not ideal to require concrete size. What are the alternatives, though?
		// TODO: size should actually be long (size_t)
		int size = (int) arithmetic.toLong(count, Purpose.OTHER);
		T buf = state.getVar(space, bufPtr, size, true, Reason.EXECUTE_READ);
		// TODO: Write back into state? "write" shouldn't touch the buffer....
		return desc.write(buf);
	}
The UNIX {@code write} system call

@param state to receive the thread's state
@param fd the file descriptor
@param bufPtr the pointer to the buffer of data to write
@param count the number of bytes to write
@return the number of bytes successfully written
Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/emu/unix/AbstractEmuUnixSyscallUseropLibrary.java