summaryrefslogtreecommitdiffstats
path: root/lib/libutil/pty.3
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libutil/pty.3')
-rw-r--r--lib/libutil/pty.333
1 files changed, 17 insertions, 16 deletions
diff --git a/lib/libutil/pty.3 b/lib/libutil/pty.3
index 4af344d..dbd634b 100644
--- a/lib/libutil/pty.3
+++ b/lib/libutil/pty.3
@@ -23,13 +23,14 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id$
+.\" $Id: pty.3,v 1.1 1996/12/29 18:30:42 joerg Exp $
.\" "
.Dd December 29, 1996
.Os
.Dt PTY 3
.Sh NAME
-.Nm openpty, forkpty
+.Nm openpty ,
+.Nm forkpty
.Nd auxiliary functions to obtain a pseudo-terminal
.Sh SYNOPSIS
.Fd #include <sys/types.h>
@@ -48,7 +49,7 @@ on the
command line.
.Sh DESCRIPTION
The function
-.Nm openpty
+.Fn openpty
attempts to obtain the next available pseudo-terminal from the system (see
.Xr pty 4 ) .
If it successfully found one, it subsequently tries to change the
@@ -64,7 +65,7 @@ If the argument
.Ar name
is not
.Dv NULL ,
-.Nm openpty
+.Fn openpty
copies the pathname of the slave pty to this area. The caller is
responsible to allocate the required space in this array.
.Pp
@@ -74,20 +75,20 @@ or
.Ar winp
are not
.Dv NULL ,
-.Nm openpty
+.Fn openpty
initializes the termios and window size settings from the structures
these argument point to, respectively.
.Pp
-Upon return, the open filedescriptors for the master and slave side
+Upon return, the open file descriptors for the master and slave side
of the pty are returned in the locations pointed to by
.Ar amaster
and
.Ar aslave ,
respectively.
.Pp
-.Nm Forkpty
+.Fn Forkpty
first calls
-.Xr openpty 3
+.Fn openpty
to obtain the next available pseudo-terminal from the system. Upon success,
it forks off a new process. In the child process, it closes the descriptor
for the master side of the pty, and calls
@@ -100,24 +101,24 @@ slave side of the pty. The arguments
and
.Ar winp
have the same meaning as described for
-.Nm openpty .
+.Fn openpty .
.Sh RETURN VALUES
-.Nm Openpty
+.Fn Openpty
returns 0 on success, or -1 on failure.
.Pp
-.Nm Forkpty
+.Fn Forkpty
returns -1 on failure, 0 in the slave process, and the process ID of the
slave process in the parent process.
.Sh ERRORS
On failure,
-.Nm openpty
+.Fn openpty
will set the global variable
.Dv errno
to
.Er ENOENT .
.Pp
In addition to this,
-.Nm forkpty
+.Fn forkpty
may set it to any value as described for
.Xr fork 2 .
.Sh SEE ALSO
@@ -134,10 +135,10 @@ may set it to any value as described for
.Sh BUGS
The calling process must have an effective UID of super-user in order
to perform all the intended actions. No notification will occur if
-.Nm openpty
+.Fn openpty
or
-.Nm forkpty
+.Fn forkpty
failed to proceed with one of the described steps, as long as they could
at least allocate the pty at all (and create the new process in the case
of
-.Nm forkpty ) .
+.Fn forkpty ) .
OpenPOWER on IntegriCloud