OSDN Git Service

(split) LDP: Change Makefile to stamp-based compilation
[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 2008-06-14 "" "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 CONFORMING TO
47 POSIX.1-2001.
48 .SH SEE ALSO
49 .BR grantpt (3),
50 .BR posix_openpt (3),
51 .BR ptsname (3),
52 .BR pts (4),
53 .BR pty (7)