* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#define _GNU_SOURCE
-#include <byteswap.h>
#include <stdint.h>
#include <string.h>
#include <sys/mman.h>
+#include <unistd.h>
#include <lttng/ust-config.h>
#include <lttng/ust-ctl.h>
#include <lttng/ust-abi.h>
#include <lttng/ust-events.h>
+#include <lttng/ust-endian.h>
#include <usterr-signal-safe.h>
#include <ust-comm.h>
#include <helper.h>
ret = -errno;
return ret;
}
+ data->u.channel.wakeup_fd = -1;
}
free(data->u.channel.data);
+ data->u.channel.data = NULL;
break;
case LTTNG_UST_OBJECT_TYPE_STREAM:
if (data->u.stream.shm_fd >= 0) {
ret = -errno;
return ret;
}
+ data->u.stream.shm_fd = -1;
}
if (data->u.stream.wakeup_fd >= 0) {
ret = close(data->u.stream.wakeup_fd);
ret = -errno;
return ret;
}
+ data->u.stream.wakeup_fd = -1;
}
break;
case LTTNG_UST_OBJECT_TYPE_EVENT:
chan = consumer_chan->chan->chan;
*len = lib_ring_buffer_get_read_data_size(&chan->backend.config, buf,
consumer_chan->chan->handle);
- *len = PAGE_ALIGN(*len);
+ *len = LTTNG_UST_PAGE_ALIGN(*len);
return 0;
}
*uint64_t_alignment = reg_msg.uint64_t_alignment;
*long_alignment = reg_msg.long_alignment;
memcpy(name, reg_msg.name, LTTNG_UST_ABI_PROCNAME_LEN);
- if (reg_msg.major != LTTNG_UST_ABI_MAJOR_VERSION) {
+ if (reg_msg.major < LTTNG_UST_ABI_MAJOR_VERSION_OLDEST_COMPATIBLE ||
+ reg_msg.major > LTTNG_UST_ABI_MAJOR_VERSION) {
return -LTTNG_UST_ERR_UNSUP_MAJOR;
}