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