| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | // Copyright 2023 Juan Palacios <[email protected]> |
| 3 | |
| 4 | #pragma once |
| 5 | |
| 6 | #include <stdbool.h> |
| 7 | #include <stddef.h> |
| 8 | |
| 9 | typedef enum process_event_type_t { |
| 10 | PROCESS_EVENT_EXEC, |
| 11 | PROCESS_EVENT_EXIT, |
| 12 | PROCESS_EVENT_OTHER, |
| 13 | } process_event_type; |
| 14 | |
| 15 | typedef struct process_event_t |
| 16 | { |
| 17 | process_event_type type; |
| 18 | int pid; |
| 19 | } process_event; |
| 20 | |
| 21 | int process_event_connector_new(); |
| 22 | int process_event_connector_close(int socket_fd); |
| 23 | int process_event_connector_set_timeout(int socket_fd, unsigned int seconds); |
| 24 | int process_event_connector_bind(int socket_fd); |
| 25 | int process_event_connector_subscribe(int socket_fd, bool subscribe); |
| 26 | int process_event_connector_install_filter(int socket_fd); |
| 27 | process_event process_event_connector_read_event(int socket_fd); |