public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
0a06350f87a587c1437d676eeab6b46f44e6c45c blob 1025 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
 
// SPDX-License-Identifier: GPL-2.0-or-later
/* epoll_ctl.c - epoll manipulation helpers
 *
 * Copyright Red Hat
 * Author: Laurent Vivier <lvivier@redhat.com>
 */

#include <errno.h>

#include "epoll_ctl.h"

/**
 * epoll_add() - Add a file descriptor to an epollfd
 * @epollfd:	epoll file descriptor to add to
 * @events:	epoll events
 * @ref:	epoll reference for the file descriptor (includes fd and metadata)
 *
 * Return: 0 on success, negative errno on failure
 */
int epoll_add(int epollfd, uint32_t events, union epoll_ref *ref)
{
	struct epoll_event ev;
	int ret;

	ev.events = events;
	ev.data.u64 = ref->u64;

	ret = epoll_ctl(epollfd, EPOLL_CTL_ADD, ref->fd, &ev);
	if (ret == -1) {
		ret = -errno;
		warn("Failed to add fd to epoll: %s", strerror_(-ret));
	}

	return ret;
}

/**
 * epoll_del() - Remove a file descriptor from an epollfd
 * @epollfd:	epoll file descriptor to remove from
 * @fd:		File descriptor to remove
 */
void epoll_del(int epollfd, int fd)
{
	epoll_ctl(epollfd, EPOLL_CTL_DEL, fd, NULL);
}
debug log:

solving 0a06350f87a5 ...
found 0a06350f87a5 in https://archives.passt.top/passt-dev/20251007164026.3882026-3-lvivier@redhat.com/

applying [1/1] https://archives.passt.top/passt-dev/20251007164026.3882026-3-lvivier@redhat.com/
diff --git a/epoll_ctl.c b/epoll_ctl.c
new file mode 100644
index 000000000000..0a06350f87a5

Checking patch epoll_ctl.c...
Applied patch epoll_ctl.c cleanly.

index at:
100644 0a06350f87a587c1437d676eeab6b46f44e6c45c	epoll_ctl.c

Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).