Tcl Library Procedures Tcl_SetErrno(3TCL)
_________________________________________________________________
NAME
Tcl_SetErrno, Tcl_GetErrno, Tcl_ErrnoId, Tcl_ErrnoMsg -
manipulate errno to store and retrieve error codesSYNOPSIS
#include
voidTcl_SetErrno(errorCode)
intTcl_GetErrno()
CONST char *Tcl_ErrnoId()
CONST char *Tcl_ErrnoMsg(errorCode)
ARGUMENTS int errorCode (in) A POSIX error code such as ENOENT._________________________________________________________________
DESCRIPTION
Tcl_SetErrno and Tcl_GetErrno provide portable access to the
errno variable, which is used to record a POSIX error codeafter system calls and other operations such as Tcl_Gets.
These procedures are necessary because global variable accesses cannot be made across module boundaries on some platforms.Tcl_SetErrno sets the errno variable to the value of the
errorCode argument C procedures that wish to return error information to their callers via errno should callTcl_SetErrno rather than setting errno directly.
Tcl_GetErrno returns the current value of errno. Procedures
wishing to access errno should call this procedure instead of accessing errno directly.Tcl_ErrnoId and Tcl_ErrnoMsg return string representations
of errno values. Tcl_ErrnoId returns a machine-readable
textual identifier such as "EACCES" that corresponds to thecurrent value of errno. Tcl_ErrnoMsg returns a human-
readable string such as "permission denied" that correspondsto the value of its errorCode argument. The errorCode argu-
ment is typically the value returned by Tcl_GetErrno. The
Tcl Last change: 8.3 1Tcl Library Procedures Tcl_SetErrno(3TCL)
strings returned by these functions are statically allocated and the caller must not free or modify them. KEYWORDS errno, error code, global variablesATTRIBUTES
See attributes(5) for descriptions of the following attri-
butes:_______________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE|
|____________________|__________________|_
| Availability | runtime/tcl-8 |
|____________________|__________________|_
| Interface Stability| Uncommitted ||____________________|_________________|
NOTES Source for Tcl is available on http://opensolaris.org. Tcl Last change: 8.3 2