TutErrNumGet


Name

TutErrNumGet — get the value of the global SmartSockets error number

Synopsis

T_INT4 TutErrNumGet() 

Arguments

None

Return Values

The value of the global SmartSockets error number.

Diagnostics

None

Description

The global SmartSockets error number is similar to the C-style error number errno. A function that returns a failure status (FALSE or NULL) often needs to provide more information to you when an error occurs. This additional error information can be accessed using TutErrNumGet.

This error number is stored in a per-thread value to accommodate multi-threaded programs.

Caution

Not all functions set the global SmartSockets error number. Therefore, TutErrNumGet may return a value that is unrelated to the previous function call. The error number can be reset using TutErrNumSet(0) before calling a function that may set the error number.

If the error number is set more than once in a function, TutErrNumGet returns only the last value set.

See Also

TutErrNumGetC, TutErrNumGetOs, TutErrNumGetSocket, TutErrNumSet, TutErrStrGet

Examples

This example prints the global SmartSockets error number and error string if a function fails:

if (TipcMsgGetPriority(msg, &priority) == FALSE) { 
  TutOut("TipcMsgGetPriority failed: error %d <%s>.\n", 
     TutErrNumGet(), TutErrStrGet()); 
} 

TIBCO SmartSockets™ Utilities
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com