unlockpt(3C)


unlockpt -- unlock a pseudo-terminal master/slave pair

Synopsis

   #include <stdlib.h> 
   #include <sys/ptms.h> 
   

int unlockpt(int fildes);

Description

The function unlockpt clears a lock flag associated with the slave pseudo-terminal device associated with its master pseudo-terminal counterpart so that the slave pseudo-terminal device can be opened. fildes is a file descriptor returned from a successful open of a master pseudo-terminal device.

Return values

Upon successful completion, the function unlockpt returns 0; otherwise it returns -1.

Errors

A failure may occur if fildes is not an open file descriptor or is not associated with a master pseudo-terminal device.

References

grantpt(3C), open(2), ptsname(3C), pty(7)
30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.