OPENPTY(3)

NAME
openpty - library call to obtain a pty

SYNOPSIS
#include <libutil.h>
int openpty(int *amaster, int *aslave, char *name, struct termios *termp, struct winsize *winp)

DESCRIPTION
Openpty tries to obtain pty file descriptors by opening /dev/ttypX and /dev/ptypX, setting *amaster and *aslave to these fd's, changing ownership of the slave pty to the current process, and making it only group-writable by group tty.