| /* SPDX-License-Identifier: GPL-2.0-only */ | |
| // Copyright (c) 2026 Jarkko Sakkinen | |
| #ifndef UCELLS_NOTIFY_H | |
| #define UCELLS_NOTIFY_H | |
| #include <linux/seccomp.h> | |
| #include <stdint.h> | |
| struct dispatch_outcome { | |
| enum { | |
| DISPATCH_CONTINUE, | |
| DISPATCH_VALUE, | |
| DISPATCH_SEND_FD, | |
| DISPATCH_REPLACE_FD, | |
| } type; | |
| union { | |
| int64_t value; | |
| struct { | |
| int fd; | |
| bool cloexec; | |
| }; | |
| struct { | |
| int src; | |
| uint32_t target_num; | |
| }; | |
| }; | |
| }; | |
| int install_cells_notif_filter(void); | |
| int notif_recv(int listener, struct seccomp_notif *out); | |
| bool notif_is_id_valid(int listener, uint64_t id); | |
| int notif_add_fd(int listener, uint64_t id, int src_fd, uint32_t newfd, | |
| uint32_t flags, uint32_t newfd_flags); | |
| int notif_send_value(int listener, uint64_t id, int64_t val); | |
| int notif_send_errno(int listener, uint64_t id, int err); | |
| int notif_send_continue(int listener, uint64_t id); | |
| #endif |