Updated: April 19, 2023 |
Open a pseudo-terminal device
#include <stdlib.h> #include <fcntl.h> int posix_openpt( int oflag );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The posix_openpt() function establishes a connection between a master device for a pseudo-terminal and a file descriptor. The file descriptor is used by other I/O functions that refer to that pseudo-terminal.
A file descriptor for the master pseudo-terminal, or -1 if an error occurred (errno is set).
Safety: | |
---|---|
Cancellation point | Yes |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |