Loading...
--- Libc/Libc-1725.40.4/stdlib/grantpt.3
+++ Libc/Libc-1669.40.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
@@ -97,7 +97,9 @@
.Pp
The
.Fn ptsname
-function returns a pointer to the full pathname of the replica device
+and
+.Fn ptsname_r
+functions return the full pathname of the replica device
counterpart to the primary device specified with
.Fa fildes .
This value can be used
@@ -105,18 +107,11 @@
.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
@@ -154,8 +149,7 @@
.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
@@ -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
@@ -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