1502 Remove conversion cruft from manpages
[unleashed.git] / usr / src / man / man3c / getpass.3c
blobe5bdc53992e8a48269193b96918996f8163c097a
1 '\" te
2 .\"  Copyright 1989 AT&T  Copyright (c) 1992, X/Open Company Limited  All Rights Reserved  Portions Copyright (c) 2003, Sun Microsystems, Inc.  All Rights Reserved.
3 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
4 .\" http://www.opengroup.org/bookstore/.
5 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
6 .\"  This notice shall appear on any product containing this material.
7 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
8 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
9 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
10 .TH GETPASS 3C "Sep 2, 2003"
11 .SH NAME
12 getpass, getpassphrase \- read a string of characters without echo
13 .SH SYNOPSIS
14 .LP
15 .nf
16 #include <stdlib.h>
18 \fBchar *\fR\fBgetpass\fR(\fBconst char *\fR\fIprompt\fR);
19 .fi
21 .LP
22 .nf
23 \fBchar *\fR\fBgetpassphrase\fR(\fBconst char *\fR\fIprompt\fR);
24 .fi
26 .SS "XPG4, SUS, SUSv2"
27 .LP
28 .nf
29 #include <unistd.h>
31 \fBchar *\fR\fBgetpass\fR(\fBconst char *\fR\fIprompt\fR);
32 .fi
34 .SH DESCRIPTION
35 .sp
36 .LP
37 The \fBgetpass()\fR function opens the process's controlling terminal, writes
38 to that device the null-terminated string \fIprompt\fR, disables echoing, reads
39 a string of characters up to the next newline character or EOF, restores the
40 terminal state and closes the terminal.
41 .sp
42 .LP
43 The \fBgetpassphrase()\fR function is identical to \fBgetpass()\fR, except that
44 it reads and returns a string of up to 257 characters in length.
45 .SH RETURN VALUES
46 .sp
47 .LP
48 Upon successful completion, \fBgetpass()\fR returns a pointer to a
49 null-terminated string of at most 9 bytes that were read from the terminal
50 device. If an error is encountered, the terminal state is restored and a null
51 pointer is returned.
52 .SH ERRORS
53 .sp
54 .LP
55 The \fBgetpass()\fR and  \fBgetpassphrase()\fR functions may fail if:
56 .sp
57 .ne 2
58 .na
59 \fB\fBEINTR\fR\fR
60 .ad
61 .RS 10n
62 The function was interrupted by a signal.
63 .RE
65 .sp
66 .ne 2
67 .na
68 \fB\fBEIO\fR\fR
69 .ad
70 .RS 10n
71 The process is a member of a background process attempting to read from its
72 controlling terminal, the process is ignoring or blocking the \fBSIGTTIN\fR
73 signal or the process group is orphaned.
74 .RE
76 .sp
77 .ne 2
78 .na
79 \fB\fBEMFILE\fR\fR
80 .ad
81 .RS 10n
82 \fBOPEN_MAX\fR file descriptors are currently open in the calling process.
83 .RE
85 .sp
86 .ne 2
87 .na
88 \fB\fBENFILE\fR\fR
89 .ad
90 .RS 10n
91 The maximum allowable number of files is currently open in the system.
92 .RE
94 .sp
95 .ne 2
96 .na
97 \fB\fBENXIO\fR\fR
98 .ad
99 .RS 10n
100 The process does not have a controlling terminal.
103 .SH USAGE
106 The return value points to static data whose content may be overwritten by each
107 call.
108 .SH ATTRIBUTES
111 See \fBattributes\fR(5) for descriptions of the following attributes:
116 box;
117 c | c
118 l | l .
119 ATTRIBUTE TYPE  ATTRIBUTE VALUE
121 Interface Stability     \fBgetpass()\fR is Standard.
123 MT-Level        Unsafe
126 .SH SEE ALSO
129 \fBattributes\fR(5), \fBstandards\fR(5)