open a pseudo-terminal device
() function finds the next
available pseudo-terminal and returns an open file descriptor for its master
device. The path name of the slave device may be determined via the
() function. Note that the
() functions should be called before
opening the slave device.
argument is formed by
bitwise-inclusive OR'ing the following values defined in
- Open for reading and writing.
- Prevent the device from being made the controlling terminal
for the session. This flag has no effect on
OpenBSD and is included for compatibility with
flag must be specified in
contains values other than those listed
() will return an error.
If successful, posix_openpt
() returns a
non-negative integer, the file descriptor for the pseudo-terminal master
device. Otherwise, a value of -1 is returned and
is set to indicate the error.
() function will fail if:
- The per-process descriptor table is full.
- The system file table is full.
- The value of oflag is not
() function conforms to
IEEE Std 1003.1-2001
() function appeared in