Grant access to a slave pseudo-terminal device
#include <stdlib.h> int grantpt( int fildes );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The grantpt() function changes the mode and ownership of the slave pseudo-terminal device associated with its master pseudo-terminal counterpart. The fildes argument is a file descriptor that refers to a master pseudo-terminal device. The user and group IDs of the slave are set to the real user and group IDs of the calling process. The permission mode of the slave pseudo-terminal is set to readable and writable by the owner, and writable by the group.
0, or -1 if an error occurred (errno is set).
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | No |
Thread | Yes |