X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=man3%2Ferrno.3;h=5beb46487d66cdd335a141e504f0f46d0acd7a38;hp=80cb02d1be11d14bd79094b108590560630a6227;hb=abc15df6b9fae3374d24c7cf5c3ab94c605b2a6d;hpb=8894c921674bb116d0a7b8f23a55311e7a768019 diff --git a/man3/errno.3 b/man3/errno.3 index 80cb02d..5beb464 100644 --- a/man3/errno.3 +++ b/man3/errno.3 @@ -1,66 +1,66 @@ -.\" This file is part of the Public Domain C Library (PDCLib). -.\" Permission is granted to use, modify, and / or redistribute at will. -.\" -.Dd -.Dt ERRNO 3 -.Os -.\" -.Sh NAME -.Nm errno -.Nd library error result -.\" -.Sh SYNOPSIS -.In errno.h -.Pp -.Sy #define errno -.\" -.Sh DESCRIPTION -The header -.In errno.h -defines the name -.Va errno -to refer to an object of thread local storage duration. It is undefined whether -or not -.Va errno -refers to a preprocessor symbol or not. -.\" -.Pp -At program startup, the runtime shall initialize -.Va errno -to contain the value zero (the initial value in other threads is undefined). It -is guaranteed that no function provided by the C standard library shall set the -value of -.Va errno -to zero; therefore, for functions which do not have a unique return value for -indicating error, it is possible to determine whether an error occured by -setting -.Va errno -to zero before the call, then after the call seeing if an error value has been -stored into -.Va errno. -.Pp -.Bf Sy -Note that it is valid for any function which is not described as explicitly -setting -.Va errno -to set it to a non-zero value. Checking for a non-zero value is only valid with -functions which are defined to modify -.Va errno . -.Ef -.\" -.Pp -In some historical versions of the POSIX standard, the prescribed method of -using errno was to define -.Va extern int errno . -This is no longer supported by the POSIX or C standards, and will not work on -the majority of implementations, including this one. -.\" -.Sh SEE ALSO -.Xr errno.h 3 -.Xr abort 3 -.Xr assert 3 -\" -.Sh STANDARDS -Conforming to -.St -isoC-90 , +.\" This file is part of the Public Domain C Library (PDCLib). +.\" Permission is granted to use, modify, and / or redistribute at will. +.\" +.Dd +.Dt ERRNO 3 +.Os +.\" +.Sh NAME +.Nm errno +.Nd library error result +.\" +.Sh SYNOPSIS +.In errno.h +.Pp +.Sy #define errno +.\" +.Sh DESCRIPTION +The header +.In errno.h +defines the name +.Va errno +to refer to an object of thread local storage duration. It is undefined whether +or not +.Va errno +refers to a preprocessor symbol or not. +.\" +.Pp +At program startup, the runtime shall initialize +.Va errno +to contain the value zero (the initial value in other threads is undefined). It +is guaranteed that no function provided by the C standard library shall set the +value of +.Va errno +to zero; therefore, for functions which do not have a unique return value for +indicating error, it is possible to determine whether an error occured by +setting +.Va errno +to zero before the call, then after the call seeing if an error value has been +stored into +.Va errno. +.Pp +.Bf Sy +Note that it is valid for any function which is not described as explicitly +setting +.Va errno +to set it to a non-zero value. Checking for a non-zero value is only valid with +functions which are defined to modify +.Va errno . +.Ef +.\" +.Pp +In some historical versions of the POSIX standard, the prescribed method of +using errno was to define +.Va extern int errno . +This is no longer supported by the POSIX or C standards, and will not work on +the majority of implementations, including this one. +.\" +.Sh SEE ALSO +.Xr errno.h 3 +.Xr abort 3 +.Xr assert 3 +\" +.Sh STANDARDS +Conforming to +.St -isoC-90 , .St -isoC-99 . \ No newline at end of file