@Override
	public boolean handleError(PcodeExecutor<byte[]> executor, PcodeExecutionException err) {
		if (err instanceof UserError) {
			executor.getState()
					.setVar(regRAX, executor.getArithmetic()
							.fromConst(-((UserError) err).errno, regRAX.getNumBytes()));
			return true;
		}
		return false;
	}
If the error is a user error, put the errno into the machine as expected by the target
program. Here we negate the errno and put it into RAX. If it's not a user error, we return
false letting the dispatcher know it should interrupt the emulator.
Ghidra/Features/SystemEmulation/ghidra_scripts/DemoSyscallLibrary.java