Grant access to a slave pseudo-terminal device
#include <stdlib.h> int grantpt( int fildes );
- The file descriptor of a master pseudo-terminal device.
Use the -l c option to qcc to link against this library. This library is usually included automatically.
This function is in libc.a, but not in libc.so (in order to save space).
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).
- The fildes argument isn't a valid open file descriptor.
- The fildes argument isn't associated with a master pseudo-terminal device.
- The corresponding slave pseudo-terminal device couldn't be accessed.
Last modified: 2014-06-24