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