SetErrno.3
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:2k
- '"
- '" Copyright (c) 1996 Sun Microsystems, Inc.
- '"
- '" See the file "license.terms" for information on usage and redistribution
- '" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- '"
- '" RCS: @(#) $Id: SetErrno.3,v 1.5 2002/01/15 21:47:27 dgp Exp $
- .so man.macros
- .TH Tcl_SetErrno 3 8.3 Tcl "Tcl Library Procedures"
- .BS
- .SH NAME
- Tcl_SetErrno, Tcl_GetErrno, Tcl_ErrnoId, Tcl_ErrnoMsg - manipulate errno to store and retrieve error codes
- .SH SYNOPSIS
- .nf
- fB#include <tcl.h>fR
- .sp
- void
- fBTcl_SetErrnofR(fIerrorCodefR)
- .sp
- int
- fBTcl_GetErrnofR()
- .sp
- CONST char *
- fBTcl_ErrnoIdfR()
- .sp
- CONST char *
- fBTcl_ErrnoMsgfR(fIerrorCodefR)
- .sp
- .SH ARGUMENTS
- .AS int errorCode in
- .AP int errorCode in
- A POSIX error code such as fBENOENTfR.
- .BE
- .SH DESCRIPTION
- .PP
- fBTcl_SetErrnofR and fBTcl_GetErrnofR provide portable access
- to the fBerrnofR variable, which is used to record a POSIX error
- code after system calls and other operations such as fBTcl_GetsfR.
- These procedures are necessary because global variable accesses cannot
- be made across module boundaries on some platforms.
- .PP
- fBTcl_SetErrnofR sets the fBerrnofR variable to the value of the
- fIerrorCodefR argument
- C procedures that wish to return error information to their callers
- via fBerrnofR should call fBTcl_SetErrnofR rather than setting
- fBerrnofR directly.
- .PP
- fBTcl_GetErrnofR returns the current value of fBerrnofR.
- Procedures wishing to access fBerrnofR should call this procedure
- instead of accessing fBerrnofR directly.
- .PP
- fBTcl_ErrnoIdfR and fBTcl_ErrnoMsgfR return string
- representations of fBerrnofR values. fBTcl_ErrnoIdfR
- returns a machine-readable textual identifier such as
- "EACCES" that corresponds to the current value of fBerrnofR.
- fBTcl_ErrnoMsgfR returns a human-readable string such as
- "permission denied" that corresponds to the value of its
- fIerrorCodefR argument. The fIerrorCodefR argument is
- typically the value returned by fBTcl_GetErrnofR.
- The strings returned by these functions are
- statically allocated and the caller must not free or modify them.
- .SH KEYWORDS
- errno, error code, global variables