1unlockpt(3)                Library Functions Manual                unlockpt(3)
2
3
4

NAME

6       unlockpt - unlock a pseudoterminal master/slave pair
7

LIBRARY

9       Standard C library (libc, -lc)
10

SYNOPSIS

12       #define _XOPEN_SOURCE
13       #include <stdlib.h>
14
15       int unlockpt(int fd);
16
17   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
18
19       unlockpt():
20           Since glibc 2.24:
21               _XOPEN_SOURCE >= 500
22           glibc 2.23 and earlier:
23               _XOPEN_SOURCE
24

DESCRIPTION

26       The  unlockpt() function unlocks the slave pseudoterminal device corre‐
27       sponding to the master pseudoterminal referred to by the file  descrip‐
28       tor fd.
29
30       unlockpt()  should  be  called before opening the slave side of a pseu‐
31       doterminal.
32

RETURN VALUE

34       When successful, unlockpt() returns 0.  Otherwise, it  returns  -1  and
35       sets errno to indicate the error.
36

ERRORS

38       EBADF  The fd argument is not a file descriptor open for writing.
39
40       EINVAL The fd argument is not associated with a master pseudoterminal.
41

ATTRIBUTES

43       For  an  explanation  of  the  terms  used  in  this  section,  see at‐
44       tributes(7).
45
46       ┌────────────────────────────────────────────┬───────────────┬─────────┐
47Interface                                   Attribute     Value   
48       ├────────────────────────────────────────────┼───────────────┼─────────┤
49unlockpt()                                  │ Thread safety │ MT-Safe │
50       └────────────────────────────────────────────┴───────────────┴─────────┘
51

STANDARDS

53       POSIX.1-2008.
54

HISTORY

56       glibc 2.1.  POSIX.1-2001.
57

SEE ALSO

59       grantpt(3), posix_openpt(3), ptsname(3), pts(4), pty(7)
60
61
62
63Linux man-pages 6.05              2023-07-20                       unlockpt(3)
Impressum