Date: Sun, 8 Feb 2015 22:29:07 +0000 (UTC) From: Jilles Tjoelker <jilles@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r278417 - stable/10/lib/libc/gen Message-ID: <201502082229.t18MT7rm043328@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jilles Date: Sun Feb 8 22:29:06 2015 New Revision: 278417 URL: https://svnweb.freebsd.org/changeset/base/278417 Log: MFC r268857: ttyname(3): Fix EBADF/ENOTTY error descriptions. Also, make sure to document the return values and errors for all three functions in the man page. PR: 191931 Modified: stable/10/lib/libc/gen/ttyname.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/ttyname.3 ============================================================================== --- stable/10/lib/libc/gen/ttyname.3 Sun Feb 8 22:27:23 2015 (r278416) +++ stable/10/lib/libc/gen/ttyname.3 Sun Feb 8 22:29:06 2015 (r278417) @@ -28,7 +28,7 @@ .\" @(#)ttyname.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd May 14, 2005 +.Dd July 18, 2014 .Dt TTYNAME 3 .Os .Sh NAME @@ -76,6 +76,14 @@ function takes a buffer and length as arguments to avoid this problem. .Sh RETURN VALUES The +.Fn isatty +function returns 1 if +.Fa fd +refers to a terminal type device; +otherwise, it returns 0 and may set +.Va errno +to indicate the error. +The .Fn ttyname function returns the null terminated name if the device is found and @@ -89,15 +97,23 @@ The function returns 0 if successful. Otherwise an error number is returned. .Sh ERRORS -The -.Fn ttyname_r -may fail and return the following error codes: +These functions may fail if: .Bl -tag -width Er -.It Bq Er ENOTTY +.It Bq Er EBADF The .Fa fd argument is not a valid file descriptor. +.It Bq Er ENOTTY +The file associated with +.Fa fd +is not a terminal. +.El +.Pp +Additionally, +.Fn ttyname_r +may fail if: +.Bl -tag -width Er .It Bq Er ERANGE The .Fa bufsize
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201502082229.t18MT7rm043328>