summaryrefslogtreecommitdiff
path: root/usr/src/man/man3c/posix_openpt.3c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/man/man3c/posix_openpt.3c')
-rw-r--r--usr/src/man/man3c/posix_openpt.3c20
1 files changed, 3 insertions, 17 deletions
diff --git a/usr/src/man/man3c/posix_openpt.3c b/usr/src/man/man3c/posix_openpt.3c
index 716778eb21..16193b89f3 100644
--- a/usr/src/man/man3c/posix_openpt.3c
+++ b/usr/src/man/man3c/posix_openpt.3c
@@ -43,11 +43,10 @@
.\" Copyright (c) 2001, The IEEE and The Open Group. All Rights Reserved.
.\" Portions Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved.
.\"
-.TH POSIX_OPENPT 3C "Dec 1, 2003"
+.TH POSIX_OPENPT 3C "June 18, 2021"
.SH NAME
posix_openpt \- open a pseudo terminal device
.SH SYNOPSIS
-.LP
.nf
#include <stdlib.h>
#include <fcntl.h>
@@ -56,8 +55,6 @@ posix_openpt \- open a pseudo terminal device
.fi
.SH DESCRIPTION
-.sp
-.LP
The \fBposix_openpt()\fR function establishes a connection between a master
device for a pseudo-terminal and a file descriptor. The file descriptor is used
by other I/O functions that refer to that pseudo-terminal.
@@ -92,15 +89,11 @@ controlling terminal for the process.
.LP
The behavior of other values for the \fIoflag\fR argument is unspecified.
.SH RETURN VALUES
-.sp
-.LP
Upon successful completion, the \fBposix_openpt()\fR function opens a master
pseudo-terminal device and returns a non-negative integer representing the
lowest numbered unused file descriptor. Otherwise, -1 is returned and
\fBerrno\fR is set to indicate the error.
.SH ERRORS
-.sp
-.LP
The \fBposix_openpt()\fR function will fail if:
.sp
.ne 2
@@ -151,7 +144,6 @@ Out of STREAMS resources.
.RE
.SH EXAMPLES
-.LP
\fBExample 1 \fROpen a pseudo-terminal.
.sp
.LP
@@ -161,8 +153,8 @@ device and a file descriptor.
.sp
.in +2
.nf
-#include fcntl.h>
-#include stdio.h>
+#include <fcntl.h>
+#include <stdio.h>
int masterfd, slavefd;
char *slavedevice;
@@ -184,15 +176,11 @@ if (slavefd < 0)
.in -2
.SH USAGE
-.sp
-.LP
This function provides a method for portably obtaining a file descriptor of a
master terminal device for a pseudo-terminal. The \fBgrantpt\fR(3C) and
\fBptsname\fR(3C) functions can be used to manipulate mode and ownership
permissions and to obtain the name of the slave device, respectively.
.SH ATTRIBUTES
-.sp
-.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
@@ -209,7 +197,5 @@ MT-Level MT-Safe
.TE
.SH SEE ALSO
-.sp
-.LP
\fBopen\fR(2), \fBgrantpt\fR(3C), \fBptsname\fR(3C), \fBunlockpt\fR(3C),
\fBattributes\fR(5), \fBstandards\fR(5)