14#define do_read(fd, buffer, size) io_read(fd, buffer, size)
15#define do_write(fd, buffer, size) io_write(fd, buffer, size)
16#define do_warn(fmt, ...) mos_warn(fmt, ##__VA_ARGS__)
19#define do_read(fd, buffer, size) read(fd, buffer, size)
20#define do_write(fd, buffer, size) write(fd, buffer, size)
21#define do_warn(fmt, ...) fprintf(stderr, fmt __VA_OPT__(, ) __VA_ARGS__)
49 if (read_size !=
sizeof(
size))
51 do_warn(
"failed to read size from ipc channel");
57 if (read_size !=
size)
59 do_warn(
"failed to read data from ipc channel");
70 if (written !=
sizeof(
buffer->size))
72 do_warn(
"failed to write size to ipc channel");
77 if (written !=
buffer->size)
79 do_warn(
"failed to write data to ipc channel");
92 do_warn(
"failed to write size to ipc channel");
98 do_warn(
"failed to write data to ipc channel");
108 size_t data_size = 0;
112 do_warn(
"failed to read size from ipc channel");
116 if (
unlikely(data_size > buffer_size))
125 do_warn(
"failed to read data from ipc channel");
ipc_msg_t * ipc_read_msg(ipcfd_t fd)
Read an IPC message.
bool ipc_write_as_msg(ipcfd_t fd, const char *data, size_t size)
bool ipc_write_msg(ipcfd_t fd, ipc_msg_t *buffer)
Write an IPC message.
ipc_msg_t * ipc_msg_create(size_t size)
Create a new IPC message.
#define do_read(fd, buffer, size)
#define do_write(fd, buffer, size)
size_t ipc_read_as_msg(ipcfd_t fd, char *buffer, size_t buffer_size)
void ipc_msg_destroy(ipc_msg_t *buffer)
Destroy an IPC message.
#define MOS_STATIC_ASSERT
unsigned long long uint64_t