Artifact 97f95f5a3f56db33a0cff533ff2ec03c0e3b21a7682ae00c1b6d690a2330a6b6:
- File doc/markdown/SetErrno.md — part of check-in [5e80e55e41] at 2026-09-26 22:40:07 on branch tip-700 — - added a "title" metadata element to the generated yaml block to satisfy Pandoc when converting to HTML - added markdown2html.tcl as prototype/placeholder of conversion script markdown -> HTML - added some CSS to play with a good visual representation of the generated HTML, starting with the n section pages - fixed man2markdown.tcl not giving the two .TP/.IP parsing places the same treatment (user: Torsten, size: 2433) [annotate] [blame] [check-ins using]
- File doc/markdown/TclCAPI/SetErrno.md — part of check-in [b84ce0eee1] at 2026-10-04 22:10:02 on branch tip-700 — file location re-organisation (part 1) (user: Torsten, size: 2433) [annotate] [blame] [check-ins using]
CommandName: Tcl_SetErrno title: Tcl_SetErrno ManualSection: 3 Version: 8.3 TclPart: Tcl TclDescription: Tcl Library Procedures Keywords:
- errno
- error code
- global variables Copyright:
- Copyright (c) 1996 Sun Microsystems, Inc. ---
Name
Tcl_SetErrno, Tcl_GetErrno, Tcl_ErrnoId, Tcl_ErrnoMsg, Tcl_WinConvertError - manipulate errno to store and retrieve error codes
Synopsis
::: {.synopsis} ::: #include <tcl.h> [void]{.ret} [Tcl_SetErrno]{.ccmd} [errorCode]{.cargs} [int]{.ret} [Tcl_GetErrno]{.ccmd} []{.cargs} [const char *]{.ret} [Tcl_ErrnoId]{.ccmd} []{.cargs} [const char *]{.ret} [Tcl_ErrnoMsg]{.ccmd} [errorCode]{.cargs} [void]{.ret} [Tcl_WinConvertError]{.ccmd} [winErrorCode]{.cargs} :::
Arguments
::: {.arguments} :::
[errorCode]{.carg .in type="int"} : A POSIX error code such as ENOENT.
[winErrorCode]{.carg .in type="DWORD"} : A Windows or Winsock error code such as ERROR_FILE_NOT_FOUND.
:::
Description
Tcl_SetErrno and Tcl_GetErrno provide portable access to the errno variable, which is used to record a POSIX error code after 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 call Tcl_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 the current value of errno. Tcl_ErrnoMsg returns a human-readable string 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.
Tcl_WinConvertError (Windows only) maps the passed Windows or Winsock error code to a POSIX error and stores it in errno.