Move header_size field to the end of the structure, so that other
programs can still tell it is a sysstat sar data file, even though
the format has changed.
Also, to avoid causing format changes, add padding to the file_magic
structure so that when they grow in size other tools can still
handle the existing data.
Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
/* Structure for file magic header data */
struct file_magic {
- /*
- * Size of file's header (size of file_header structure used by file).
- */
- unsigned int header_size;
/*
* This field identifies the file as a file created by sysstat.
*/
unsigned char sysstat_patchlevel;
unsigned char sysstat_sublevel;
unsigned char sysstat_extraversion;
+ /*
+ * Size of file's header (size of file_header structure used by file).
+ */
+ unsigned int header_size;
+ /*
+ * Padding. Reserved for future use while avoiding a format change.
+ */
+ unsigned char pad[64];
};
#define FILE_MAGIC_SIZE (sizeof(struct file_magic))