unlockpt(S-osr5)
unlockpt --
unlock a pseudo-terminal master/slave pair
Syntax
cc ...-lc
#include <stdlib.h>
int unlockpt(int fildes);
Description
The function
unlockpt(S-osr5)
clears a lock flag for the slave pseudo-terminal
associated with a master pseudo-terminal, so that the slave can be opened.
fildes is a file descriptor referring to
a master pseudo-terminal device.
Portable applications must call
unlockpt( )
before opening the slave side of a pseudo-terminal device.
Return values
On successful completion, the function
unlockpt( )
returns 0; otherwise it returns -1 and sets errno.
Diagnostics
unlockpt( )
fails if
fildes is not an open file descriptor
or is not associated with a master pseudo-terminal device.
Diagnostic codes for this function are described below.
[EBADF]-
Either the file descriptor refers to no open file, or
the routine tried to write to a read-only file.
[EINVAL]-
The file descriptor is not associated with a master pseudo-terminal device.
See also
grantpt(S-osr5),
open(S-osr5),
ptsname(S-osr5)
Standards conformance
unlockpt(S-osr5)
is
conformant with:
X/Open CAE Specification, System Interfaces and Headers, Issue 4, Version 2.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005