@PcodeUserop
	@EmuSyscall("read")
	public T unix_read(@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, but gets unwieldy to leave it abstract
		int size = (int) arithmetic.toLong(count, Purpose.OTHER);
		T buf = arithmetic.fromConst(0, size);
		T result = desc.read(buf);
		int iresult = (int) arithmetic.toLong(result, Purpose.OTHER);
		state.setVar(space, bufPtr, iresult, true, buf);
		return result;
	}
The UNIX {@code read} system call

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