Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > P

posix_openpt(3C)

HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

posix_openpt() — open a pseudo-terminal master device

SYNOPSIS

#include <stdlib.h> #include <fcntl.h> int posix_openpt(int oflag);

Parameters

oflag

indicates the file status flags and file access modes of the open file description. Values for oflag are constructed by a bitwise-inclusive OR of flags from the following list, defined in <fcntl.h>:

O_RDWR

Open for reading and writing.

O_NOCTTY

If set posix_openpt() will not cause the terminal device to become the controlling terminal for the process.

DESCRIPTION

The posix_openpt() function establishes a connection between a master device for a pseudo-terminal and a file descriptor. This file descriptor can be used to refer that device. The file status flags and file access modes of the opened file descriptor will be set according to the value of oflag.

RETURN VALUE

Upon successful completion posix_openpt() opens a master pseudo-terminal device and returns a non-negative integer representing the lowest numbered unused file descriptor. Otherwise, posix_openpt() returns -1 and errno is set to indicate the error.

ERRORS

On failure posix_openpt() sets one of the following values for errno:

EMFILE

OPEN_MAX file descriptors are currently open in the calling process.

ENFILE

The maximum allowable number of files are currently open on the system.

EINVAL

The value of oflag is not valid.

EAGAIN

Out of pseudo-terminal resources.

ENOSR

Out of STREAMS resources.

AUTHOR

posix_openpt() was developed by HP.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.