Re: [patch 1/2] x86, ptrace: add version and last remaining sizeto status command

From: Ingo Molnar
Date: Tue Jan 08 2008 - 04:51:46 EST



* Markus Metzger <markus.t.metzger@xxxxxxxxx> wrote:

> Return the API version and the size of a bts_struct in the
> PTRACE_BTS_STATUS command. This might be handy in case other archs
> want to use and extend the interface. It allows users to program
> against one version and continue to work for newer versions (they have
> to discard everything they don't understand, of course).

i think this will be quite handy. But:

+ /* actual size of bts_struct in bytes */
+ unsigned short bts_size;
+ /* interface version */
+ unsigned short version;

please dont use shorts. Lets just us bts_size and no version at all, ok?
Any change to the ABI will be extension and that can be done by changing
the size of the data structure. We try to avoid doing versioned APIs in
Linux syscalls.

and while at it, how about using u32/u64 for the fields (that's how we
expose ABIs, even if we know that 'unsigned int' is always 32-bit on
x86), and add support for COMPAT as well?

Ingo
--
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/