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 <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2026-01-13 20:49:19 +01:00
parent b80ff48375
commit 5acf9d4069
2 changed files with 11 additions and 0 deletions

View File

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

View File

@@ -195,3 +195,8 @@ Bool xf86VidModeDisabled = FALSE;
Bool xf86VidModeAllowNonLocal = FALSE;
#endif
Bool xorgHWAccess = FALSE;
int xf86GetConsoleFd(void)
{
return xf86Info.consoleFd;
}