-int write_index_header(int fd)
-{
- struct lttng_packet_index_file_hdr hdr;
- int ret;
-
- memcpy(hdr.magic, INDEX_MAGIC, sizeof(hdr.magic));
- hdr.index_major = htobe32(INDEX_MAJOR);
- hdr.index_minor = htobe32(INDEX_MINOR);
-
- do {
- ret = write(fd, &hdr, sizeof(hdr));
- } while (ret < 0 && errno == EINTR);
- if (ret < 0) {
- perror("write index header");
- goto error;
- }
-
-error:
- return ret;
-}
-