@Override
		public int openpty(IntByReference amaster, IntByReference aslave, Pointer name,
				Pointer termp, Pointer winp) {
			return Err.checkLt0(BARE.openpty(amaster, aslave, name, termp, winp));
		}
The bare library without error handling

<p>
For error handling, use {@link #INSTANCE}, or check for errors manually, perhaps using
{@link Err}.

<p>
We cannot just use {@code throws }{@link LastErrorException} to handle errors, because the
idiom it applies is not correct for errno on UNIX. See
https://man7.org/linux/man-pages/man3/errno.3.html, in particular:

<blockquote>The value in errno is significant only when the return value of the call
indicated an error (i.e., -1 from most system calls; -1 or NULL from most library functions);
a function that succeeds is allowed to change errno.</blockquote>

<p>
This actually happens on our test setup when invoking the native {@code openpty} from a
Docker container. It returns 0, but sets errno. JNA will incorrectly interpret this as
failure.
Ghidra/Framework/Pty/src/main/java/ghidra/pty/unix/Util.java