posix_openpt(3) - SerenityOS man pages

Name

posix_openpt - open a pseudo-terminal device

Synopsis

#include <stdlib.h>
#include <fcntl.h>

int posix_openpt(int flags);

Description

Open a pseudo-terminal master using the given flags.

The flags argument accepts a bitmask of the following flags:

Return value

On success, a pseudo-terminal device is allocated and posix_openpt() returns a file descriptor for it. Otherwise, it returns -1 and sets errno to describe the error.

Errors

Returns the same errors as open(2).

See also