int openty(int ptys[2]);
This syscalls creates a pair of pseudoterminals and returns the registered
file descriptors in ptys
. Index 0
is the primary end
(also known as master), 1
is the secondary end (also known as slave).
The syscall returns 0
on success and -1
on failure, with the
following errno:
EFAULT
: ptys
points to bogus memory.
EMFILE
: No available file descriptor slots.