unlockpt()

Unlock a pseudo-terminal master/slave pair

Synopsis:

#include <stdlib.h>

int unlockpt( int fildes );

Arguments:

fildes
The file descriptor for the master pseudo-terminal.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Note: This function is in libc.a, but not in libc.so (in order to save space).

Description:

The unlockpt() function unlocks the slave pseudo-terminal device associated with the master to which fildes refers. Call unlockpt() before you open the slave side of a pseudo-terminal device.

Returns:

0, or -1 if an error occurred (errno is set).

Errors:

EBADF
The fildes argument isn't a file descriptor open for writing.
EINTR
The call was interrupted by a signal.
EINVAL
The fildes argument isn't associated with a master pseudo-terminal device.

Classification:

POSIX 1003.1

Safety:  
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes