Re: [PATCH] Shift key-related error codes up and insert ECANCELED

From: Alan Cox
Date: Fri Oct 22 2004 - 23:06:02 EST


On Gwe, 2004-10-22 at 17:57, David Howells wrote:
> This patch shifts the key-related error codes up by one and inserts an
> ECANCELED error code where not already defined. It seems that has been defined
> in glibc without passing it back to the kernel:-/
>
> Who arbitrates error number allocations anyway?

Generally nobody because new error codes are almost always a mistake in
the first place especially when they don't appear in standards so no
application will correctly or sanely handle them.

You should use existing codes IMHO. Lets see

EKEYEXPIRED - ETIME (ETIMEDOUT ? ENOLINK ?)
ENOKEY - ENOENT
EKEYREJECTED - EILSEQ / EMSGSIZE / EPROTOTYPE ..
EKEYREVOKED - EREMCHG / ESHUTDOWN

And now I can use your key stuff with an existing C library and in LSB
compliant or cross platform code and give more information. If you look
through the kernel history we've almost never ever added an error code,
adding them just causes compatibility pain for everyone


Alan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/