Changes the mode and ownership of a pseudo-terminal device.
#include <stdlib.h>
int grantpt ( FileDescriptor)
int FileDescriptor;
The grantpt subroutine changes the mode and the ownership of the slave pseudo-terminal associated with the master pseudo-terminal device defined by the FileDescriptor parameter. The user ID of the slave pseudo-terminal is set to the real UID of the calling process. The group ID of the slave pseudo-terminal is set to an unspecified group ID. The permission mode of the slave pseudo-terminal is set to readable and writeable by the owner, and writeable by the group.
FileDescriptor | Specifies the file descriptor of the master pseudo-terminal device. |
Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and the errno global variable is set to indicate the error.
The grantpt function may fail if:
EBADF | The fildes argument is not a valid open file descriptor. |
EINVAL | The fildes argument is not associated with a master pseudo-terminal device. |
EACCES | The corresponding slave pseudo-terminal device could not be accessed. |
This subroutine is part of Base Operating System (BOS) Runtime.
The unlockpt subroutine.
The Input and Output Handling Programmer's Overview in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs.