glibc/manual
Rical Jasan 7e7af3496e manual: complete example in error message documentation
The manual gives "an example showing how to handle failure to open a
file correctly."  The example function, open_sesame, uses the
newly-introduced strerror function and errno and
program_invocation_short_name variables.  It fails to specify GNU
extensions, however, so attempts to use it in the following way:

    int main (void) {open_sesame ("badname");}

fail during compilation with "error: ‘program_invocation_short_name’
undeclared", indicating the example is incomplete.  The presence of
"#include"s suggest everything neccesary for the function to work should
be present.  For completeness, the example is lacking the following line:

    #define _GNU_SOURCE

as the declarations of program_invocation_*name in errno.h are wrapped
in an "#ifdef __USE_GNU" conditional.

The documentation of the variables is also expanded, adding that their
definition lies in errno.h and noting specifically they are GNU
extensions.
2015-03-06 00:59:49 -05:00
..
examples Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
argp.texi
arith.texi
charset.texi
check-safety.sh Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
conf.texi
contrib.texi glibc 2.21 pre-release update. 2015-02-05 23:14:38 -05:00
creature.texi
crypt.texi
ctype.texi
debug.texi
dir
errno.texi manual: complete example in error message documentation 2015-03-06 00:59:49 -05:00
fdl-1.3.texi
filesys.texi
freemanuals.texi
getopt.texi
header.texi
install-plain.texi
install.texi glibc 2.21 pre-release update. 2015-02-05 23:14:38 -05:00
intro.texi
io.texi
ipc.texi
job.texi
lang.texi
lgpl-2.1.texi
libc-texinfo.sh
libc.texinfo Update copyright dates not handled by scripts/update-copyrights. 2015-01-02 16:54:45 +00:00
libcbook.texi
libdl.texi
libm-err-tab.pl Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
llio.texi
locale.texi
macros.texi
maint.texi
Makefile Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
math.texi Refine documentation of libm exceptions goals. 2015-02-17 23:41:27 +00:00
memory.texi
message.texi
nss.texi
nsswitch.texi
pattern.texi
pipe.texi
platform.texi
probes.texi
process.texi
resource.texi
search.texi
setjmp.texi
signal.texi
socket.texi
startup.texi
stdio-fp.c
stdio.texi
string.texi
summary.awk Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
sysinfo.texi
syslog.texi
terminal.texi
texinfo.tex
texis.awk
threads.texi
time.texi * manual/time.texi (TZ Variable): glibc no longer comes with tzdata. 2015-02-16 15:32:34 -08:00
tsort.awk Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
users.texi
xtract-typefun.awk