backend/session: wire up openbsd support

This commit is contained in:
illiliti 2026-05-23 09:03:13 +03:00
parent 326bd749ee
commit f56f21b98f
2 changed files with 57 additions and 7 deletions

View file

@ -0,0 +1,41 @@
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdbool.h>
#include "backend/session/session.h"
struct drm_event_monitor {
int fd;
};
// TODO: use kqueue NOTE_CHANGE mechanism
struct drm_event_monitor *monitor_drm_events(int *fd) {
struct drm_event_monitor *ctx = calloc(1, sizeof(struct drm_event_monitor));
if (!ctx) {
return NULL;
}
ctx->fd = open("/dev/null", O_RDONLY);
if (ctx->fd == -1) {
free(ctx);
return NULL;
}
*fd = ctx->fd;
return ctx;
}
void drm_event_monitor_free(struct drm_event_monitor *ctx) {
close(ctx->fd);
free(ctx);
}
int receive_drm_device(struct drm_event_monitor *ctx,
struct drm_event_content *ev) {
return -1;
}
const char *get_device_seat(struct drm_event_monitor *ctx, const char *devnode) {
return NULL;
}
bool is_drm_device_primary(struct drm_event_monitor *ctx, const char *devnode) {
return false;
}