From 23aa722c155a6e40149ee421c9e740f7f6c0bdad Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Fri, 25 Jul 2025 14:35:33 +0200 Subject: [PATCH] os: move X_NOTIFY_* defines to separate header These defines are already public, used by consumers of SetNotifyFd(), but also needed in places where os.h cannot be included. Signed-off-by: Enrico Weigelt, metux IT consult --- include/fd_notify.h | 15 +++++++++++++++ include/meson.build | 1 + include/os.h | 5 +---- os/ospoll.c | 1 + 4 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 include/fd_notify.h diff --git a/include/fd_notify.h b/include/fd_notify.h new file mode 100644 index 0000000000..40eafe0864 --- /dev/null +++ b/include/fd_notify.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: MIT OR X11 + * + * Copyright © 2024 Enrico Weigelt, metux IT consult + * + * @brief: defines needed for SetNotifyFd() as well as ospoll + */ +#ifndef _XSERVER_INCLUDE_FDNOTIFY_H +#define _XSERVER_INCLUDE_FDNOTIFY_H + +#define X_NOTIFY_NONE 0x0 +#define X_NOTIFY_READ 0x1 +#define X_NOTIFY_WRITE 0x2 +#define X_NOTIFY_ERROR 0x4 /* don't need to select for, always reported */ + +#endif /* _XSERVER_INCLUDE_FDNOTIFY_H */ diff --git a/include/meson.build b/include/meson.build index 70436f6bec..096cd4d313 100644 --- a/include/meson.build +++ b/include/meson.build @@ -446,6 +446,7 @@ if build_xorg 'extension.h', 'extinit.h', 'extnsionst.h', + 'fd_notify.h', 'fourcc.h', 'gc.h', 'gcstruct.h', diff --git a/include/os.h b/include/os.h index 7f74e588cf..ab7e042eb3 100644 --- a/include/os.h +++ b/include/os.h @@ -98,10 +98,7 @@ extern _X_EXPORT int WriteToClient(ClientPtr /*who */ , int /*count */ , typedef void (*NotifyFdProcPtr)(int fd, int ready, void *data); -#define X_NOTIFY_NONE 0x0 -#define X_NOTIFY_READ 0x1 -#define X_NOTIFY_WRITE 0x2 -#define X_NOTIFY_ERROR 0x4 /* don't need to select for, always reported */ +#include "fd_notify.h" extern _X_EXPORT Bool SetNotifyFd(int fd, NotifyFdProcPtr notify_fd, int mask, void *data); diff --git a/os/ospoll.c b/os/ospoll.c index 70ed71f4f7..07904dad91 100644 --- a/os/ospoll.c +++ b/os/ospoll.c @@ -27,6 +27,7 @@ #include #include +#include "include/fd_notify.h" #include "os/xserver_poll.h" #include "misc.h" /* for typedef of pointer */