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

Alan Cox
2004-10-23T03:45:01Z

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