Previous: , Up: The termios and miscellaneous library   [Contents][Index]


5.7.4 Pseudoterminal helper procedures

Procedure: ptsmakeraw fd-or-port

Given a file descriptor or file port a pseudo-terminal device, this sets that pseudoterminal to RAW mode.

Procedure: unlockpt fd-or-port

If fd-or-port is the file descriptor or file port of a master pseudo-terminal, this unlocks the slave pseudoterminal device corresponding to the master pseudoterminal referred to by fd.

This procedure should be called before opening the slave side of a pseudoterminal.

Procedure: ptsname fd-or-port

If fd-or-port is the file descriptor or file port of a master pseudo-terminal, this returns a string that contains the name of the slave pseudo-terminal device.

Procedure: grantpt fd-or-port

If fd-or-port is the file descriptor or file port of a master pseudo-terminal,this changes the mode and permissions of the slave pseudo-terminal so that it can be used.

The procedure changes the mode and owner of the slave pseudoterminal device corresponding to the master pseudoterminal referred to by fd-or-port. The user ID of the slave is set to the real UID of the calling process. The group ID is set to an unspecified value. The mode of the slave is set to 0620 (crw–w—-).