Loading...
--- Libc/Libc-391.2.5/stdlib/FreeBSD/grantpt.3
+++ Libc/Libc-320/stdlib/FreeBSD/grantpt.3
@@ -29,7 +29,7 @@
.\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
.\" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $FreeBSD: src/lib/libc/stdlib/grantpt.3,v 1.3 2003/09/14 13:41:57 ru Exp $
+.\" $FreeBSD: src/lib/libc/stdlib/grantpt.3,v 1.1 2003/01/02 20:44:41 jmallett Exp $
.\"
.Dd December 23, 2002
.Os
@@ -46,7 +46,7 @@
.In stdlib.h
.Ft int
.Fn grantpt "int fildes"
-.Ft "char *"
+.Ft char *
.Fn ptsname "int fildes"
.Ft int
.Fn unlockpt "int fildes"
@@ -71,21 +71,19 @@
function is used to establish ownership and permissions
of the slave device counterpart to the master device
specified with
-.Fa fildes .
+.Va fildes .
The slave device's ownership is set to the real user ID
of the calling process, and the permissions are set to
user readable-writable and group writable.
The group owner of the slave device is also set to the
-group
-.Dq Li tty
-if it exists on the system; otherwise, it
+group "tty" if it exists on the system; otherwise, it
is left untouched.
.Pp
The
.Fn ptsname
function returns the full pathname of the slave device
counterpart to the master device specified with
-.Fa fildes .
+.Va fildes .
This value can be used
to subsequently open the appropriate slave after
.Fn posix_openpt
@@ -97,17 +95,15 @@
.Fn unlockpt
function clears the lock held on the pseudo-terminal pair
for the master device specified with
-.Fa fildes .
+.Va fildes .
.Pp
The
.Fn posix_openpt
function opens the first available master pseudo-terminal
device and returns a descriptor to it.
-The
-.Fa mode
-argument
+.Va mode
specifies the flags used for opening the device:
-.Bl -tag -width ".Dv O_NOCTTY"
+.Bl -tag -width O_NOCTTY
.It Dv O_RDWR
Open for reading and writing.
.It Dv O_NOCTTY
@@ -115,14 +111,19 @@
the controlling terminal for the calling process.
.El
.Sh RETURN VALUES
-.Rv -std grantpt unlockpt
+The
+.Fn grantpt
+and
+.Fn unlockpt
+functions return 0 on success; otherwise -1 is returned and
+.Va errno
+is set to indicate the error.
.Pp
The
.Fn ptsname
function returns a pointer to the name
-of the slave device on success; otherwise a
-.Dv NULL
-pointer is returned and the global variable
+of the slave device on success;
+otherwise a NULL pointer is returned and
.Va errno
is set to indicate the error.
.Pp
@@ -130,7 +131,7 @@
.Fn posix_openpt
function returns a file descriptor to the first
available master pseudo-terminal device on success;
-otherwise \-1 is returned and the global variable
+otherwise -1 is returned and
.Va errno
is set to indicate the error.
.Sh ERRORS
@@ -143,8 +144,8 @@
.Va errno
to:
.Bl -tag -width Er
-.It Bq Er EINVAL
-.Fa fildes
+.It EINVAL
+.Va fildes
is not a master pseudo-terminal device.
.El
.Pp
@@ -154,7 +155,7 @@
.Va errno
to:
.Bl -tag -width Er
-.It Bq Er EACCES
+.It EACCES
The slave pseudo-terminal device could not be accessed.
.El
.Pp
@@ -164,10 +165,10 @@
.Va errno
to:
.Bl -tag -width Er
-.It Bq Er EINVAL
-.Fa mode
-consists of an invalid mode bit.
-.It Bq Er EAGAIN
+.It EINVAL
+.Va mode
+consists an an invalid mode bit.
+.It EAGAIN
The system has no available pseudo-terminal devices.
.El
.Pp
@@ -178,17 +179,15 @@
.Fn unlockpt
functions may also fail and set
.Va errno
-for any of the errors specified for the
-.Xr fstat 2
-system call.
+for any of the errors specified for the routine
+.Xr fstat 2 .
.Pp
The
.Fn posix_openpt
function may also fail and set
.Va errno
-for any of the errors specified for the
-.Xr open 2
-system call.
+for any of the errors specified for the routine
+.Xr open 2 .
.Sh SEE ALSO
.Xr open 2 ,
.Xr pty 4 ,