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 */