On Thu, 02 Oct 2008 15:45:25 -0700, Nate Eldredge <na**@vulcan.lanwrote:
However, there does seem to be a tradition of implementations
including a few joke error codes in <errno.h>. glibc, notably,
includes EGRATUITOUS, EGREGIOUS, EIEIO, and ED ("The experienced user
will know what is wrong"). FreeBSD is a bit more sedate but does
include EDOOFUS. I have always wanted to find an excuse to use one of
these.
Heh!
Well, EDOOFUS isn't exactly a `joke value', because it is *used* in some
parts of the kernel. In my local version of the 8.0-CURRENT source tree
there are at least the following instances:
keramida@kobe:/usr/src/sys$ fgrep -nr EDOOFUS *
boot/efi/libefi/errno.c:89: errno = EDOOFUS;
dev/hwpmc/hwpmc_mod.c:2439: return EDOOFUS; /* programming error */
dev/md/md.c:1102: error = EDOOFUS;
dev/puc/puc.c:445: return (EDOOFUS);
dev/puc/puc_cfg.c:50: error = EDOOFUS;
geom/bde/g_bde_lock.c:414: return (EDOOFUS); /* Programming error */
geom/part/g_part.c:1332: error = EDOOFUS;
geom/part/g_part.c:1365: error = EDOOFUS; /* Prevent bogus uninit. warning. */
geom/part/g_part.c:1798: error = (arg == (uintptr_t)scheme) ? EDOOFUS : arg;
kern/subr_witness.c:1003: return (EDOOFUS);
sys/errno.h:168:#define EDOOFUS 88 /* Programming error */
keramida@kobe:/usr/src/sys$
Reading through a few cases where EDOOFUS appears, it looks more like a
catch-all value, meaning ``Oops! This wasn't meant to _ever_ happen.
Something looks remarkably screwed up, so let's break out of the kernel
and avoid making a more serious mess of anything.''.