The Pedigree Project 0.1
recvmmsg-syscalls.h
1/* Copyright (c) 2026, Pedigree Developers. */
2#ifndef RECVMMSG_SYSCALLS_H
3#define RECVMMSG_SYSCALLS_H
4
5#include <stddef.h>
6
7#include "linux-wait-abi.h"
8#include <sys/socket.h>
9
10class DescriptorLease;
11
13 struct msghdr msg_hdr;
14 unsigned int msg_len;
15};
16
17#if UINTPTR_MAX == UINT64_MAX
18static_assert(sizeof(LinuxMmsghdr) == 64 && offsetof(LinuxMmsghdr, msg_len) == 56,
19 "Linux amd64 mmsghdr layout must match musl.");
20#endif
21
22ssize_t posix_recvmsg_user_descriptor(const DescriptorLease& descriptor, struct msghdr* message,
23 int flags, unsigned int* receivedLength = nullptr);
24int posix_recvmmsg(int fd, LinuxMmsghdr* messages, unsigned int count, unsigned int flags,
25 LinuxKernelTimespec* timeout);
26
27#endif