openpty

Name

openpty -- find and open an available pseudo-tty

Synopsis

int openpty(int *amaster, 
	int *aslave, 
	char *name,
	struct termios *termp,
	struct winsize *winp);

Description

The openpty() function finds an available pseudo-tty and returns file descriptors for the amaster and aslave. The filename of the slave is returned in name, otherwise a null. The terminal parameters of the slave will be set to the values in termp, otherwise a null. The window size of the slave will be set to the values in winp, otherwise a null.

Return Value

On success, zero is returned. On error, -1 is returned, and errno is set appropriately.

Errors

ENOENT

There are no available ttys.