*/
#define _GNU_SOURCE
+#define _LGPL_SOURCE
#include <assert.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <common/common.h>
#include <common/defaults.h>
+#include <common/compat/endian.h>
#include <common/utils.h>
#include "index.h"
hdr.magic = htobe32(CTF_INDEX_MAGIC);
hdr.index_major = htobe32(CTF_INDEX_MAJOR);
hdr.index_minor = htobe32(CTF_INDEX_MINOR);
- hdr.packet_index_len = sizeof(struct ctf_packet_index);
+ hdr.packet_index_len = htobe32(sizeof(struct ctf_packet_index));
size_ret = lttng_write(fd, &hdr, sizeof(hdr));
if (size_ret < sizeof(hdr)) {