xref: /netbsd-src/lib/libc/stdlib/unlockpt.3 (revision 11a6dbe72840351315e0652b2fc6663628c84cad)
1*11a6dbe7Smartin.\" $NetBSD: unlockpt.3,v 1.4 2008/04/30 13:10:51 martin Exp $
2892ad9caSchristos.\"
3892ad9caSchristos.\" Copyright (c) 2004 The NetBSD Foundation, Inc.
4892ad9caSchristos.\" All rights reserved.
5892ad9caSchristos.\"
6892ad9caSchristos.\" This code is derived from software contributed to The NetBSD Foundation
7892ad9caSchristos.\" by Christos Zoulas.
8892ad9caSchristos.\"
9892ad9caSchristos.\" Redistribution and use in source and binary forms, with or without
10892ad9caSchristos.\" modification, are permitted provided that the following conditions
11892ad9caSchristos.\" are met:
12892ad9caSchristos.\" 1. Redistributions of source code must retain the above copyright
13892ad9caSchristos.\"    notice, this list of conditions and the following disclaimer.
14892ad9caSchristos.\" 2. Redistributions in binary form must reproduce the above copyright
15892ad9caSchristos.\"    notice, this list of conditions and the following disclaimer in the
16892ad9caSchristos.\"    documentation and/or other materials provided with the distribution.
17892ad9caSchristos.\"
18892ad9caSchristos.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19892ad9caSchristos.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20892ad9caSchristos.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21892ad9caSchristos.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22892ad9caSchristos.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23892ad9caSchristos.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24892ad9caSchristos.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25892ad9caSchristos.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26892ad9caSchristos.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27892ad9caSchristos.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28892ad9caSchristos.\" POSSIBILITY OF SUCH DAMAGE.
29892ad9caSchristos.\"
30892ad9caSchristos.Dd May 25, 2004
31508c6e77Swiz.Dt UNLOCKPT 3
32892ad9caSchristos.Os
33892ad9caSchristos.Sh NAME
34892ad9caSchristos.Nm unlockpt
35892ad9caSchristos.Nd unlock the slave pseudo-terminal device
36892ad9caSchristos.Sh LIBRARY
37892ad9caSchristos.Lb libc
38892ad9caSchristos.Sh SYNOPSIS
39892ad9caSchristos.In stdlib.h
40892ad9caSchristos.Ft int
41892ad9caSchristos.Fn unlockpt "int fildes"
42892ad9caSchristos.Sh DESCRIPTION
43892ad9caSchristosThe
44892ad9caSchristos.Fn unlockpt
45892ad9caSchristosunlocks access to the pseudo-terminal device corresponding to the
46892ad9caSchristosmaster pseudo-terminal device associated with
47892ad9caSchristos.Fa fildes .
48892ad9caSchristosConforming applications must call this function before opening the
49892ad9caSchristosslave pseudo-terminal device.
50892ad9caSchristos.Sh RETURN VALUES
51892ad9caSchristosIf successful,
52892ad9caSchristos.Fn unlockpt
53508c6e77Swizreturns 0; otherwise a value of \-1 is returned and
54892ad9caSchristos.Va errno
55892ad9caSchristosis set to indicate the error.
56892ad9caSchristos.Sh ERRORS
57892ad9caSchristosThe
58892ad9caSchristos.Fn unlockpt
59892ad9caSchristosfunction will fail if:
60892ad9caSchristos.Bl -tag -width Er
61892ad9caSchristos.It Bq Er EACCESS
62892ad9caSchristosthe corresponding pseudo-terminal device could not be accessed.
63892ad9caSchristos.It Bq Er EBADF
64892ad9caSchristos.Fa fildes
65892ad9caSchristosis not a valid descriptor.
66892ad9caSchristos.It Bq Er EINVAL
67892ad9caSchristos.Fa fildes
68892ad9caSchristosis not associated with a master pseudo-terminal device.
69892ad9caSchristos.El
70892ad9caSchristos.Sh NOTES
71892ad9caSchristosIn
72892ad9caSchristos.Nx
73892ad9caSchristos.Fn unlockpt
74892ad9caSchristosdoes nothing.
75892ad9caSchristos.Sh SEE ALSO
76892ad9caSchristos.Xr ioctl 2 ,
77892ad9caSchristos.Xr grantpt 3 ,
78892ad9caSchristos.Xr posix_openpt 3 ,
79892ad9caSchristos.Xr ptsname 3
80892ad9caSchristos.Sh STANDARDS
81892ad9caSchristosThe
82892ad9caSchristos.Fn unlockpt
83892ad9caSchristosfunction conforms to
84892ad9caSchristos.St -p1003.1-2001 .
85892ad9caSchristosIts first release was in
86892ad9caSchristos.St -xpg4.2 .
87