]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/unlockpt.3
err.3: EXAMPLES: use EXIT_FAILURE rather than 1 as exit status
[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 2017-07-13 "" "Linux Programmer's Manual"
6 .SH NAME
7 unlockpt \- unlock a pseudoterminal master/slave pair
8 .SH SYNOPSIS
9 .B #define _XOPEN_SOURCE
10 .br
11 .B #include <stdlib.h>
12 .PP
13 .BI "int unlockpt(int " fd ");"
14 .PP
15 .in -4n
16 Feature Test Macro Requirements for glibc (see
17 .BR feature_test_macros (7)):
18 .in
19 .PP
20 .ad l
21 .BR unlockpt ():
22 .br
23 .RS 4
24 Since glibc 2.24:
25 _XOPEN_SOURCE\ >=\ 500 ||
26 (_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED)
27 .br
28 Glibc 2.23 and earlier:
29 _XOPEN_SOURCE
30 .RE
31 .ad
32 .SH DESCRIPTION
33 The
34 .BR unlockpt ()
35 function unlocks the slave pseudoterminal device
36 corresponding to the master pseudoterminal referred to by
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 appropriately.
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 .TS
66 allbox;
67 lb lb lb
68 l l l.
69 Interface Attribute Value
70 T{
71 .BR unlockpt ()
72 T} Thread safety MT-Safe
73 .TE
74 .SH CONFORMING TO
75 POSIX.1-2001, POSIX.1-2008.
76 .SH SEE ALSO
77 .BR grantpt (3),
78 .BR posix_openpt (3),
79 .BR ptsname (3),
80 .BR pts (4),
81 .BR pty (7)