Re: [patch,rfc] BSD accounting format rework

From: Robin Holt
Date: Fri Mar 19 2004 - 16:19:59 EST


> One idea is to add the size of the structure to log. The start of the
> struct could be something like:
> struct acct_base {
> char flags;
> char ac_version;
> __u16 ac_size;
> }
>
> This makes future extentions easier in two seperate ways:
> Userspace acct can recognize futuristic data structures. It will, of
> course, not be able to process them, but it can warn the user and then
> continue on to the next struct.
>
> Also, it would make it possible to add new fields at the end of the
> structure _without_ bumping the version-number. (Like an extention to
> the same format). When userspace find a v2 struct bigger that it's
> "struct acct_v2" it can parse the first part of the data with struct
> acct_v2 and just ignore the rest. This makes it trivial to add new
> fields without breaking userspace.

How about breaking the ac_version structure down as two nibbles? One
half being the major version and the other half being a minor version.
The major version, when changed, means the structure is no longer compatible.
The minor version can be changed when existing fields are not modified
in either form or function.

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