8498 ficl: variable 'count' might be clobbered by 'longjmp' or 'vfork'
[unleashed.git] / share / man / man3c / ptsname.3c
blob080cddac31cd0a56cd14af171f1baf99b6318505
1 '\" te
2 .\"  Copyright 1989 AT&T  Copyright (c) 2002, Sun Microsystems, Inc.  All Rights Reserved  Portions Copyright (c) 1992, X/Open Company Limited  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 PTSNAME 3C "Aug 14, 2002"
11 .SH NAME
12 ptsname \- get name of the slave pseudo-terminal device
13 .SH SYNOPSIS
14 .LP
15 .nf
16 #include <stdlib.h>
18 \fBchar *\fR\fBptsname\fR(\fBint\fR \fIfildes\fR);
19 .fi
21 .SH DESCRIPTION
22 .sp
23 .LP
24 The \fBptsname()\fR function returns the name of the slave pseudo-terminal
25 device associated with a master pseudo-terminal device. \fIfildes\fR is a file
26 descriptor returned from a successful open of the master device.
27 \fBptsname()\fR returns a pointer to a string containing the null-terminated
28 path name of the slave device of the form \fB/dev/pts/N\fR, where \fBN\fR is a
29 non-negative integer.
30 .SH RETURN VALUES
31 .sp
32 .LP
33 Upon successful completion, the function \fBptsname()\fR returns a pointer to a
34 string which is the name of the pseudo-terminal slave device. This value points
35 to a static data area that is overwritten by each call to \fBptsname()\fR. Upon
36 failure, \fBptsname()\fR returns \fINULL\fR. This could occur if \fIfildes\fR
37 is an invalid file descriptor or if  the slave device name does not exist in
38 the file system.
39 .SH ATTRIBUTES
40 .sp
41 .LP
42 See \fBattributes\fR(5) for descriptions of the following attributes:
43 .sp
45 .sp
46 .TS
47 box;
48 c | c
49 l | l .
50 ATTRIBUTE TYPE  ATTRIBUTE VALUE
52 Interface Stability     Standard
54 MT-Level        Safe
55 .TE
57 .SH SEE ALSO
58 .sp
59 .LP
60 \fBopen\fR(2), \fBgrantpt\fR(3C), \fBttyname\fR(3C), \fBunlockpt\fR(3C),
61 \fBattributes\fR(5), \fBstandards\fR(5)
62 .sp
63 .LP
64 \fISTREAMS Programming Guide\fR