From 5acf9d4069420f2a1825489079fa6f0c1dd8ed0d Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Tue, 13 Jan 2026 20:49:19 +0100 Subject: [PATCH] xfree86: add exported xf86GetConsoleFd() This functions is designed for some legacy keyboard drivers (eg. xf86-input-keyboard) that need to get the fd to the console device, so they don't need to directly access xf86Info field anymore. Signed-off-by: Enrico Weigelt, metux IT consult --- hw/xfree86/common/xf86.h | 6 ++++++ hw/xfree86/common/xf86Globals.c | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h index 463adfdca7..fafbb9ecbb 100644 --- a/hw/xfree86/common/xf86.h +++ b/hw/xfree86/common/xf86.h @@ -282,4 +282,10 @@ extern _X_EXPORT ScreenPtr xf86ScrnToScreen(ScrnInfoPtr pScrn); #define xf86MsgVerb LogMessageVerb #define xf86Msg(type, ...) LogMessageVerb(type, 1, __VA_ARGS__) +/* + * retrieve file descriptor to opened console device. + * only for some legacy keyboard drivers (xf86-input-keyboard) + */ +_X_EXPORT int xf86GetConsoleFd(void); + #endif /* _XF86_H */ diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c index 58e20dcde3..371b851443 100644 --- a/hw/xfree86/common/xf86Globals.c +++ b/hw/xfree86/common/xf86Globals.c @@ -195,3 +195,8 @@ Bool xf86VidModeDisabled = FALSE; Bool xf86VidModeAllowNonLocal = FALSE; #endif Bool xorgHWAccess = FALSE; + +int xf86GetConsoleFd(void) +{ + return xf86Info.consoleFd; +}