]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/unlockpt.3
grantpt.3, ptsname.3, unlockpt.3, pts.4: Global fix: s/pty/pseudoterminal/
[thirdparty/man-pages.git] / man3 / unlockpt.3
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\" This page is in the public domain. - aeb
3 .\"
4 .TH UNLOCKPT 3 2008-06-14 "" "Linux Programmer's Manual"
5 .SH NAME
6 unlockpt \- unlock a psuedoterminal master/slave pair
7 .SH SYNOPSIS
8 .nf
9 .B #define _XOPEN_SOURCE
10 .br
11 .B #include <stdlib.h>
12 .sp
13 .BI "int unlockpt(int " fd ");"
14 .fi
15 .SH DESCRIPTION
16 The
17 .BR unlockpt ()
18 function unlocks the slave psuedoterminal device
19 corresponding to the master psuedoterminal referred to by
20 .IR fd .
21 .PP
22 .BR unlockpt ()
23 should be called before opening the slave side of a psuedoterminal.
24 .SH "RETURN VALUE"
25 When successful,
26 .BR unlockpt ()
27 returns 0.
28 Otherwise, it returns \-1 and sets
29 .I errno
30 appropriately.
31 .SH ERRORS
32 .TP
33 .B EBADF
34 The
35 .I fd
36 argument is not a file descriptor open for writing.
37 .TP
38 .B EINVAL
39 The
40 .I fd
41 argument is not associated with a master psuedoterminal.
42 .SH VERSIONS
43 .BR unlockpt ()
44 is provided in glibc since version 2.1.
45 .SH "CONFORMING TO"
46 POSIX.1-2001.
47 .SH "SEE ALSO"
48 .BR grantpt (3),
49 .BR posix_openpt (3),
50 .BR ptsname (3),
51 .BR pts (4),
52 .BR feature_test_macros (7),
53 .BR pty (7)