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