Tcl_SetErrno(3) Tcl Library Procedures Tcl_SetErrno(3) ______________________________________________________________________________ NAME Tcl_SetErrno, Tcl_GetErrno, Tcl_ErrnoId, Tcl_ErrnoMsg - manipulate errno to store and retrieve error(8,n) codes SYNOPSIS #include <tcl.h> void Tcl_SetErrno(errorCode) int Tcl_GetErrno() CONST char * Tcl_ErrnoId() CONST char * Tcl_ErrnoMsg(errorCode) ARGUMENTS int errorCode (in(1,8)) A POSIX error(8,n) code such as ENOENT. _________________________________________________________________ DESCRIPTION Tcl_SetErrno and Tcl_GetErrno provide portable access(2,5) to the errno variable, which is used to record a POSIX error(8,n) code after system calls and other operations such as Tcl_Gets. These procedures are necessary because global variable accesses cannot be made across module bound- aries on some platforms. Tcl_SetErrno sets the errno variable to the value of the errorCode argument C procedures that wish to return error(8,n) information to their callers via errno should call Tcl_SetErrno rather than setting errno directly. Tcl_GetErrno returns the current value of errno. Procedures wishing to access(2,5) errno should call this procedure instead of accessing errno directly. Tcl_ErrnoId and Tcl_ErrnoMsg return string(3,n) representations of errno values. Tcl_ErrnoId returns a machine-readable textual identifier such as "EACCES" that corresponds to the current value of errno. Tcl_ErrnoMsg returns a human-readable string(3,n) such as "permission denied" that corresponds to the value of its errorCode argument. The errorCode argument is typically the value returned by Tcl_GetErrno. The strings returned by these functions are statically allocated and the caller must not free or modify them. KEYWORDS errno, error(8,n) code, global variables Tcl 8.3 Tcl_SetErrno(3)