DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

unlockpt(S)


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

Syntax

cc ...-lc

#include <stdlib.h>

int unlockpt(int fildes);

Description

The function unlockpt(S) 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), open(S), ptsname(S)

Standards conformance

unlockpt(S) is conformant with:

X/Open CAE Specification, System Interfaces and Headers, Issue 4, Version 2.


© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003