Loading...
--- Libc/Libc-1725.40.4/stdlib/grantpt.3
+++ Libc/Libc-1353.11.2/stdlib/grantpt.3
@@ -31,7 +31,7 @@
.\"
.\" $FreeBSD: src/lib/libc/stdlib/grantpt.3,v 1.3 2003/09/14 13:41:57 ru Exp $
.\"
-.Dd June 17, 2025
+.Dd February 2, 2005
.Os
.Dt GRANTPT 3
.Sh NAME
@@ -77,57 +77,52 @@
.Fn posix_openpt
functions allow access to pseudo-terminal devices.
The first four functions accept a file descriptor
-that references the primary half of a pseudo-terminal pair.
+that references the master half of a pseudo-terminal pair.
This file descriptor is created with
.Fn posix_openpt .
.Pp
The
.Fn grantpt
function is used to establish ownership and permissions
-of the replica device counterpart to the primary device
+of the slave device counterpart to the master device
specified with
.Fa fildes .
-The replica device's ownership is set to the real user ID
+The slave device's ownership is set to the real user ID
of the calling process; its permissions are set to
user readable-writable and group writable.
-The group owner of the replica device is also set to the group
+The group owner of the slave device is also set to the group
.Dq Li tty
if it exists on the system; otherwise, it
is left untouched.
.Pp
The
.Fn ptsname
-function returns a pointer to the full pathname of the replica device
-counterpart to the primary device specified with
+and
+.Fn ptsname_r
+functions return the full pathname of the slave device
+counterpart to the master device specified with
.Fa fildes .
This value can be used
-to subsequently open the appropriate replica after
+to subsequently open the appropriate slave after
.Fn posix_openpt
and
.Fn grantpt
-have been called.
-The
+have been called. The
.Fn ptsname
-function is not guaranteed to be reentrant or thread safe.
-The
-.Fn ptsname_r
-function stores the full pathname of the replica device in the
-buffer pointed to by its
-.Fa buffer
-argument, up to a maximum length of
-.Fa buflen
-including the terminating NUL.
+function is not guaranteed to be reentrant or thread safe. The
+.Fn ptsname_r
+function takes a buffer and length as arguments to avoid this problem.
.Pp
The
.Fn unlockpt
-function unlocks the replica pseudo-terminal device associated
-with the primary device to which
+function unlocks the slave pseudo-terminal device associated
+with the master device to which
.Fa fildes
refers.
.Pp
The
.Fn posix_openpt
-function opens the first available primary pseudo-terminal
+function opens the first available master pseudo-terminal
device and returns a descriptor to it.
The
.Fa oflag
@@ -146,7 +141,7 @@
The
.Fn ptsname
function returns a pointer to the name
-of the replica device on success; otherwise a
+of the slave device on success; otherwise a
.Dv NULL
pointer is returned and the global variable
.Va errno
@@ -154,15 +149,14 @@
.Pp
The
.Fn ptsname_r
-function returns 0 if successful.
-On failure, it returns -1 and the global variable
+function returns 0 if successful. On failure, it returns -1 and the global variable
.Va errno
is set to indicate the error.
.Pp
The
.Fn posix_openpt
function returns a file descriptor to the first
-available primary pseudo-terminal device on success;
+available master pseudo-terminal device on success;
otherwise \-1 is returned and the global variable
.Va errno
is set to indicate the error.
@@ -179,7 +173,7 @@
.Bl -tag -width Er
.It Bq Er EINVAL
.Fa fildes
-is not a primary pseudo-terminal device.
+is not a master pseudo-terminal device.
.El
.Pp
In addition, the
@@ -190,16 +184,14 @@
.Bl -tag -width Er
.It Bq Er EINVAL
The
-.Fa buffer
-argument is
-.Dv NULL .
+.Va buffer
+argument is NULL.
.El
.Bl -tag -width Er
.It Bq Er ERANGE
The
-.Fa buflen
-argument is smaller than the length of the string to be returned,
-including the terminating NUL.
+.Va bufsize
+argument is smaller than the length of the string to be returned.
.El
.Pp
In addition, the
@@ -209,7 +201,7 @@
to:
.Bl -tag -width Er
.It Bq Er EACCES
-The replica pseudo-terminal device could not be accessed.
+The slave pseudo-terminal device could not be accessed.
.El
.Pp
The
@@ -223,12 +215,6 @@
consists of an invalid mode bit.
.It Bq Er EAGAIN
The system has no available pseudo-terminal devices.
-.It Bq Er ENXIO
-The
-.Xr sysctl 3
-limit
-.Dq kern.tty.ptmx_max
-number of pseudo-terminal devices was reached.
.El
.Pp
The
@@ -281,7 +267,6 @@
.Fc ;
.Sh SEE ALSO
.Xr open 2 ,
-.Xr sysctl 3 ,
.Xr pty 4 ,
.Xr tty 4 ,
.Xr compat 5