OSDN Git Service

577f9e4dedd4d1c809102920c988cfaf5419b241
[linuxjm/LDP_man-pages.git] / original / 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 2013-12-09 "" "Linux Programmer's Manual"
6 .SH NAME
7 unlockpt \- unlock a pseudoterminal master/slave pair
8 .SH SYNOPSIS
9 .nf
10 .BR "#define _XOPEN_SOURCE" "       /* See feature_test_macros(7) */"
11 .br
12 .B #include <stdlib.h>
13 .sp
14 .BI "int unlockpt(int " fd ");"
15 .fi
16 .SH DESCRIPTION
17 The
18 .BR unlockpt ()
19 function unlocks the slave pseudoterminal device
20 corresponding to the master pseudoterminal referred to by
21 .IR fd .
22 .PP
23 .BR unlockpt ()
24 should be called before opening the slave side of a pseudoterminal.
25 .SH RETURN VALUE
26 When successful,
27 .BR unlockpt ()
28 returns 0.
29 Otherwise, it returns \-1 and sets
30 .I errno
31 appropriately.
32 .SH ERRORS
33 .TP
34 .B EBADF
35 The
36 .I fd
37 argument is not a file descriptor open for writing.
38 .TP
39 .B EINVAL
40 The
41 .I fd
42 argument is not associated with a master pseudoterminal.
43 .SH VERSIONS
44 .BR unlockpt ()
45 is provided in glibc since version 2.1.
46 .SH ATTRIBUTES
47 .SS Multithreading (see pthreads(7))
48 The
49 .BR unlockpt ()
50 function is thread-safe.
51 .SH CONFORMING TO
52 POSIX.1-2001.
53 .SH SEE ALSO
54 .BR grantpt (3),
55 .BR posix_openpt (3),
56 .BR ptsname (3),
57 .BR pts (4),
58 .BR pty (7)
59 .SH COLOPHON
60 This page is part of release 3.67 of the Linux
61 .I man-pages
62 project.
63 A description of the project,
64 information about reporting bugs,
65 and the latest version of this page,
66 can be found at
67 \%http://www.kernel.org/doc/man\-pages/.