Changes.old: Add missing entry in 5.13 changelog
[man-pages.git] / man3 / unlockpt.3
blob65897fcf70c8896fec8657dfcaa04d94e6b06274
1 .\" %%%LICENSE_START(PUBLIC_DOMAIN)
2 .\" This page is in the public domain. - aeb
3 .\" %%%LICENSE_END
4 .\"
5 .TH UNLOCKPT 3 2021-03-22 "" "Linux Programmer's Manual"
6 .SH NAME
7 unlockpt \- unlock a pseudoterminal master/slave pair
8 .SH SYNOPSIS
9 .nf
10 .B #define _XOPEN_SOURCE
11 .B #include <stdlib.h>
12 .PP
13 .BI "int unlockpt(int " fd ");"
14 .fi
15 .PP
16 .RS -4
17 Feature Test Macro Requirements for glibc (see
18 .BR feature_test_macros (7)):
19 .RE
20 .PP
21 .BR unlockpt ():
22 .nf
23     Since glibc 2.24:
24         _XOPEN_SOURCE >= 500
25 .\"        || (_XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED)
26     Glibc 2.23 and earlier:
27         _XOPEN_SOURCE
28 .fi
29 .SH DESCRIPTION
30 The
31 .BR unlockpt ()
32 function unlocks the slave pseudoterminal device
33 corresponding to the master pseudoterminal referred to by the file descriptor
34 .IR fd .
35 .PP
36 .BR unlockpt ()
37 should be called before opening the slave side of a pseudoterminal.
38 .SH RETURN VALUE
39 When successful,
40 .BR unlockpt ()
41 returns 0.
42 Otherwise, it returns \-1 and sets
43 .I errno
44 to indicate the error.
45 .SH ERRORS
46 .TP
47 .B EBADF
48 The
49 .I fd
50 argument is not a file descriptor open for writing.
51 .TP
52 .B EINVAL
53 The
54 .I fd
55 argument is not associated with a master pseudoterminal.
56 .SH VERSIONS
57 .BR unlockpt ()
58 is provided in glibc since version 2.1.
59 .SH ATTRIBUTES
60 For an explanation of the terms used in this section, see
61 .BR attributes (7).
62 .ad l
63 .nh
64 .TS
65 allbox;
66 lbx lb lb
67 l l l.
68 Interface       Attribute       Value
70 .BR unlockpt ()
71 T}      Thread safety   MT-Safe
72 .TE
73 .hy
74 .ad
75 .sp 1
76 .SH CONFORMING TO
77 POSIX.1-2001, POSIX.1-2008.
78 .SH SEE ALSO
79 .BR grantpt (3),
80 .BR posix_openpt (3),
81 .BR ptsname (3),
82 .BR pts (4),
83 .BR pty (7)