]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/unlockpt.3
Added SEE ALSO for pty.7
[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 "2003-01-30" "PTY Control" "Linux Programmer's Manual"
5 .SH NAME
6 unlockpt \- unlock a pseudo-terminal 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 .IR unlockpt ()
18 function unlocks the slave pseudo-terminal device
19 (pty) corresponding to the master pty referred to by
20 .IR fd .
21 .PP
22 .IR unlockpt ()
23 should be called before opening the slave side of a pty.
24 .SH "RETURN VALUE"
25 When successful,
26 .IR unlockpt ()
27 returns 0. Otherwise, it returns \-1 and sets
28 .I errno
29 appropriately.
30 .SH ERRORS
31 .TP
32 .B EBADF
33 The
34 .I fd
35 argument is not a file descriptor open for writing.
36 .TP
37 .B EINVAL
38 The
39 .I fd
40 argument is not associated with a master pty.
41 .SH "CONFORMING TO"
42 POSIX 1003.1-2001.
43 .SH "SEE ALSO"
44 .IR grantpt (3),
45 .BR posix_openpt (3),
46 .IR ptsname (3),
47 .BR pts (4),
48 .BR pty (7)