mirror of https://github.com/mkerrisk/man-pages
errno.3: Recast the advice against manually declaring 'errno'
Recast the advice against manually declaring 'errno' to a more modern perspective. It's 13 years since the original text was added, and even then it was describing old behavior. Cast the description to be about behavior further away in time, and note more clearly that manual declaration will cause problems with modern C libraries. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
5db92f96f4
commit
6eb4b782a0
16
man3/errno.3
16
man3/errno.3
|
@ -614,18 +614,18 @@ if (somecall() == \-1) {
|
|||
.EE
|
||||
.in
|
||||
.PP
|
||||
It was common in traditional C to declare
|
||||
On some ancient systems,
|
||||
.I <errno.h>
|
||||
was not present or did not declare
|
||||
.IR errno ,
|
||||
so that it was necessary to declare
|
||||
.I errno
|
||||
manually
|
||||
(i.e.,
|
||||
.IR "extern int errno" )
|
||||
instead of including
|
||||
.IR <errno.h> .
|
||||
.IR "extern int errno" ).
|
||||
.BR "Do not do this" .
|
||||
It will not work with modern versions of the C library.
|
||||
However, on (very) old UNIX systems, there may be no
|
||||
.I <errno.h>
|
||||
and the declaration is needed.
|
||||
It long ago ceased to be necessary,
|
||||
and it will cause problems with modern versions of the C library.
|
||||
.SH SEE ALSO
|
||||
.BR errno (1), \" In the moreutils package
|
||||
.BR err (3),
|
||||
|
|
Loading…
Reference in New Issue