errno.h in GLIBC
Jonny Grant
jg@jguk.org
Tue Oct 27 11:41:48 GMT 2020
Hello
I have three suggestions:
1)
Could bits/errno.h be updated to include <asm-generic/errno.h> directly?
At the moment it redirects via two intermediary header files
linux/errno.h => asm/errno.h => asm-generic/errno.h
2)
On GNU/Linux, <asm-generic/errno.h> and <asm-generic/errno-base.h> contain the real errno values.
<bits/errno.h> Has various backwards compatible macros. My linux kernel 5.4 has the following already
in asm-generic/errno.h. Is it safe to remove these backwards compatible macros now? People don't really use new GLIBC with ancient linux kernels I expect...
ECANCELED
EOWNERDEAD
ENOTRECOVERABLE
ERFKILL
EHWPOISON
ENOTSUP is not present, I saw there is discussion. So better keep that one.
https://sourceware.org/bugzilla/show_bug.cgi?id=2363
glibc/sysdeps/mach/hurd/bits/errno.h has the first three, with the Mach style numbering, but not
ERFKILL
EHWPOISON
But anyway Hurd uses a different numbering, so probably not relying on the linux style.
3)
There are various old header files, that simply redirect.
linux/errno.h
asm/errno.h
sys/errno.h [not used, seems to be a Solaris thing]
Once redirects are removed, the files could be deleted?
Or at least a #warning
#warning "don't include this file, it will be removed in a future release of GLIBC"
My notes on the files:
/usr/include/errno.h Regular header to include
/usr/include/linux/errno.h REDIRECT <asm/errno.h>
/usr/include/sys/errno.h REDIRECT <errno.h>
/usr/include/x86_64-linux-gnu/asm/errno.h REDIRECT <asm-generic/errno.h>
/usr/include/x86_64-linux-gnu/bits/errno.h CONTAINS extra macro constants
/usr/include/x86_64-linux-gnu/sys/errno.h
/usr/include/asm-generic/errno.h CONTAINS real Linux macros
/usr/include/asm-generic/errno-base.h CONTAINS real Linux macros
Regards, Jonny
More information about the Libc-alpha
mailing list