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