t_error.3xti
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 3XTI 代码 · 共 87 行
3XTI
87 行
.TH t_error 3xti.SH Namet_error \- produces error message .SH Syntax .B #include <xti.h>.br.sp 1.B int t_error(\fIerrmsg\fB).br.B char \fI*errmsg\fB;.br.B extern char \fI*t_errlist[]\fB;.br.B extern int \fIt_nerr\fB;.SH Arguments.IP \fIerrmsg\fR 10Is a user-supplied error message that gives context to the error..SH DescriptionThe .PN t_error()function produces a message on the standard erroroutput that describes the last error encountered during a call to atransport function. .NXR "t_error system function".NXR "error messages" "transport function".PPThe .PN t_error()function prints the user-supplied error messagefollowed by a colon and a standard error message for the current errordefined in \fBt_errno\fR. If \fBt_errno\fR is [TSYSERR],.PN t_error()also prints a standard message for the current valuecontained in \fBerrno\fR. .PPTo simplify variant formatting of messages, the array of message strings\fBt_errlist\fR is provided: \fBt_errno\fR can be used as an index inthis table to get the message string without the newline. The\fIt_nerr\fR is the largest message number provided for in the\fIt_errlist\fR table. .PPThe \fBt_errno\fR variable is set only when an error occurs and is notcleared on successful calls..PP.TStab(@);lfHB lfHB lfHBlfR lfR lfR ._.sp 4pParameters@Before Call@After Call.sp 4p_.sp 6perrmsg@x@/.sp 6p_.TE.PP.sp 12p.SH ExamplesIf a .PN t_connect() function fails on transport endpoint \fIfd2\fRbecause a bad address was given, the following call may followthe failure:.EXt_error ("t_connect failed on fd"):.EE.PPThe diagnostic message to be printed would look like:.EXt_connect failed on fd2: Incorrect transport address format.EEwhere "Incorrect transport address format" identifies the specific errorthat occurred, and "t_connect failed on fd2" tells the userwhich function failed on which transport endpoint..SH Return ValuesUpon successful completion, a value of 0 is returned. On failure, avalue of \-1 is returned, and \fBt_errno\fR is set to indicate theerror..SH DiagnosticsOn failure, \fBt_errno\fR is set to the following:.TP 20[TNOTSUPPORT]This function is not supported by the current implementation of XTI.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?