How to find out if program is running in wayland or x11 at runtime

On linux, glfw will pick from either x11 or wayland depending on which is available. Can I check whick one it initialized at runtime ? I need to implement some backend specific functionality and I need to do it for both of them.

You should check out the GLFW documentation on runtime platform selection, including querying the current platform.

Thanks, glfwGetPlatform() was it.