#define _LGPL_SOURCE
#include <stdbool.h>
-#include <common/common.h>
-#include <common/kernel-ctl/kernel-ctl.h>
+#include <common/common.hpp>
+#include <common/kernel-ctl/kernel-ctl.hpp>
-#include "lttng-sessiond.h"
-#include "kernel.h"
-#include "lttng-syscall.h"
-#include "utils.h"
+#include "lttng-sessiond.hpp"
+#include "kernel.hpp"
+#include "lttng-syscall.hpp"
+#include "utils.hpp"
/* Global syscall table. */
struct syscall *syscall_table;
}
nbmem = SYSCALL_TABLE_INIT_SIZE;
- syscall_table = (struct syscall *) zmalloc(sizeof(struct syscall) * nbmem);
+ syscall_table = calloc<struct syscall>(nbmem);
if (!syscall_table) {
ret = -errno;
PERROR("syscall list zmalloc");
lttng_ht_lookup(ht, (void *) name, &iter);
node = lttng_ht_iter_get_node_str(&iter);
if (node) {
- ksyscall = caa_container_of(node, struct syscall, node);
+ ksyscall = lttng::utils::container_of(node, &syscall::node);
}
return ksyscall;
LTTNG_ASSERT(ht);
- ksyscall = (struct syscall *) zmalloc(sizeof(*ksyscall));
+ ksyscall = zmalloc<struct syscall>();
if (!ksyscall) {
ret = -LTTNG_ERR_NOMEM;
goto error;
* them might not be valid. The count below will make sure to return the
* right size of the events array.
*/
- events = (lttng_event *) zmalloc(syscall_table_nb_entry * sizeof(*events));
+ events = calloc<lttng_event>(syscall_table_nb_entry);
if (!events) {
PERROR("syscall table list zmalloc");
ret = -LTTNG_ERR_NOMEM;