question about Glibc extensions
Martin Sebor
msebor@gmail.com
Wed May 20 16:20:23 GMT 2020
I'm wondering how to go about figuring out what Glibc's expected
behavior is in cases where the standard (e.g., C or POSIX) doesn't
say. Should the Glibc manual take precedence over the Linux
Programmer's Manual (http://man7.org/linux/man-pages) or should
it be the other way around?
For example, C (and POSIX) requires the first argument to mbstowcs
to be a valid non-null pointer, but the mbstowcs man page says it
can be null. The Glibc manual doesn't mention it.
Another example is the POSIX readlink function which is required
to set errno to EINVAL if (and only if) the path argument names
a file that is not a symbolic link, but the Linux man page
says it also sets it to EINVAL when the (unsigned) bufsiz
argument is not positive. The Glibc manual doesn't mention
this behavior.
(Both of these have come up while adding the GCC 10 access attribute
to Glibc's APIs as GCC warns about uses of these extensions.)
Thanks
Martin
PS Where does material for the Linux man pages that describe Glibc
specifics come from?
More information about the Libc-alpha
mailing list