svn commit: r268857 - head/lib/libc/gen

看板FB_svn作者時間11年前 (2014/07/19 05:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
Author: jilles Date: Fri Jul 18 21:29:59 2014 New Revision: 268857 URL: http://svnweb.freebsd.org/changeset/base/268857 Log: 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 MFC after: 1 week Modified: head/lib/libc/gen/ttyname.3 Modified: head/lib/libc/gen/ttyname.3 ============================================================================== --- head/lib/libc/gen/ttyname.3 Fri Jul 18 21:28:59 2014 (r268856) +++ head/lib/libc/gen/ttyname.3 Fri Jul 18 21:29:59 2014 (r268857) @@ -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 _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
文章代碼(AID): #1JoP9Joh (FB_svn)